Mercurial > hg > octave-nkf > gnulib-hg
annotate modules/unistd @ 11942:d1047ae4b8d5
openat: declare in POSIX headers
* NEWS: Mention this.
* modules/openat (configure.ac): Declare witnesses.
(Depends-on): Add fcntl-h, sys_stat, unistd.
(Include): Mention correct headers.
* modules/fcntl-h (Depends-on): Add link-warning.
(Files): Add openat.m4.
(Makefile.am): Substitute witnesses.
* modules/sys_stat (Files, Makefile.am): Likewise.
* modules/unistd (Files, Makefile.am): Likewise.
* m4/openat.m4 (gl_FUNC_OPENAT, gl_FUNC_FCHOWNAT): Set witnesses.
(gl_OPENAT_DEFAULTS): New macro.
* m4/fcntl_h.m4 (gl_FCNTL_H_DEFAULTS): Use it.
* m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Likewise.
* m4/sys_stat_h.m4 (gl_SYS_STAT_H_DEFAULTS): Likewise.
(SYS_STAT_H): Remove unused variable.
* doc/posix-headers/fcntl.texi (fcntl.h): Update content.
* lib/fcntl--.h (includes): Remove unneeded header.
* lib/openat-safer.c (includes): Likewise.
* lib/openat.h (AT_FDCWD, AT_SYMLINK_NOFOLLOW, AT_REMOVEDIR)
(openat, fstatat, unlinkat, mkdirat, fchmodat, fchownat): Move to
appropriate headers.
(__OPENAT_PREFIX): Delete.
* lib/fcntl.in.h (openat): Provide declaration.
(AT_FDCWD): Fix Solaris bug.
(AT_SYMLINK_NOFOLLOW, AT_REMOVEDIR): Provide macros.
* lib/sys_stat.in.h (fstatat, mkdirat): Provide declaration.
* lib/fchmodat.c (includes): Adjust to find declaration.
* lib/fchownat.c (includes): Likewise.
* lib/mkdirat.c (includes): Likewise.
* lib/fstatat.c (includes): Likewise. Ensure original fstatat is
still visible.
Signed-off-by: Eric Blake <ebb9@byu.net>
author | Eric Blake <ebb9@byu.net> |
---|---|
date | Wed, 02 Sep 2009 17:14:26 -0600 |
parents | 3ac76948db10 |
children | 2cf208dc022b |
rev | line source |
---|---|
6685
143f906c9a6a
Fix use of unistd.h in getopt through a new unistd module.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
1 Description: |
8199
51d32a83a7df
Move more declarations into <unistd.h>.
Bruno Haible <bruno@clisp.org>
parents:
7865
diff
changeset
|
2 A GNU-like <unistd.h>. |
6685
143f906c9a6a
Fix use of unistd.h in getopt through a new unistd module.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
3 |
143f906c9a6a
Fix use of unistd.h in getopt through a new unistd module.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
4 Files: |
143f906c9a6a
Fix use of unistd.h in getopt through a new unistd module.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
5 m4/unistd_h.m4 |
9271
56962d28d442
Rename unistd_.h to unistd.in.h.
Bruno Haible <bruno@clisp.org>
parents:
9102
diff
changeset
|
6 lib/unistd.in.h |
11942
d1047ae4b8d5
openat: declare in POSIX headers
Eric Blake <ebb9@byu.net>
parents:
11886
diff
changeset
|
7 m4/openat.m4 |
6685
143f906c9a6a
Fix use of unistd.h in getopt through a new unistd module.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
8 |
143f906c9a6a
Fix use of unistd.h in getopt through a new unistd module.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
9 Depends-on: |
8995
1025663f7658
* m4/include_next.m4 (gl_INCLUDE_NEXT): Define and AC_SUBST
Paul Eggert <eggert@cs.ucla.edu>
parents:
8982
diff
changeset
|
10 include_next |
8199
51d32a83a7df
Move more declarations into <unistd.h>.
Bruno Haible <bruno@clisp.org>
parents:
7865
diff
changeset
|
11 link-warning |
11832
ff3dd373542b
stddef: fix NetBSD 5.0 NULL bug, rather than working around it
Eric Blake <ebb9@byu.net>
parents:
11810
diff
changeset
|
12 stddef |
6685
143f906c9a6a
Fix use of unistd.h in getopt through a new unistd module.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
13 |
143f906c9a6a
Fix use of unistd.h in getopt through a new unistd module.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
14 configure.ac: |
8199
51d32a83a7df
Move more declarations into <unistd.h>.
Bruno Haible <bruno@clisp.org>
parents:
7865
diff
changeset
|
15 gl_UNISTD_H |
6685
143f906c9a6a
Fix use of unistd.h in getopt through a new unistd module.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
16 |
143f906c9a6a
Fix use of unistd.h in getopt through a new unistd module.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
17 Makefile.am: |
8199
51d32a83a7df
Move more declarations into <unistd.h>.
Bruno Haible <bruno@clisp.org>
parents:
7865
diff
changeset
|
18 BUILT_SOURCES += unistd.h |
6685
143f906c9a6a
Fix use of unistd.h in getopt through a new unistd module.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
19 |
6689
93d578c7aa44
* lib/c-stack.c: Include unistd.h unconditionally, since we now assume
Paul Eggert <eggert@cs.ucla.edu>
parents:
6687
diff
changeset
|
20 # We need the following in order to create an empty placeholder for |
93d578c7aa44
* lib/c-stack.c: Include unistd.h unconditionally, since we now assume
Paul Eggert <eggert@cs.ucla.edu>
parents:
6687
diff
changeset
|
21 # <unistd.h> when the system doesn't have one. |
9271
56962d28d442
Rename unistd_.h to unistd.in.h.
Bruno Haible <bruno@clisp.org>
parents:
9102
diff
changeset
|
22 unistd.h: unistd.in.h |
11868
67c2b22aff08
annotate automake snippets with $(AM_V_GEN) and $(AM_V_at)
Jim Meyering <meyering@redhat.com>
parents:
11832
diff
changeset
|
23 $(AM_V_GEN)rm -f $@-t $@ && \ |
7421
8bace4b08db5
Mark generated files as "DO NOT EDIT".
Bruno Haible <bruno@clisp.org>
parents:
6689
diff
changeset
|
24 { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ |
8199
51d32a83a7df
Move more declarations into <unistd.h>.
Bruno Haible <bruno@clisp.org>
parents:
7865
diff
changeset
|
25 sed -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \ |
10375
f96e845fc36d
Avoid some "gcc -pedantic" warnings.
Bruno Haible <bruno@clisp.org>
parents:
9721
diff
changeset
|
26 -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ |
f96e845fc36d
Avoid some "gcc -pedantic" warnings.
Bruno Haible <bruno@clisp.org>
parents:
9721
diff
changeset
|
27 -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ |
8995
1025663f7658
* m4/include_next.m4 (gl_INCLUDE_NEXT): Define and AC_SUBST
Paul Eggert <eggert@cs.ucla.edu>
parents:
8982
diff
changeset
|
28 -e 's|@''NEXT_UNISTD_H''@|$(NEXT_UNISTD_H)|g' \ |
8199
51d32a83a7df
Move more declarations into <unistd.h>.
Bruno Haible <bruno@clisp.org>
parents:
7865
diff
changeset
|
29 -e 's|@''GNULIB_CHOWN''@|$(GNULIB_CHOWN)|g' \ |
10609 | 30 -e 's|@''GNULIB_CLOSE''@|$(GNULIB_CLOSE)|g' \ |
8199
51d32a83a7df
Move more declarations into <unistd.h>.
Bruno Haible <bruno@clisp.org>
parents:
7865
diff
changeset
|
31 -e 's|@''GNULIB_DUP2''@|$(GNULIB_DUP2)|g' \ |
11886 | 32 -e 's|@''GNULIB_DUP3''@|$(GNULIB_DUP3)|g' \ |
9721 | 33 -e 's|@''GNULIB_ENVIRON''@|$(GNULIB_ENVIRON)|g' \ |
10662
ad36db29dad7
Move the euidaccess() declaration to <unistd.h>.
Bruno Haible <bruno@clisp.org>
parents:
10661
diff
changeset
|
34 -e 's|@''GNULIB_EUIDACCESS''@|$(GNULIB_EUIDACCESS)|g' \ |
8199
51d32a83a7df
Move more declarations into <unistd.h>.
Bruno Haible <bruno@clisp.org>
parents:
7865
diff
changeset
|
35 -e 's|@''GNULIB_FCHDIR''@|$(GNULIB_FCHDIR)|g' \ |
10565 | 36 -e 's|@''GNULIB_FSYNC''@|$(GNULIB_FSYNC)|g' \ |
8199
51d32a83a7df
Move more declarations into <unistd.h>.
Bruno Haible <bruno@clisp.org>
parents:
7865
diff
changeset
|
37 -e 's|@''GNULIB_FTRUNCATE''@|$(GNULIB_FTRUNCATE)|g' \ |
51d32a83a7df
Move more declarations into <unistd.h>.
Bruno Haible <bruno@clisp.org>
parents:
7865
diff
changeset
|
38 -e 's|@''GNULIB_GETCWD''@|$(GNULIB_GETCWD)|g' \ |
10661
65c9436dc0d3
Move the getdomainname() declaration to <unistd.h>.
Bruno Haible <bruno@clisp.org>
parents:
10610
diff
changeset
|
39 -e 's|@''GNULIB_GETDOMAINNAME''@|$(GNULIB_GETDOMAINNAME)|g' \ |
10582
738187526552
New module 'getdtablesize'.
Bruno Haible <bruno@clisp.org>
parents:
10565
diff
changeset
|
40 -e 's|@''GNULIB_GETDTABLESIZE''@|$(GNULIB_GETDTABLESIZE)|g' \ |
10692
b867b19bccb3
Add gethostname() declaration to <unistd.h>.
Bruno Haible <bruno@clisp.org>
parents:
10666
diff
changeset
|
41 -e 's|@''GNULIB_GETHOSTNAME''@|$(GNULIB_GETHOSTNAME)|g' \ |
8199
51d32a83a7df
Move more declarations into <unistd.h>.
Bruno Haible <bruno@clisp.org>
parents:
7865
diff
changeset
|
42 -e 's|@''GNULIB_GETLOGIN_R''@|$(GNULIB_GETLOGIN_R)|g' \ |
9498
a2c450a3023c
Move declaration of getpagesize() from getpagesize.h to unistd.h.
Bruno Haible <bruno@clisp.org>
parents:
9276
diff
changeset
|
43 -e 's|@''GNULIB_GETPAGESIZE''@|$(GNULIB_GETPAGESIZE)|g' \ |
10666
d162e4057aa8
Add getusershell(), setusershell(), endusershell() declarations to <unistd.h>.
Bruno Haible <bruno@clisp.org>
parents:
10662
diff
changeset
|
44 -e 's|@''GNULIB_GETUSERSHELL''@|$(GNULIB_GETUSERSHELL)|g' \ |
8982
04a20e8bea33
Revamp lchown so that it lives in unistd.h where it belongs.
Paul Eggert <eggert@cs.ucla.edu>
parents:
8872
diff
changeset
|
45 -e 's|@''GNULIB_LCHOWN''@|$(GNULIB_LCHOWN)|g' \ |
11041 | 46 -e 's|@''GNULIB_LINK''@|$(GNULIB_LINK)|g' \ |
8872 | 47 -e 's|@''GNULIB_LSEEK''@|$(GNULIB_LSEEK)|g' \ |
11942
d1047ae4b8d5
openat: declare in POSIX headers
Eric Blake <ebb9@byu.net>
parents:
11886
diff
changeset
|
48 -e 's|@''GNULIB_OPENAT''@|$(GNULIB_OPENAT)|g' \ |
11870 | 49 -e 's|@''GNULIB_PIPE2''@|$(GNULIB_PIPE2)|g' \ |
8199
51d32a83a7df
Move more declarations into <unistd.h>.
Bruno Haible <bruno@clisp.org>
parents:
7865
diff
changeset
|
50 -e 's|@''GNULIB_READLINK''@|$(GNULIB_READLINK)|g' \ |
8786 | 51 -e 's|@''GNULIB_SLEEP''@|$(GNULIB_SLEEP)|g' \ |
11810
d2c9dd185002
Ensure that getopt() gets declared by <unistd.h>.
Bruno Haible <bruno@clisp.org>
parents:
11801
diff
changeset
|
52 -e 's|@''GNULIB_UNISTD_H_GETOPT''@|$(GNULIB_UNISTD_H_GETOPT)|g' \ |
10484 | 53 -e 's|@''GNULIB_UNISTD_H_SIGPIPE''@|$(GNULIB_UNISTD_H_SIGPIPE)|g' \ |
54 -e 's|@''GNULIB_WRITE''@|$(GNULIB_WRITE)|g' \ | |
8199
51d32a83a7df
Move more declarations into <unistd.h>.
Bruno Haible <bruno@clisp.org>
parents:
7865
diff
changeset
|
55 -e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \ |
11886 | 56 -e 's|@''HAVE_DUP3''@|$(HAVE_DUP3)|g' \ |
10662
ad36db29dad7
Move the euidaccess() declaration to <unistd.h>.
Bruno Haible <bruno@clisp.org>
parents:
10661
diff
changeset
|
57 -e 's|@''HAVE_EUIDACCESS''@|$(HAVE_EUIDACCESS)|g' \ |
11942
d1047ae4b8d5
openat: declare in POSIX headers
Eric Blake <ebb9@byu.net>
parents:
11886
diff
changeset
|
58 -e 's|@''HAVE_FCHOWNAT''@|$(HAVE_FCHOWNAT)|g' \ |
10565 | 59 -e 's|@''HAVE_FSYNC''@|$(HAVE_FSYNC)|g' \ |
8199
51d32a83a7df
Move more declarations into <unistd.h>.
Bruno Haible <bruno@clisp.org>
parents:
7865
diff
changeset
|
60 -e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \ |
10661
65c9436dc0d3
Move the getdomainname() declaration to <unistd.h>.
Bruno Haible <bruno@clisp.org>
parents:
10610
diff
changeset
|
61 -e 's|@''HAVE_GETDOMAINNAME''@|$(HAVE_GETDOMAINNAME)|g' \ |
10582
738187526552
New module 'getdtablesize'.
Bruno Haible <bruno@clisp.org>
parents:
10565
diff
changeset
|
62 -e 's|@''HAVE_GETDTABLESIZE''@|$(HAVE_GETDTABLESIZE)|g' \ |
10692
b867b19bccb3
Add gethostname() declaration to <unistd.h>.
Bruno Haible <bruno@clisp.org>
parents:
10666
diff
changeset
|
63 -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \ |
9498
a2c450a3023c
Move declaration of getpagesize() from getpagesize.h to unistd.h.
Bruno Haible <bruno@clisp.org>
parents:
9276
diff
changeset
|
64 -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \ |
10666
d162e4057aa8
Add getusershell(), setusershell(), endusershell() declarations to <unistd.h>.
Bruno Haible <bruno@clisp.org>
parents:
10662
diff
changeset
|
65 -e 's|@''HAVE_GETUSERSHELL''@|$(HAVE_GETUSERSHELL)|g' \ |
11041 | 66 -e 's|@''HAVE_LINK''@|$(HAVE_LINK)|g' \ |
11870 | 67 -e 's|@''HAVE_PIPE2''@|$(HAVE_PIPE2)|g' \ |
8199
51d32a83a7df
Move more declarations into <unistd.h>.
Bruno Haible <bruno@clisp.org>
parents:
7865
diff
changeset
|
68 -e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \ |
8786 | 69 -e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \ |
11942
d1047ae4b8d5
openat: declare in POSIX headers
Eric Blake <ebb9@byu.net>
parents:
11886
diff
changeset
|
70 -e 's|@''HAVE_UNLINKAT''@|$(HAVE_UNLINKAT)|g' \ |
9721 | 71 -e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \ |
8199
51d32a83a7df
Move more declarations into <unistd.h>.
Bruno Haible <bruno@clisp.org>
parents:
7865
diff
changeset
|
72 -e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \ |
9498
a2c450a3023c
Move declaration of getpagesize() from getpagesize.h to unistd.h.
Bruno Haible <bruno@clisp.org>
parents:
9276
diff
changeset
|
73 -e 's|@''HAVE_OS_H''@|$(HAVE_OS_H)|g' \ |
a2c450a3023c
Move declaration of getpagesize() from getpagesize.h to unistd.h.
Bruno Haible <bruno@clisp.org>
parents:
9276
diff
changeset
|
74 -e 's|@''HAVE_SYS_PARAM_H''@|$(HAVE_SYS_PARAM_H)|g' \ |
8199
51d32a83a7df
Move more declarations into <unistd.h>.
Bruno Haible <bruno@clisp.org>
parents:
7865
diff
changeset
|
75 -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \ |
10609 | 76 -e 's|@''REPLACE_CLOSE''@|$(REPLACE_CLOSE)|g' \ |
11726
c694fa3f9d7d
dup2: work around mingw and cygwin 1.5 bug
Eric Blake <ebb9@byu.net>
parents:
11041
diff
changeset
|
77 -e 's|@''REPLACE_DUP2''@|$(REPLACE_DUP2)|g' \ |
8199
51d32a83a7df
Move more declarations into <unistd.h>.
Bruno Haible <bruno@clisp.org>
parents:
7865
diff
changeset
|
78 -e 's|@''REPLACE_FCHDIR''@|$(REPLACE_FCHDIR)|g' \ |
11942
d1047ae4b8d5
openat: declare in POSIX headers
Eric Blake <ebb9@byu.net>
parents:
11886
diff
changeset
|
79 -e 's|@''REPLACE_FCHOWNAT''@|$(REPLACE_FCHOWNAT)|g' \ |
8199
51d32a83a7df
Move more declarations into <unistd.h>.
Bruno Haible <bruno@clisp.org>
parents:
7865
diff
changeset
|
80 -e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \ |
9552
6632990b0812
Override getpagesize on mingw.
Martin Lambers <marlam@marlam.de>
parents:
9498
diff
changeset
|
81 -e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \ |
8982
04a20e8bea33
Revamp lchown so that it lives in unistd.h where it belongs.
Paul Eggert <eggert@cs.ucla.edu>
parents:
8872
diff
changeset
|
82 -e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \ |
8872 | 83 -e 's|@''REPLACE_LSEEK''@|$(REPLACE_LSEEK)|g' \ |
10484 | 84 -e 's|@''REPLACE_WRITE''@|$(REPLACE_WRITE)|g' \ |
10610
9202c6340cce
Combine the two replacements of 'close'.
Paolo Bonzini <bonzini@gnu.org>
parents:
10609
diff
changeset
|
85 -e 's|@''UNISTD_H_HAVE_WINSOCK2_H''@|$(UNISTD_H_HAVE_WINSOCK2_H)|g' \ |
11801
a29d6bab4448
Make it possible to use module 'gethostname' without module 'close' or 'ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
11726
diff
changeset
|
86 -e 's|@''UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS''@|$(UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS)|g' \ |
10498
8bc209f25988
Provide the definition of GL_LINK-WARNING.
Bruno Haible <bruno@clisp.org>
parents:
10484
diff
changeset
|
87 -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ |
9276
811a59a761ec
Perform one more "_.h" -> ".in.h" substitution.
Jim Meyering <jim@meyering.net>
parents:
9271
diff
changeset
|
88 < $(srcdir)/unistd.in.h; \ |
11868
67c2b22aff08
annotate automake snippets with $(AM_V_GEN) and $(AM_V_at)
Jim Meyering <meyering@redhat.com>
parents:
11832
diff
changeset
|
89 } > $@-t && \ |
7863 | 90 mv $@-t $@ |
91 MOSTLYCLEANFILES += unistd.h unistd.h-t | |
6685
143f906c9a6a
Fix use of unistd.h in getopt through a new unistd module.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
92 |
143f906c9a6a
Fix use of unistd.h in getopt through a new unistd module.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
93 Include: |
143f906c9a6a
Fix use of unistd.h in getopt through a new unistd module.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
94 #include <unistd.h> |
143f906c9a6a
Fix use of unistd.h in getopt through a new unistd module.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
95 |
143f906c9a6a
Fix use of unistd.h in getopt through a new unistd module.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
96 License: |
9102
404dc8725caf
Use the synonymous term LGPLv2.
Bruno Haible <bruno@clisp.org>
parents:
8995
diff
changeset
|
97 LGPLv2+ |
6685
143f906c9a6a
Fix use of unistd.h in getopt through a new unistd module.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
98 |
143f906c9a6a
Fix use of unistd.h in getopt through a new unistd module.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
99 Maintainer: |
8995
1025663f7658
* m4/include_next.m4 (gl_INCLUDE_NEXT): Define and AC_SUBST
Paul Eggert <eggert@cs.ucla.edu>
parents:
8982
diff
changeset
|
100 all |