nonblocking: provide O_NONBLOCK for mingw
[gnulib.git] / doc / posix-headers / fcntl.texi
1 @node fcntl.h
2 @section @file{fcntl.h}
3
4 POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/basedefs/fcntl.h.html}
5
6 Gnulib module: fcntl-h
7
8 Portability problems fixed by Gnulib:
9 @itemize
10 @item
11 @samp{O_CLOEXEC}, @samp{O_DIRECTORY}, @samp{O_DSYNC}, @samp{O_NOCTTY},
12 @samp{O_NOFOLLOW}, @samp{O_RSYNC}, @samp{O_SYNC},
13 and @samp{O_TTY_INIT} are not defined on some platforms.  Gnulib defines
14 these macros to 0, which is generally safe.
15
16 @item
17 @samp{O_NONBLOCK} is not defined on some platforms.  If the
18 @samp{nonblocking} module is in use, gnulib guarantees a working
19 non-zero value; otherwise, the gnulib replacement is 0.
20
21 @item
22 @samp{O_EXEC} and @samp{O_SEARCH} are not defined on some platforms.
23 Gnulib defines these macros to @samp{O_RDONLY}, which is typically 0.
24
25 @item
26 @samp{O_BINARY}, @samp{O_TEXT} (not specified by POSIX, but essential for
27 portability to Woe32 platforms) are defined on some platforms but not on
28 others.
29
30 @item
31 @samp{O_DIRECT}, @samp{O_NDELAY}, @samp{O_NOATIME},
32 and @samp{O_NOLINKS} (not specified by POSIX) are defined
33 on some platforms but not on others.
34
35 @item
36 @samp{FD_CLOEXEC}, @samp{F_DUPFD}, and @samp{F_GETFD} are not defined
37 on some platforms:
38 mingw.
39
40 @item
41 @samp{F_DUPFD_CLOEXEC} is not defined on some platforms:
42 MacOS X 10.5, FreeBSD 6.0, NetBSD 5.0, OpenBSD 3.8, AIX 5.1, HP-UX 11,
43 IRIX 6.5, OSF/1 5.1, Solaris 11 2010-11, Cygwin 1.7.1, mingw, Interix 3.5,
44 BeOS.
45
46 @item
47 @samp{AT_FDCWD}, @samp{AT_EACCESS}, @samp{AT_SYMLINK_NOFOLLOW},
48 @samp{AT_SYMLINK_FOLLOW}, and @samp{AT_REMOVEDIR}
49 are not defined on many platforms:
50 glibc 2.3.6, MacOS X 10.5, FreeBSD 6.0, NetBSD 5.0, OpenBSD 3.8, AIX
51 5.1, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 8, Cygwin 1.5.x, mingw, Interix 3.5, BeOS.
52
53 @item
54 @samp{AT_FDCWD} is defined with a value too large for an @code{int} on some
55 platforms:
56 Solaris 11 2010-11.
57 @end itemize
58
59 Portability problems not fixed by Gnulib:
60 @itemize
61 @item
62 @samp{F_SETFD}, @samp{F_GETFL}, @samp{F_SETFL}, @samp{F_GETLK},
63 @samp{F_SETLK}, @samp{F_SETLOKW}, @samp{F_GETOWN}, and @samp{F_SETOWN}
64 are not defined on some platforms:
65 mingw.
66
67 @item
68 @samp{POSIX_FADV_DONTNEED}, @samp{POSIX_FADV_NOREUSE},
69 @samp{POSIX_FADV_NORMAL}, @samp{POSIX_FADV_RANDOM},
70 @samp{POSIX_FADV_SEQUENTIAL}, and @samp{POSIX_FADV_WILLNEED} are not
71 defined on some platforms.
72 @end itemize