Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
colanderman
on Aug 20, 2014
|
parent
|
context
|
favorite
| on:
fork() can fail
For daemonization, daemon(3) is better (EDIT: assuming you only care about Linux). (It also chdirs to /, closes STD*, and detaches from the terminal.)
cperciva
on Aug 20, 2014
|
next
[–]
Alas, daemon(3) is not POSIX.
mindajar
on Aug 20, 2014
|
prev
[–]
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: