This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Define _POSIX_SOURCE in cygwin's features.h?
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Christopher Faylor on 1/12/2006 12:24 PM:
> This particular application was ircd. It was testing _POSIX_SOURCE (and
> a few other defines) to determine whether it should use setsid or a
> two-argument version of setpgrp, e.g.:
>
> #ifdef _POSIX_SOURCE
> setsid ();
> #else
> setpgr(..., ...);
> #endif
That is a bug in ircd. It is ircd's responsibility to define
_POSIX_SOURCE itself if it wants strict POSIX compliance. In other words,
if ircd wants to guarantee that it will compile on all POSIX-compliant
systems, it should have defined _POSIX_SOURCE and then it could blindly
use setsid() without any further heartburn. But it is possible to be
portable to more systems than just those that are POSIX-compliant, so the
better approach for ircd would have been to do an autoconf test for the
existance of setsid, whether or not _POSIX_SOURCE was defined, and not a
test for the existance of _POSIX_SOURCE.
- --
Life is short - so eat dessert first!
Eric Blake ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFDx78U84KuGfSFAYARAqHtAKCPOxmuUCb1bWzkrNcHpUs7tJrNtACgrL9V
X1SSS7bGJHZhfKSNkz8+SSA=
=dXZ3
-----END PGP SIGNATURE-----
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/