projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fmal: Avoid test failure on OpenBSD 5.1/SPARC64.
[gnulib.git]
/
lib
/
fcntl.in.h
diff --git
a/lib/fcntl.in.h
b/lib/fcntl.in.h
index
b6521d6
..
344bbe4
100644
(file)
--- a/
lib/fcntl.in.h
+++ b/
lib/fcntl.in.h
@@
-1,6
+1,6
@@
/* Like <fcntl.h>, but with non-working flags defined to 0.
/* Like <fcntl.h>, but with non-working flags defined to 0.
- Copyright (C) 2006-201
1
Free Software Foundation, Inc.
+ Copyright (C) 2006-201
2
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
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
@@
-40,7
+40,7
@@
#else
/* Normal invocation convention. */
#else
/* Normal invocation convention. */
-#ifndef _
GL
_FCNTL_H
+#ifndef _
@GUARD_PREFIX@
_FCNTL_H
#include <sys/types.h>
/* On some systems other than glibc, <sys/stat.h> is a prerequisite of
#include <sys/types.h>
/* On some systems other than glibc, <sys/stat.h> is a prerequisite of
@@
-55,13
+55,19
@@
/* The include_next requires a split double-inclusion guard. */
#@INCLUDE_NEXT@ @NEXT_FCNTL_H@
/* 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 <unistd.h>
#endif
#ifndef __GLIBC__ /* Avoid namespace pollution on glibc systems. */
# include <unistd.h>
#endif
+/* Native Windows platforms declare open(), creat() in <io.h>. */
+#if (@GNULIB_OPEN@ || defined GNULIB_POSIXCHECK) \
+ && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
+# include <io.h>
+#endif
+
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
@@
-177,12
+183,12
@@
_GL_WARN_ON_USE (openat, "openat is not portable - "
/* Fix up the O_* macros. */
#if !defined O_DIRECT && defined O_DIRECTIO
/* 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
# 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
# define O_CLOEXEC O_NOINHERIT
#endif
@@
-218,6
+224,9
@@
_GL_WARN_ON_USE (openat, "openat is not portable - "
# define O_NONBLOCK O_NDELAY
#endif
# 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
#if @GNULIB_NONBLOCKING@
# if O_NONBLOCK
# define GNULIB_defined_O_NONBLOCK 0
@@
-256,6
+265,11
@@
_GL_WARN_ON_USE (openat, "openat is not portable - "
# define O_TTY_INIT 0
#endif
# 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
/* 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
+326,6
@@
_GL_WARN_ON_USE (openat, "openat is not portable - "
#endif
#endif
-#endif /* _
GL
_FCNTL_H */
-#endif /* _
GL
_FCNTL_H */
+#endif /* _
@GUARD_PREFIX@
_FCNTL_H */
+#endif /* _
@GUARD_PREFIX@
_FCNTL_H */
#endif
#endif