On Sep 8, 2015, at 6:53 AM, David Edelsohn <dje....@gmail.com> wrote:
> On Tue, Sep 8, 2015 at 9:51 AM, FX <fxcoud...@gmail.com> wrote:
>>> #define _FCLOEXEC       0x0000001000000000L
>>> #define O_CLOEXEC       _FCLOEXEC       /* sets FD_CLOEXEC on open      */
>> 
>> That’s weird, and definitely an AIX bug: 
>> http://pubs.opengroup.org/onlinepubs/9699919799/functions/open.html
> 
> Welcome to AIX :-/
> 
>> How does that even work? open() takes int as second arg.
> 
> No one else uses it? ;-)
> 
> The following kluge works:
> 
> Index: posix.c
> ===================================================================
> --- posix.c     (revision 227528)
> +++ posix.c     (working copy)
> @@ -45,6 +45,10 @@
> #define O_BINARY 0
> #endif
> 
> +#ifdef _AIX
> +#undef O_CLOEXEC
> +#endif
> +

Not a big issue, but slightly better if (O_CLOEXEC>>32) != 0 is also true.  
See, if AIX should ever define this to a sensible value, the above would 
disappear the feature.  However, if they did, then this expression should then 
be false.

Reply via email to