Max Kellermann | 12 Aug 2009 23:03

Re: [Musicpd-dev-team] mpd uclinux branch is not available

On 2009/08/12 22:48, Mike Frysinger <vapier.adi@...> wrote:
> however, there is still one use of fork() in the mpd source code in
> the daemonize_detach() function.  really this function should get
> punted and daemonize() should simply call the C library's daemon(0,1).
>  the daemon() function has existed since BSD 4.4, so for all realistic
> *nix targets, this function should be fine.
> -mike

What is the advantage of daemon(), and what is the problem with
fork()?

daemon() is not defined in any standard.  I'd like to avoid
non-standard functions.  Since we have to implement a fallback anyway,
we cannot save a single line of source by using daemon().

Max

Gmane