Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Daemonic solution... sort of...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Daemonic solution... sort of...



I found a rather ugly solution to the daemon() call problem I mentioned earlier.

Instead of daemon(), I call fork(), create a copy of the command line arguments, add an argument telling it not to fork again (otherwise we end up recursively creating thousands and thousands of processes... ask me how I know...) and call execve() to start a fresh new process. It's ugly, it's hideous, but it at least lets me get back to work... In theory, I could also call daemon() instead of fork(), but it seems that would create more overhead than it's worth.

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



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.