This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Fwd: Breakage on builder Fedora-x86_64-w64-mingw32, revision 79b377b3cf3a0e71e1e4710c4ee1e65e7a27a5d4
- From: Nick Alcock <nick dot alcock at oracle dot com>
- To: Nick Clifton <nickc at redhat dot com>, "binutils\@sourceware.org" <binutils at sourceware dot org>
- Date: Tue, 04 Jun 2019 14:58:04 +0100
- Subject: Re: Fwd: Breakage on builder Fedora-x86_64-w64-mingw32, revision 79b377b3cf3a0e71e1e4710c4ee1e65e7a27a5d4
- References: <E1hXpQT-0007X3-B6@kwanyin.sergiodj.net> <e18bbee1-8097-058c-ef5c-6f4c0105df53@redhat.com> <87sgspwj7k.fsf@esperi.org.uk>
On 4 Jun 2019, Nick Alcock uttered the following:
> On 4 Jun 2019, Nick Clifton verbalised:
>
>> It looks like you might need a configure test for dup3(), or something similar.
>> (I chose dup3 because that it what libiberty appears to check when testing for
>> O_CLOEXEC availability).
>
> Hm, I'm not sure why we can't just check for O_CLOEXEC itself. It's just
> a #define, and always for an integer, given the prototype of open():
> test-compiling
>
> int foo = O_CLOEXEC;
>
> should be sufficient, I'd think.
>
> (... why hasn't this showed up in my mingw tests? Maybe this was added
> in a recent mingw, and I'm using something later than that?)
Actually what gnulib does is even simpler:
[AC_LANG_PROGRAM([[#include <fcntl.h>
#ifndef O_CLOEXEC
choke me;
#endif
]],
[[return O_CLOEXEC;]])],
That really does seem likely to be enough. O_CLOEXEC is always a
#define, after all... and the return from main() ensures that it's
integral.
gnulib is the acme of portability, etc, so I'll do that.