X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Ffcntl.in.h;h=1e45a65a2130d3fa59da68c3216567d321221546;hb=4779b635ef35c7b0bc4044fcb5bc746d06f158c4;hp=b6521d67192eb4fcc7c1ac404868631d87468482;hpb=70a72e0f50411ccc776379a761725d8c8bec58a3;p=gnulib.git diff --git a/lib/fcntl.in.h b/lib/fcntl.in.h index b6521d671..1e45a65a2 100644 --- a/lib/fcntl.in.h +++ b/lib/fcntl.in.h @@ -1,6 +1,6 @@ /* Like , but with non-working flags defined to 0. - Copyright (C) 2006-2011 Free Software Foundation, Inc. + Copyright (C) 2006-2013 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -25,6 +25,8 @@ #if defined __need_system_fcntl_h /* Special invocation convention. */ +/* Needed before . + May also define off_t to a 64-bit type on native Windows. */ #include /* On some systems other than glibc, is a prerequisite of . On glibc systems, we would like to avoid namespace pollution. @@ -40,8 +42,10 @@ #else /* Normal invocation convention. */ -#ifndef _GL_FCNTL_H +#ifndef _@GUARD_PREFIX@_FCNTL_H +/* Needed before . + May also define off_t to a 64-bit type on native Windows. */ #include /* On some systems other than glibc, is a prerequisite of . On glibc systems, we would like to avoid namespace pollution. @@ -55,13 +59,19 @@ /* 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 #endif +/* Native Windows platforms declare open(), creat() in . */ +#if (@GNULIB_OPEN@ || defined GNULIB_POSIXCHECK) \ + && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) +# include +#endif + /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ @@ -177,12 +187,12 @@ _GL_WARN_ON_USE (openat, "openat is not portable - " /* Fix up the O_* macros. */ #if !defined O_DIRECT && defined O_DIRECTIO -/* Tru64 spells it `O_DIRECTIO'. */ +/* Tru64 spells it 'O_DIRECTIO'. */ # define O_DIRECT O_DIRECTIO #endif #if !defined O_CLOEXEC && defined O_NOINHERIT -/* Mingw spells it `O_NOINHERIT'. */ +/* Mingw spells it 'O_NOINHERIT'. */ # define O_CLOEXEC O_NOINHERIT #endif @@ -206,6 +216,10 @@ _GL_WARN_ON_USE (openat, "openat is not portable - " # define O_EXEC O_RDONLY /* This is often close enough in older systems. */ #endif +#ifndef O_IGNORE_CTTY +# define O_IGNORE_CTTY 0 +#endif + #ifndef O_NDELAY # define O_NDELAY 0 #endif @@ -218,6 +232,9 @@ _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 @@ -236,10 +253,18 @@ _GL_WARN_ON_USE (openat, "openat is not portable - " # define O_NOFOLLOW 0 #endif +#ifndef O_NOLINK +# define O_NOLINK 0 +#endif + #ifndef O_NOLINKS # define O_NOLINKS 0 #endif +#ifndef O_NOTRANS +# define O_NOTRANS 0 +#endif + #ifndef O_RSYNC # define O_RSYNC 0 #endif @@ -256,6 +281,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 @@ -312,6 +342,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