Mercurial > hg > octave-kai > gnulib-hg
annotate doc/posix-headers/fcntl.texi @ 13664:241057e2e60f
fcntl-h: define O_CLOEXEC and O_EXEC if not defined; use new defines
* doc/posix-headers/fcntl.texi (fcntl.h): Document that
O_CLOEXEC is now defined to 0 if it is not defined, like other flags.
Also, O_EXEC is now defined to be O_RDONLY if O_EXEC is not defined.
Similarly for O_SEARCH; this last was already true, but not documented.
* lib/fcntl.in.h (O_CLOEXEC): Define to 0 if not defined.
* lib/dup-safer-flag.c (O_CLOEXEC): Remove now-useless #define.
* lib/dup3.c, lib/pipe2.c, tests/test-dup-safer.c, tests/test-fcntl.c:
Likewise.
* lib/popen-safer.c (open_noinherit): Check whether O_CLOEXEC
is zero, not whether it is defined.
* tests/test-dup3.c, tests/test-pipe2.c (main): Likewise.
* lib/progreloc.c (find_executable): Use O_EXEC rather than O_RDONLY.
* lib/open.c (open): Check for O_SEARCH as well as for O_RDONLY.
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Fri, 10 Sep 2010 11:55:27 -0700 |
parents | bb0ceefd22dc |
children | 3d497ee2707b |
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 |
13549
bb0ceefd22dc
avoid some overlong lines from posix urls, etc.
Karl Berry <karl@freefriends.org>
parents:
12456
diff
changeset
|
4 POSIX specification:@* @url{http://www.opengroup.org/susv3xbd/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 |
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
|
11 @samp{O_CLOEXEC}, @samp{O_DIRECTORY}, @samp{O_DSYNC}, @samp{O_NOCTTY}, |
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
|
12 @samp{O_NOFOLLOW}, @samp{O_NONBLOCK}, @samp{O_RSYNC}, @samp{O_SYNC}, |
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
|
13 and @samp{O_TTY_INIT} are not defined on some platforms. Gnulib defines |
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
|
14 these macros to 0. |
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
|
15 |
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
|
16 @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
|
17 @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
|
18 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
|
19 |
070329237839
Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
20 @item |
070329237839
Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
21 @samp{O_BINARY}, @samp{O_TEXT} (not specified by POSIX, but essential for |
070329237839
Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
22 portability to Woe32 platforms) are defined on some platforms but not on |
070329237839
Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
23 others. |
070329237839
Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
24 |
070329237839
Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
25 @item |
11876
cc0527e5d2f4
fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
9638
diff
changeset
|
26 @samp{O_DIRECT}, @samp{O_NDELAY}, @samp{O_NOATIME}, |
cc0527e5d2f4
fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
9638
diff
changeset
|
27 and @samp{O_NOLINKS} (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
|
28 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
|
29 |
cc0527e5d2f4
fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
9638
diff
changeset
|
30 @item |
12456
f3aceada3c52
fcntl: port portions of fcntl to mingw
Eric Blake <ebb9@byu.net>
parents:
12454
diff
changeset
|
31 @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
|
32 on some platforms: |
11963
a23404c39980
Mention affected platforms.
Bruno Haible <bruno@clisp.org>
parents:
11945
diff
changeset
|
33 mingw. |
11942
d1047ae4b8d5
openat: declare in POSIX headers
Eric Blake <ebb9@byu.net>
parents:
11877
diff
changeset
|
34 |
d1047ae4b8d5
openat: declare in POSIX headers
Eric Blake <ebb9@byu.net>
parents:
11877
diff
changeset
|
35 @item |
12454
f7624052e60d
fcntl: support F_DUPFD_CLOEXEC on systems with fcntl
Eric Blake <ebb9@byu.net>
parents:
11968
diff
changeset
|
36 @samp{F_DUPFD_CLOEXEC} is not defined on some platforms: |
f7624052e60d
fcntl: support F_DUPFD_CLOEXEC on systems with fcntl
Eric Blake <ebb9@byu.net>
parents:
11968
diff
changeset
|
37 MacOS X 10.3, FreeBSD 6.0, NetBSD 3.0, OpenBSD 3.8, AIX 5.1, HP-UX 11, |
f7624052e60d
fcntl: support F_DUPFD_CLOEXEC on systems with fcntl
Eric Blake <ebb9@byu.net>
parents:
11968
diff
changeset
|
38 IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.7.1, mingw, Interix 3.5, |
f7624052e60d
fcntl: support F_DUPFD_CLOEXEC on systems with fcntl
Eric Blake <ebb9@byu.net>
parents:
11968
diff
changeset
|
39 BeOS. |
f7624052e60d
fcntl: support F_DUPFD_CLOEXEC on systems with fcntl
Eric Blake <ebb9@byu.net>
parents:
11968
diff
changeset
|
40 |
f7624052e60d
fcntl: support F_DUPFD_CLOEXEC on systems with fcntl
Eric Blake <ebb9@byu.net>
parents:
11968
diff
changeset
|
41 @item |
11945 | 42 @samp{AT_FDCWD}, @samp{AT_EACCESS}, @samp{AT_SYMLINK_NOFOLLOW}, |
43 @samp{AT_SYMLINK_FOLLOW}, and @samp{AT_REMOVEDIR} | |
11963
a23404c39980
Mention affected platforms.
Bruno Haible <bruno@clisp.org>
parents:
11945
diff
changeset
|
44 are not defined on many platforms: |
11968
98e4db1661cc
doc: fix comments in recent patches
Eric Blake <ebb9@byu.net>
parents:
11963
diff
changeset
|
45 glibc 2.3.6, MacOS X 10.3, FreeBSD 6.0, NetBSD 3.0, OpenBSD 3.8, AIX |
98e4db1661cc
doc: fix comments in recent patches
Eric Blake <ebb9@byu.net>
parents:
11963
diff
changeset
|
46 5.1, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 8, Cygwin 1.5.x, mingw, Interix 3.5, BeOS. |
11963
a23404c39980
Mention affected platforms.
Bruno Haible <bruno@clisp.org>
parents:
11945
diff
changeset
|
47 |
a23404c39980
Mention affected platforms.
Bruno Haible <bruno@clisp.org>
parents:
11945
diff
changeset
|
48 @item |
a23404c39980
Mention affected platforms.
Bruno Haible <bruno@clisp.org>
parents:
11945
diff
changeset
|
49 @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
|
50 platforms: |
a23404c39980
Mention affected platforms.
Bruno Haible <bruno@clisp.org>
parents:
11945
diff
changeset
|
51 Solaris 10. |
9638
070329237839
Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
52 @end itemize |
070329237839
Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
53 |
070329237839
Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
54 Portability problems not fixed by Gnulib: |
070329237839
Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
55 @itemize |
11876
cc0527e5d2f4
fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
9638
diff
changeset
|
56 @item |
12454
f7624052e60d
fcntl: support F_DUPFD_CLOEXEC on systems with fcntl
Eric Blake <ebb9@byu.net>
parents:
11968
diff
changeset
|
57 @samp{F_SETFD}, @samp{F_GETFL}, @samp{F_SETFL}, @samp{F_GETLK}, |
f7624052e60d
fcntl: support F_DUPFD_CLOEXEC on systems with fcntl
Eric Blake <ebb9@byu.net>
parents:
11968
diff
changeset
|
58 @samp{F_SETLK}, @samp{F_SETLOKW}, @samp{F_GETOWN}, and @samp{F_SETOWN} |
f7624052e60d
fcntl: support F_DUPFD_CLOEXEC on systems with fcntl
Eric Blake <ebb9@byu.net>
parents:
11968
diff
changeset
|
59 are not defined on some platforms: |
f7624052e60d
fcntl: support F_DUPFD_CLOEXEC on systems with fcntl
Eric Blake <ebb9@byu.net>
parents:
11968
diff
changeset
|
60 mingw. |
11876
cc0527e5d2f4
fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
9638
diff
changeset
|
61 |
cc0527e5d2f4
fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
9638
diff
changeset
|
62 @item |
cc0527e5d2f4
fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
9638
diff
changeset
|
63 @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
|
64 @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
|
65 @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
|
66 defined on some platforms. |
9638
070329237839
Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
67 @end itemize |