bug-gnulib
[Top][All Lists]
Advanced

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

Re: bug#9141: [PATCH 1/3] extensions: Enable extensions on MacOS X 10.5


From: Paul Eggert
Subject: Re: bug#9141: [PATCH 1/3] extensions: Enable extensions on MacOS X 10.5 and later.
Date: Sat, 23 Jul 2011 11:34:05 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.18) Gecko/20110617 Thunderbird/3.1.11

On 07/22/11 17:23, Bruno Haible wrote:
> The usual idiom in the MacOS X header files is
> 
>   #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
> 
> So, I expect that your change will be a no-op for almost everyone.

Thanks for the clarification.

I looked through what I could glean from Google searches, and
found some places that do not use the above pattern.  For example,
<http://www.opensource.apple.com/source/xnu/xnu-1456.1.26/bsd/sys/select.h>
says something like this:

int      pselect(int, fd_set * __restrict, fd_set * __restrict,
                fd_set * __restrict, const struct timespec * __restrict,
                const sigset_t * __restrict)
#if defined(_DARWIN_C_SOURCE) || defined(_DARWIN_UNLIMITED_SELECT)
                __DARWIN_EXTSN_C(pselect)
#else
#  if defined(__LP64__) && !__DARWIN_NON_CANCELABLE
                __DARWIN_1050(pselect)
#  else
                __DARWIN_ALIAS_C(pselect)
#  endif
#endif
                ;

and <http://www.opensource.apple.com/source/Libc/Libc-498.1.7/include/stdlib.h>
says something like this:

#if (__DARWIN_UNIX03 && !defined(_POSIX_C_SOURCE)) || defined(_DARWIN_C_SOURCE) 
|| defined(_DARWIN_BETTER_REALPATH)
char    *realpath(const char * __restrict, char * __restrict) 
__DARWIN_EXTSN(realpath);
#else
char    *realpath(const char * __restrict, char * __restrict) 
__DARWIN_ALIAS(realpath);
#endif

which suggests that realpath and pselect have "extended" runtime behavior if
_DARWIN_C_SOURCE is defined.

My guess is that these runtime differences are in the same spirit
as _GNU_SOURCE, i.e., they enable desirable changes that POSIX
would otherwise prohibit.  If so, the patch should be kept.
But if these changes are undesirable, the patch should be backed out.



reply via email to

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