Fwd: Breakage on builder Fedora-x86_64-w64-mingw32, revision 79b377b3cf3a0e71e1e4710c4ee1e65e7a27a5d4
Nick Alcock
nick.alcock@oracle.com
Tue Jun 4 13:58:00 GMT 2019
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.
More information about the Binutils
mailing list