Jukka Ruohonen wrote: > +/* XXX the daemon2_* functions should be in a library */ > + > +int __deamon2_detach_pipe[2]; > + > [...] > > Why not daemon(3)?
I'm working on a replacement for daemon(3) as a way of fixing PR 48282, and this seemed like a good way to give the code a workout before giving it wider exposure in a place like libc. This particular daemon is simple enough that it probably could have used daemon(3) without problems, but I'm aiming for a general solution that will work even for daemons that use threads or kqueues. Those cause problems with daemon(3) because they aren't inherited across a fork, which forces you to daemonize early, which in turn leads to race conditions as the parent process continues before the daemon is ready to provide service. -- Andreas Gustafsson, g...@netbsd.org