bug-inetutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-inetutils] Re: [PATCH 3/4] use daemon from the C library when possi


From: Simon Josefsson
Subject: [bug-inetutils] Re: [PATCH 3/4] use daemon from the C library when possible
Date: Sun, 21 Nov 2010 21:12:04 +0100
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.2 (gnu/linux)

Mike Frysinger <address@hidden> writes:

> On Sunday, November 21, 2010 14:43:56 Mike Frysinger wrote:
>> On Sunday, November 21, 2010 06:50:45 Simon Josefsson wrote:
>> > The 'daemon' function is not documented in the glibc manual, and it is
>> > not standardized by POSIX.  Should we use it?  Perhaps we should treat
>> > it the same way as 'ruserpass'.
>> 
>> it's in all BSD variants and all Linux variants.  that's good enough in my
>> book.  if you really want, i can add a daemon function check in configure
>> and base the result on that.
>
> err, nm, i remembered this is how i wrote the patch already.  even though the 
> func isnt in POSIX, BSD has long standardized its usage, so relying on it is 
> fine in my book.  plus, it fixes nommu support which supports daemon() but 
> not 
> fork().

The man page on my system says:

CONFORMING TO
       Not in POSIX.1-2001.  A similar function appears on the BSDs.
       The daemon() function first appeared in 4.4BSD.

NOTES
       The glibc implementation can also return -1 when /dev/null exists
       but is not a character device with the expected major and minor
       numbers.  In this case errno need not be set.

The wording "similar" looks like there may be trouble here.

Also, according to gnulib it is not implemented on AIX 5.1, HP-UX 11,
IRIX 6.5, OSF/1 5.1, mingw, BeOS:

http://www.gnu.org/software/gnulib/manual/html_node/daemon.html

I believe the best way to support this is to write a gnulib module for
it, rather than introducing more CPP magic.  I'll bring this up on the
gnulib list.

/Simon



reply via email to

[Prev in Thread] Current Thread [Next in Thread]