bind9 doesn't close extra fds

Greg A. Woods woods at
Wed Sep 4 05:59:11 UTC 2002

[ On Wednesday, September 4, 2002 at 00:24:35 (-0400), James Ralston wrote: ]
> Subject: Re: bind9 doesn't close extra fds 
> That would be "all of them".
> (Meaning, I've never seen a daemon() function that properly closes all
> inherited file descriptors.)

No, it wouldn't be all of them, at least not any more.  A proper
implementation of daemon(3) can rely on the fact that whatever invoked
the program which it was about to daemonize had done so with the
close-on-exec flag set on any open file descriptors that were not
explicitly intended to be passed down to the program.

Unfortunately the error checking (or rather lack of error checking) in
the most common daemon(3) iplementation from *BSD does make it hard for
me to really recommend its use except in passing.

								Greg A. Woods

+1 416 218-0098;            <g.a.woods at>;           <woods at>
Planix, Inc. <woods at>; VE3TCP; Secrets of the Weird <woods at>

More information about the bind-workers mailing list