• 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: Any caveats to using fork in a Foundation/CoreFoundation tool?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Any caveats to using fork in a Foundation/CoreFoundation tool?


  • Subject: Re: Any caveats to using fork in a Foundation/CoreFoundation tool?
  • From: John Stiles <email@hidden>
  • Date: Thu, 25 Oct 2007 10:14:48 -0700

The forked app no longer has valid Mach ports to the Window Server and other various services (like, say, the pasteboard), so if you try to utilize any of these services, you'll fail right away and it's not likely to be graceful :) Basically, if you fork, you have to behave as if you're a command line app and stop using any high level services.


Jim Correia wrote:
I have the need to launch a tool from my GUI application that needs to be in its own process group (i.e. the parent process should not be the GUI app which launched it, since it needs to outlive the parent process.)

It will use CFMessagePort to communicate with the parent app.

I seem to recall that using fork not followed immediately by exec was a bad idea for Foundation/CoreFoundation tools or applications, but at the moment I can't find those references in the archives.

Is using fork (or daemon, as the case may be) at the top of main going to cause me grief when I want to later use Foundation or CoreFoundation services?

Any other recommended approaches?

Jim
_______________________________________________

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
_______________________________________________

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: 
 >Any caveats to using fork in a Foundation/CoreFoundation tool? (From: Jim Correia <email@hidden>)

  • Prev by Date: Re: Any caveats to using fork in a Foundation/CoreFoundation tool?
  • Next by Date: Re: Any caveats to using fork in a Foundation/CoreFoundation tool?
  • Previous by thread: Re: Any caveats to using fork in a Foundation/CoreFoundation tool?
  • Next by thread: Re: Any caveats to using fork in a Foundation/CoreFoundation tool?
  • Index(es):
    • Date
    • Thread