Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

For daemonization, daemon(3) is better (EDIT: assuming you only care about Linux). (It also chdirs to /, closes STD*, and detaches from the terminal.)


Alas, daemon(3) is not POSIX.


daemon(3) isn't part of POSIX, and the OS X man page says "the use of this API is discouraged in favor of using launchd(8)", so who knows what might happen here in the future.

If you don't care about portability, it's an easier call to make.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: