annotate doc/posix-headers/fcntl.texi @ 17135:3ae14a5da4df

fcntl-h: support GNU flags like O_IGNORE_CTTY * doc/posix-headers/fcntl.texi (fcntl.h): Support O_IGNORE_CTTY, O_NOLINK, and O_NOTRANS. These flags are nonzero on GNU/Hurd systems. Discovered when using fcntl-h with GNU Emacs, which uses O_IGNORE_CTTY. Fix misspelling of F_SETLKW. * lib/fcntl.in.h (O_IGNORE_CTTY, O_NOLINK, O_NOTRANS): Define to 0 if not already defined. * tests/test-fcntl-h.c: Test these new flags.
author Paul Eggert <eggert@cs.ucla.edu>
date Mon, 15 Oct 2012 09:31:07 -0700
parents 498a2211d839
children 8e5a994a5d5b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9638
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1 @node fcntl.h
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2 @section @file{fcntl.h}
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3
13753
3d497ee2707b Update doc for POSIX:2008.
Bruno Haible <bruno@clisp.org>
parents: 13664
diff changeset
4 POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/basedefs/fcntl.h.html}
9638
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
5
11876
cc0527e5d2f4 fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents: 9638
diff changeset
6 Gnulib module: fcntl-h
9638
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
7
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8 Portability problems fixed by Gnulib:
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9 @itemize
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10 @item
15594
f4cfbb6036d8 Ensure pid_t gets defined.
Bruno Haible <bruno@clisp.org>
parents: 14534
diff changeset
11 The type @code{pid_t} is not defined on some platforms:
f4cfbb6036d8 Ensure pid_t gets defined.
Bruno Haible <bruno@clisp.org>
parents: 14534
diff changeset
12 MSVC 9.
f4cfbb6036d8 Ensure pid_t gets defined.
Bruno Haible <bruno@clisp.org>
parents: 14534
diff changeset
13
f4cfbb6036d8 Ensure pid_t gets defined.
Bruno Haible <bruno@clisp.org>
parents: 14534
diff changeset
14 @item
15629
f62fb3d6776f Support for MSVC compiler: Ensure mode_t gets defined.
Bruno Haible <bruno@clisp.org>
parents: 15614
diff changeset
15 The type @code{mode_t} is not defined on some platforms:
f62fb3d6776f Support for MSVC compiler: Ensure mode_t gets defined.
Bruno Haible <bruno@clisp.org>
parents: 15614
diff changeset
16 MSVC 9.
f62fb3d6776f Support for MSVC compiler: Ensure mode_t gets defined.
Bruno Haible <bruno@clisp.org>
parents: 15614
diff changeset
17
f62fb3d6776f Support for MSVC compiler: Ensure mode_t gets defined.
Bruno Haible <bruno@clisp.org>
parents: 15614
diff changeset
18 @item
13664
241057e2e60f fcntl-h: define O_CLOEXEC and O_EXEC if not defined; use new defines
Paul Eggert <eggert@cs.ucla.edu>
parents: 13549
diff changeset
19 @samp{O_CLOEXEC}, @samp{O_DIRECTORY}, @samp{O_DSYNC}, @samp{O_NOCTTY},
14532
0b3f0c54fbc8 nonblocking: provide O_NONBLOCK for mingw
Eric Blake <eblake@redhat.com>
parents: 13917
diff changeset
20 @samp{O_NOFOLLOW}, @samp{O_RSYNC}, @samp{O_SYNC},
13664
241057e2e60f fcntl-h: define O_CLOEXEC and O_EXEC if not defined; use new defines
Paul Eggert <eggert@cs.ucla.edu>
parents: 13549
diff changeset
21 and @samp{O_TTY_INIT} are not defined on some platforms. Gnulib defines
14532
0b3f0c54fbc8 nonblocking: provide O_NONBLOCK for mingw
Eric Blake <eblake@redhat.com>
parents: 13917
diff changeset
22 these macros to 0, which is generally safe.
0b3f0c54fbc8 nonblocking: provide O_NONBLOCK for mingw
Eric Blake <eblake@redhat.com>
parents: 13917
diff changeset
23
0b3f0c54fbc8 nonblocking: provide O_NONBLOCK for mingw
Eric Blake <eblake@redhat.com>
parents: 13917
diff changeset
24 @item
0b3f0c54fbc8 nonblocking: provide O_NONBLOCK for mingw
Eric Blake <eblake@redhat.com>
parents: 13917
diff changeset
25 @samp{O_NONBLOCK} is not defined on some platforms. If the
0b3f0c54fbc8 nonblocking: provide O_NONBLOCK for mingw
Eric Blake <eblake@redhat.com>
parents: 13917
diff changeset
26 @samp{nonblocking} module is in use, gnulib guarantees a working
0b3f0c54fbc8 nonblocking: provide O_NONBLOCK for mingw
Eric Blake <eblake@redhat.com>
parents: 13917
diff changeset
27 non-zero value; otherwise, the gnulib replacement is 0.
13664
241057e2e60f fcntl-h: define O_CLOEXEC and O_EXEC if not defined; use new defines
Paul Eggert <eggert@cs.ucla.edu>
parents: 13549
diff changeset
28
241057e2e60f fcntl-h: define O_CLOEXEC and O_EXEC if not defined; use new defines
Paul Eggert <eggert@cs.ucla.edu>
parents: 13549
diff changeset
29 @item
241057e2e60f fcntl-h: define O_CLOEXEC and O_EXEC if not defined; use new defines
Paul Eggert <eggert@cs.ucla.edu>
parents: 13549
diff changeset
30 @samp{O_EXEC} and @samp{O_SEARCH} are not defined on some platforms.
241057e2e60f fcntl-h: define O_CLOEXEC and O_EXEC if not defined; use new defines
Paul Eggert <eggert@cs.ucla.edu>
parents: 13549
diff changeset
31 Gnulib defines these macros to @samp{O_RDONLY}, which is typically 0.
9638
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
32
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
33 @item
15614
e3c67dcee18f tempname: Support for MSVC.
Bruno Haible <bruno@clisp.org>
parents: 15607
diff changeset
34 @samp{O_ACCMODE} is not defined on some platforms:
e3c67dcee18f tempname: Support for MSVC.
Bruno Haible <bruno@clisp.org>
parents: 15607
diff changeset
35 MSVC 9.
e3c67dcee18f tempname: Support for MSVC.
Bruno Haible <bruno@clisp.org>
parents: 15607
diff changeset
36
e3c67dcee18f tempname: Support for MSVC.
Bruno Haible <bruno@clisp.org>
parents: 15607
diff changeset
37 @item
14534
2078181e301c fcntl-h: fix O_ACCMODE on cygwin
Eric Blake <eblake@redhat.com>
parents: 14532
diff changeset
38 The @samp{O_ACCMODE} mask mistakenly omits @samp{O_SEARCH} and
2078181e301c fcntl-h: fix O_ACCMODE on cygwin
Eric Blake <eblake@redhat.com>
parents: 14532
diff changeset
39 @samp{O_EXEC} on some platforms:
2078181e301c fcntl-h: fix O_ACCMODE on cygwin
Eric Blake <eblake@redhat.com>
parents: 14532
diff changeset
40 Cygwin.
2078181e301c fcntl-h: fix O_ACCMODE on cygwin
Eric Blake <eblake@redhat.com>
parents: 14532
diff changeset
41
2078181e301c fcntl-h: fix O_ACCMODE on cygwin
Eric Blake <eblake@redhat.com>
parents: 14532
diff changeset
42 @item
9638
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
43 @samp{O_BINARY}, @samp{O_TEXT} (not specified by POSIX, but essential for
16242
59c686e5b2df Talk about "native Windows API", not "Woe32".
Bruno Haible <bruno@clisp.org>
parents: 15629
diff changeset
44 portability to native Windows platforms) are defined on some platforms but
59c686e5b2df Talk about "native Windows API", not "Woe32".
Bruno Haible <bruno@clisp.org>
parents: 15629
diff changeset
45 not on others.
9638
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
46
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
47 @item
17135
3ae14a5da4df fcntl-h: support GNU flags like O_IGNORE_CTTY
Paul Eggert <eggert@cs.ucla.edu>
parents: 16935
diff changeset
48 @samp{O_DIRECT}, @samp{O_IGNORE_CTTY}, @samp{O_NDELAY},
3ae14a5da4df fcntl-h: support GNU flags like O_IGNORE_CTTY
Paul Eggert <eggert@cs.ucla.edu>
parents: 16935
diff changeset
49 @samp{O_NOATIME}, @samp{O_NOLINK}, @samp{O_NOLINKS}, and
3ae14a5da4df fcntl-h: support GNU flags like O_IGNORE_CTTY
Paul Eggert <eggert@cs.ucla.edu>
parents: 16935
diff changeset
50 @samp{O_NOTRANS} (not specified by POSIX) are defined
9638
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
51 on some platforms but not on others.
11876
cc0527e5d2f4 fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents: 9638
diff changeset
52
cc0527e5d2f4 fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents: 9638
diff changeset
53 @item
12456
f3aceada3c52 fcntl: port portions of fcntl to mingw
Eric Blake <ebb9@byu.net>
parents: 12454
diff changeset
54 @samp{FD_CLOEXEC}, @samp{F_DUPFD}, and @samp{F_GETFD} are not defined
f3aceada3c52 fcntl: port portions of fcntl to mingw
Eric Blake <ebb9@byu.net>
parents: 12454
diff changeset
55 on some platforms:
15607
6355dc4626b5 doc: Update regarding MSVC 9.
Bruno Haible <bruno@clisp.org>
parents: 15594
diff changeset
56 mingw, MSVC 9.
11942
d1047ae4b8d5 openat: declare in POSIX headers
Eric Blake <ebb9@byu.net>
parents: 11877
diff changeset
57
d1047ae4b8d5 openat: declare in POSIX headers
Eric Blake <ebb9@byu.net>
parents: 11877
diff changeset
58 @item
12454
f7624052e60d fcntl: support F_DUPFD_CLOEXEC on systems with fcntl
Eric Blake <ebb9@byu.net>
parents: 11968
diff changeset
59 @samp{F_DUPFD_CLOEXEC} is not defined on some platforms:
16935
498a2211d839 Write "Mac OS X" instead of "MacOS X".
Bruno Haible <bruno@clisp.org>
parents: 16254
diff changeset
60 Mac OS X 10.5, FreeBSD 6.0, NetBSD 5.0, OpenBSD 3.8, AIX 5.1, HP-UX 11,
15607
6355dc4626b5 doc: Update regarding MSVC 9.
Bruno Haible <bruno@clisp.org>
parents: 15594
diff changeset
61 IRIX 6.5, OSF/1 5.1, Solaris 11 2010-11, Cygwin 1.7.1, mingw, MSVC 9, Interix 3.5,
12454
f7624052e60d fcntl: support F_DUPFD_CLOEXEC on systems with fcntl
Eric Blake <ebb9@byu.net>
parents: 11968
diff changeset
62 BeOS.
f7624052e60d fcntl: support F_DUPFD_CLOEXEC on systems with fcntl
Eric Blake <ebb9@byu.net>
parents: 11968
diff changeset
63
f7624052e60d fcntl: support F_DUPFD_CLOEXEC on systems with fcntl
Eric Blake <ebb9@byu.net>
parents: 11968
diff changeset
64 @item
11945
2cf208dc022b faccessat: new module
Eric Blake <ebb9@byu.net>
parents: 11942
diff changeset
65 @samp{AT_FDCWD}, @samp{AT_EACCESS}, @samp{AT_SYMLINK_NOFOLLOW},
2cf208dc022b faccessat: new module
Eric Blake <ebb9@byu.net>
parents: 11942
diff changeset
66 @samp{AT_SYMLINK_FOLLOW}, and @samp{AT_REMOVEDIR}
11963
a23404c39980 Mention affected platforms.
Bruno Haible <bruno@clisp.org>
parents: 11945
diff changeset
67 are not defined on many platforms:
16935
498a2211d839 Write "Mac OS X" instead of "MacOS X".
Bruno Haible <bruno@clisp.org>
parents: 16254
diff changeset
68 glibc 2.3.6, Mac OS X 10.5, FreeBSD 6.0, NetBSD 5.0, OpenBSD 3.8, AIX
15607
6355dc4626b5 doc: Update regarding MSVC 9.
Bruno Haible <bruno@clisp.org>
parents: 15594
diff changeset
69 5.1, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 8, Cygwin 1.5.x, mingw, MSVC 9, Interix 3.5, BeOS.
11963
a23404c39980 Mention affected platforms.
Bruno Haible <bruno@clisp.org>
parents: 11945
diff changeset
70
a23404c39980 Mention affected platforms.
Bruno Haible <bruno@clisp.org>
parents: 11945
diff changeset
71 @item
a23404c39980 Mention affected platforms.
Bruno Haible <bruno@clisp.org>
parents: 11945
diff changeset
72 @samp{AT_FDCWD} is defined with a value too large for an @code{int} on some
a23404c39980 Mention affected platforms.
Bruno Haible <bruno@clisp.org>
parents: 11945
diff changeset
73 platforms:
16254
da62858ef2f6 doc: Update for Solaris 11 2011-11.
Bruno Haible <bruno@clisp.org>
parents: 16242
diff changeset
74 Solaris 11 2011-11.
9638
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
75 @end itemize
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
76
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
77 Portability problems not fixed by Gnulib:
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
78 @itemize
11876
cc0527e5d2f4 fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents: 9638
diff changeset
79 @item
12454
f7624052e60d fcntl: support F_DUPFD_CLOEXEC on systems with fcntl
Eric Blake <ebb9@byu.net>
parents: 11968
diff changeset
80 @samp{F_SETFD}, @samp{F_GETFL}, @samp{F_SETFL}, @samp{F_GETLK},
17135
3ae14a5da4df fcntl-h: support GNU flags like O_IGNORE_CTTY
Paul Eggert <eggert@cs.ucla.edu>
parents: 16935
diff changeset
81 @samp{F_SETLK}, @samp{F_SETLKW}, @samp{F_GETOWN}, and @samp{F_SETOWN}
12454
f7624052e60d fcntl: support F_DUPFD_CLOEXEC on systems with fcntl
Eric Blake <ebb9@byu.net>
parents: 11968
diff changeset
82 are not defined on some platforms:
15607
6355dc4626b5 doc: Update regarding MSVC 9.
Bruno Haible <bruno@clisp.org>
parents: 15594
diff changeset
83 mingw, MSVC 9.
11876
cc0527e5d2f4 fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents: 9638
diff changeset
84
cc0527e5d2f4 fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents: 9638
diff changeset
85 @item
cc0527e5d2f4 fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents: 9638
diff changeset
86 @samp{POSIX_FADV_DONTNEED}, @samp{POSIX_FADV_NOREUSE},
cc0527e5d2f4 fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents: 9638
diff changeset
87 @samp{POSIX_FADV_NORMAL}, @samp{POSIX_FADV_RANDOM},
cc0527e5d2f4 fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents: 9638
diff changeset
88 @samp{POSIX_FADV_SEQUENTIAL}, and @samp{POSIX_FADV_WILLNEED} are not
cc0527e5d2f4 fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents: 9638
diff changeset
89 defined on some platforms.
9638
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
90 @end itemize