• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: fork/exec vs NSTask
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fork/exec vs NSTask


  • Subject: Re: fork/exec vs NSTask
  • From: Thomas Clement <email@hidden>
  • Date: Sun, 24 Oct 2010 21:14:14 +0200

On 24 oct. 2010, at 20:03, eveningnick eveningnick wrote:

>
>> Not great but should work.
>> Better would be to use LaunchServices, if not possible I would use SMJobSubmit() (ServicesManagement framework).
> Could you please explain why? What steps do i omit, if using fork/exec?

LaunchServices / SMJobSubmit will directly do the right thing for you (launch the process in the correct context).
No need to double fork and kill the parent.
In Mac OS X, using daemon(3) or doing the moral equivalent by calling fork() and having the parent process exit() is discouraged in favor of using launchd.

Note that SMJobSubmit if the equivalent API of the launchctl command mentioned by Greg.


Thomas_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >fork/exec vs NSTask (From: eveningnick eveningnick <email@hidden>)
 >Re: fork/exec vs NSTask (From: Thomas Clement <email@hidden>)
 >Re: fork/exec vs NSTask (From: eveningnick eveningnick <email@hidden>)

  • Prev by Date: Re: fork/exec vs NSTask
  • Next by Date: Re: fork/exec vs NSTask
  • Previous by thread: Re: fork/exec vs NSTask
  • Next by thread: Re: fork/exec vs NSTask
  • Index(es):
    • Date
    • Thread