• 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: weird problem ...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: weird problem ...


  • Subject: Re: weird problem ...
  • From: Lloyd Dupont <email@hidden>
  • Date: Fri, 9 May 2003 14:06:43 +1000

well I finally did something fairly complex for what it is ... but it worked !
I fork() ! (yes I did)

and then I execl() my program with some arguments.
and it worked !

On Friday, May 9, 2003, at 01:44 PM, Andrew Pinski wrote:

On Thursday, May 8, 2003, at 23:32 US/Eastern, Shaun Wexler wrote:

On Thursday, May 8, 2003, at 07:18 PM, Lloyd Dupont wrote:

mach ports cannot be done except after an exec, not fork.
ha ? uh ...
how could I do then ?

I plan to make it a StartupItem, so I need to make it a daemon, I mean at last I should return immediately (and how to do that, if not by using fork() ?)

and then I want to be able to do advanced communication, if I could avoid having to write my own version of DO on top of socket that would be cool.. any idea ?

call:

daemon(0, 0);

This will detach the program from the Terminal that's running it, and make the current process a daemon. Check the man page: 'man daemon'

Note deamon does the same thing as what the code he gave, it will not work.
The right thing to do is call exec on your program and have it pass another option saying do not fork.

Thanks,
Andrew Pinski
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: weird problem ... (From: Andrew Pinski <email@hidden>)

  • Prev by Date: Re: NSRunLoop mystery
  • Next by Date: Re: messages to nil
  • Previous by thread: Re: weird problem ...
  • Next by thread: Re: weird problem ...
  • Index(es):
    • Date
    • Thread