X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Ffcntl.in.h;h=0a072214a89ec47268818513490d0608d3fc293b;hb=b344de996cd51f8a2f2558a3172016b64d99c622;hp=18cac454ab3a7e6fa202672967629f3c349bd72c;hpb=d60f3b0c6b0f93a601acd1cfd3923f94ca05abb0;p=gnulib.git diff --git a/lib/fcntl.in.h b/lib/fcntl.in.h index 18cac454a..0a072214a 100644 --- a/lib/fcntl.in.h +++ b/lib/fcntl.in.h @@ -40,7 +40,7 @@ #else /* Normal invocation convention. */ -#ifndef _GL_FCNTL_H +#ifndef _@GUARD_PREFIX@_FCNTL_H #include /* On some systems other than glibc, is a prerequisite of @@ -55,8 +55,8 @@ /* The include_next requires a split double-inclusion guard. */ #@INCLUDE_NEXT@ @NEXT_FCNTL_H@ -#ifndef _GL_FCNTL_H -#define _GL_FCNTL_H +#ifndef _@GUARD_PREFIX@_FCNTL_H +#define _@GUARD_PREFIX@_FCNTL_H #ifndef __GLIBC__ /* Avoid namespace pollution on glibc systems. */ # include @@ -182,8 +182,7 @@ _GL_WARN_ON_USE (openat, "openat is not portable - " #endif #if !defined O_CLOEXEC && defined O_NOINHERIT -/* Mingw spells it `O_NOINHERIT'. Intentionally leave it - undefined if not available. */ +/* Mingw spells it `O_NOINHERIT'. */ # define O_CLOEXEC O_NOINHERIT #endif @@ -219,6 +218,19 @@ _GL_WARN_ON_USE (openat, "openat is not portable - " # define O_NONBLOCK O_NDELAY #endif +/* If the gnulib module 'nonblocking' is in use, guarantee a working non-zero + value of O_NONBLOCK. Otherwise, O_NONBLOCK is defined (above) to O_NDELAY + or to 0 as fallback. */ +#if @GNULIB_NONBLOCKING@ +# if O_NONBLOCK +# define GNULIB_defined_O_NONBLOCK 0 +# else +# define GNULIB_defined_O_NONBLOCK 1 +# undef O_NONBLOCK +# define O_NONBLOCK 0x40000000 +# endif +#endif + #ifndef O_NOCTTY # define O_NOCTTY 0 #endif @@ -247,6 +259,11 @@ _GL_WARN_ON_USE (openat, "openat is not portable - " # define O_TTY_INIT 0 #endif +#if O_ACCMODE != (O_RDONLY | O_WRONLY | O_RDWR | O_EXEC | O_SEARCH) +# undef O_ACCMODE +# define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR | O_EXEC | O_SEARCH) +#endif + /* For systems that distinguish between text and binary I/O. O_BINARY is usually declared in fcntl.h */ #if !defined O_BINARY && defined _O_BINARY @@ -303,6 +320,6 @@ _GL_WARN_ON_USE (openat, "openat is not portable - " #endif -#endif /* _GL_FCNTL_H */ -#endif /* _GL_FCNTL_H */ +#endif /* _@GUARD_PREFIX@_FCNTL_H */ +#endif /* _@GUARD_PREFIX@_FCNTL_H */ #endif