site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Thread-index: AcmQekaAo8LPpYo1nU6/UOMx02aOgg== Thread-topic: Mach Bootstrap_create_server, "server_command" parameter User-agent: Microsoft-Entourage/12.15.0.081119
Please make your job a launchd job instead of using bootstrap_create_server(), which is deprecated.
Thank you Damien. You I hate to ask, but could you offer a code example? It's deprecated for Mach IPC too? Here's what I am doing now to bootstrap, register a service and check it in: ------------ kr = bootstrap_create_server(bootstrap_port, "/usr/sbin/notifyd", getuid(), FALSE, &private_port); EXIT_ON_MACH_ERROR("bootstrap_create_server", kr, BOOTSTRAP_SUCCESS); kr = bootstrap_create_service(private_port, SERVICE_NAME, &server_port); EXIT_ON_MACH_ERROR("bootstrap_create_service", kr, BOOTSTRAP_SUCCESS); kr = bootstrap_check_in(private_port, SERVICE_NAME, &server_port); EXIT_ON_MACH_ERROR("bootstrap_check_in", kr, BOOTSTRAP_SUCCESS); printf("server_port = %d\n", server_port); // for (;;) { // server loop ---------- What should I do instead...I'll go lookup how to do a launchd call from OS X... Michael On 2/16/09 3:58 PM, "Damien Sorresso" <dsorresso@apple.com> wrote:
On Feb 16, 2009, at 12:37 PM, Michael Prenez-Isbell wrote:
Mach Bootstrap_create_server, "server_command" parameter --------------------------------------------------
On the bootstrap_create_server command, one of the parameters is "cmd_t server_command" In singh's Mac OS X Internals book he gives this example
kr = bootstrap_create_server(bootstrap_port, "/tmp/simple_ipc_server", getuid(), FALSE, &private_port); EXIT_ON_MACH_ERROR("bootstrap_create_server", kr, BOOTSTRAP_SUCCESS);
I have no idea what "/tmp/simple_ipc_server" is -- a directory? an executable?
If it¹s is an executable, what is it? the same file I'm calling it from?
My problem is that, on bootstrap_check_in, when I try to check in the service I created with bootstrap_create_service, the application freezes.
I am currently setting up launchd with debugging set up. Per amit¹s singh¹s suggestion in his book.
Please make your job a launchd job instead of using bootstrap_create_server(), which is deprecated.
_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com smime.p7s