site_archiver@lists.apple.com Delivered-To: Darwin-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:cc:message-id:from:to :in-reply-to:content-type:mime-version:subject:date:references :x-mailer; bh=K92298ItEbc1t6Iv8dcBi5LzUL85edPghHkuGrSLyMc=; b=pOFDXIGQlqOJriorVfUzqBl/ekZnqFiBcQoe58cNxDvLnm/3i+BnpaCkT7CrDQzpch tGusOVdIJ8SJOk537cIehrIvEJ+Jz9p+Cv2OCQf0FMW4AmRHHpibkwo5dtgg1fFqSEMj WBOlmujmvgdBsWsI9nw33erapA/vOkXlZbZ18= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=cc:message-id:from:to:in-reply-to:content-type:mime-version:subject :date:references:x-mailer; b=U7FXVgOEbGpbn//rqEKHSfWRlvy+ixyYlAteIdgJOG0r3sMtRuPMw8nDpFgrbOz5FE pxwRiMsr73Q4ZmiCkTpB4dz1T4pZT8Z5y8xOJyiwtblakoBzwOH0MgO5b0vSnzwCGk7i YTt6dX4l/s/mMI7Ru49qjFCXATbdbUrzoKrhs= On Sep 25, 2008, at 16:12 , Mario Emmenlauer wrote: Hi Terry, Is this allowed behaviour for a launchd-daemon? From: http://developer.apple.com/documentation/MacOSX/Conceptual/BPSystemStartup/A... and: [...] Do not close any stray file descriptors. [...] Jason _______________________________________________ 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 thanks for the quick, and really extensive reply! Can you (or somebody) point me to a good readme/technote/book on Mac OS standards? Searching apple.com for posix_spawn() lists almost exclusively the manpages of the functions, no more. Terry Lambert wrote: On Sep 25, 2008, at 9:50 AM, Mario Emmenlauer wrote: 2) I haven't tried pthread_start(), but its very likely to be equal This should have been posix_spawn(), not pthread_start()... but come on, they do sound similar :-D posix_spawn() is morally equivalent to a vfork() followed by an execve(), with the ability to do a limited set of intermediate work in between. I took: [...] This includes calling the daemon function, calling fork followed by exec, or calling fork followed by exit. [...] The documentation is not consistent in disallowed behaviour. The launchctl.plist manpage for example discourages calling fork()/exit() only for the parent process (not for the child), and only because launchd might assume it quit unexpectedly. You can call fork/exec inside your launchd daemon, what the documentation is talking about is backgrounding the daemon. That you're not allowed to do (i.e., fork/ exec then exit from the parent). As long as the parent gets managed by launchd and stays around when it's supposed to, you can spawn other processes. The second part of the documentation just notes that you shouldn't close stray file descriptors... it's not really a conflict. smime.p7s