Mercurial > hg > octave-nkf > gnulib-hg
annotate modules/unistd @ 11993:767d867147de
rmdir: work around cygwin 1.5.x and mingw bugs
* m4/rmdir.m4 (gl_FUNC_RMDIR): Detect the bugs.
* lib/rmdir.c (rmdir): Work around it.
* modules/rmdir (Status, Notice): No longer obsolete.
(Files): Add dos.m4.
(Depends-on): Add unistd.
(configure.ac): Set witnesses.
(License): Relax to LGPLv2+.
* m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Set defaults.
* modules/unistd (Makefile.am): Substitute witnesses.
* lib/unistd.in.h (rmdir): Declare replacement.
* doc/posix-functions/rmdir.texi (rmdir): Document this.
* modules/rmdir-tests: New tests.
* tests/test-rmdir.c: Likewise.
Signed-off-by: Eric Blake <ebb9@byu.net>
author | Eric Blake <ebb9@byu.net> |
---|---|
date | Wed, 16 Sep 2009 10:08:55 -0600 |
parents | a1e0b2efc812 |
children | 18ea6ab4e81d |
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 |
6685
143f906c9a6a
Fix use of unistd.h in getopt through a new unistd module.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
7 |
143f906c9a6a
Fix use of unistd.h in getopt through a new unistd module.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
8 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
|
9 include_next |
8199
51d32a83a7df
Move more declarations into <unistd.h>.
Bruno Haible <bruno@clisp.org>
parents:
7865
diff
changeset
|
10 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
|
11 stddef |
6685
143f906c9a6a
Fix use of unistd.h in getopt through a new unistd module.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
12 |
143f906c9a6a
Fix use of unistd.h in getopt through a new unistd module.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
13 configure.ac: |
8199
51d32a83a7df
Move more declarations into <unistd.h>.
Bruno Haible <bruno@clisp.org>
parents:
7865
diff
changeset
|
14 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
|
15 |
143f906c9a6a
Fix use of unistd.h in getopt through a new unistd module.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
16 Makefile.am: |
8199
51d32a83a7df
Move more declarations into <unistd.h>.
Bruno Haible <bruno@clisp.org>
parents:
7865
diff
changeset
|
17 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
|
18 |
6689
93d578c7aa44
* lib/c-stack.c: Include unistd.h unconditionally, since we now assume
Paul Eggert <eggert@cs.ucla.edu>
parents:
6687
diff
changeset
|
19 # 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
|
20 # <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
|
21 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
|
22 $(AM_V_GEN)rm -f $@-t $@ && \ |
7421
8bace4b08db5
Mark generated files as "DO NOT EDIT".
Bruno Haible <bruno@clisp.org>
parents:
6689
diff
changeset
|
23 { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ |
8199
51d32a83a7df
Move more declarations into <unistd.h>.
Bruno Haible <bruno@clisp.org>
parents:
7865
diff
changeset
|
24 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
|
25 -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ |
f96e845fc36d
Avoid some "gcc -pedantic" warnings.
Bruno Haible <bruno@clisp.org>
parents:
9721
diff
changeset
|
26 -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
|
27 -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
|
28 -e 's|@''GNULIB_CHOWN''@|$(GNULIB_CHOWN)|g' \ |
10609 | 29 -e 's|@''GNULIB_CLOSE''@|$(GNULIB_CLOSE)|g' \ |
8199
51d32a83a7df
Move more declarations into <unistd.h>.
Bruno Haible <bruno@clisp.org>
parents:
7865
diff
changeset
|
30 -e 's|@''GNULIB_DUP2''@|$(GNULIB_DUP2)|g' \ |
11886 | 31 -e 's|@''GNULIB_DUP3''@|$(GNULIB_DUP3)|g' \ |
9721 | 32 -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
|
33 -e 's|@''GNULIB_EUIDACCESS''@|$(GNULIB_EUIDACCESS)|g' \ |
11945 | 34 -e 's|@''GNULIB_FACCESSAT''@|$(GNULIB_FACCESSAT)|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' \ |
11966
715fd167345f
Remove dependency from unistd_h.m4, sys_stat_h.m4, fcntl_h.m4 to openat.m4.
Bruno Haible <bruno@clisp.org>
parents:
11956
diff
changeset
|
36 -e 's|@''GNULIB_FCHOWNAT''@|$(GNULIB_FCHOWNAT)|g' \ |
10565 | 37 -e 's|@''GNULIB_FSYNC''@|$(GNULIB_FSYNC)|g' \ |
8199
51d32a83a7df
Move more declarations into <unistd.h>.
Bruno Haible <bruno@clisp.org>
parents:
7865
diff
changeset
|
38 -e 's|@''GNULIB_FTRUNCATE''@|$(GNULIB_FTRUNCATE)|g' \ |
51d32a83a7df
Move more declarations into <unistd.h>.
Bruno Haible <bruno@clisp.org>
parents:
7865
diff
changeset
|
39 -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
|
40 -e 's|@''GNULIB_GETDOMAINNAME''@|$(GNULIB_GETDOMAINNAME)|g' \ |
10582
738187526552
New module 'getdtablesize'.
Bruno Haible <bruno@clisp.org>
parents:
10565
diff
changeset
|
41 -e 's|@''GNULIB_GETDTABLESIZE''@|$(GNULIB_GETDTABLESIZE)|g' \ |
10692
b867b19bccb3
Add gethostname() declaration to <unistd.h>.
Bruno Haible <bruno@clisp.org>
parents:
10666
diff
changeset
|
42 -e 's|@''GNULIB_GETHOSTNAME''@|$(GNULIB_GETHOSTNAME)|g' \ |
8199
51d32a83a7df
Move more declarations into <unistd.h>.
Bruno Haible <bruno@clisp.org>
parents:
7865
diff
changeset
|
43 -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
|
44 -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
|
45 -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
|
46 -e 's|@''GNULIB_LCHOWN''@|$(GNULIB_LCHOWN)|g' \ |
11041 | 47 -e 's|@''GNULIB_LINK''@|$(GNULIB_LINK)|g' \ |
8872 | 48 -e 's|@''GNULIB_LSEEK''@|$(GNULIB_LSEEK)|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' \ |
11967
399ddfe4310e
faccessat, symlinkat: continue cleanup of previous patch
Eric Blake <ebb9@byu.net>
parents:
11966
diff
changeset
|
51 -e 's|@''GNULIB_READLINKAT''@|$(GNULIB_READLINKAT)|g' \ |
11993
767d867147de
rmdir: work around cygwin 1.5.x and mingw bugs
Eric Blake <ebb9@byu.net>
parents:
11992
diff
changeset
|
52 -e 's|@''GNULIB_RMDIR''@|$(GNULIB_RMDIR)|g' \ |
8786 | 53 -e 's|@''GNULIB_SLEEP''@|$(GNULIB_SLEEP)|g' \ |
11956 | 54 -e 's|@''GNULIB_SYMLINKAT''@|$(GNULIB_SYMLINKAT)|g' \ |
11810
d2c9dd185002
Ensure that getopt() gets declared by <unistd.h>.
Bruno Haible <bruno@clisp.org>
parents:
11801
diff
changeset
|
55 -e 's|@''GNULIB_UNISTD_H_GETOPT''@|$(GNULIB_UNISTD_H_GETOPT)|g' \ |
10484 | 56 -e 's|@''GNULIB_UNISTD_H_SIGPIPE''@|$(GNULIB_UNISTD_H_SIGPIPE)|g' \ |
11966
715fd167345f
Remove dependency from unistd_h.m4, sys_stat_h.m4, fcntl_h.m4 to openat.m4.
Bruno Haible <bruno@clisp.org>
parents:
11956
diff
changeset
|
57 -e 's|@''GNULIB_UNLINKAT''@|$(GNULIB_UNLINKAT)|g' \ |
10484 | 58 -e 's|@''GNULIB_WRITE''@|$(GNULIB_WRITE)|g' \ |
8199
51d32a83a7df
Move more declarations into <unistd.h>.
Bruno Haible <bruno@clisp.org>
parents:
7865
diff
changeset
|
59 -e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \ |
11886 | 60 -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
|
61 -e 's|@''HAVE_EUIDACCESS''@|$(HAVE_EUIDACCESS)|g' \ |
11945 | 62 -e 's|@''HAVE_FACCESSAT''@|$(HAVE_FACCESSAT)|g' \ |
11942
d1047ae4b8d5
openat: declare in POSIX headers
Eric Blake <ebb9@byu.net>
parents:
11886
diff
changeset
|
63 -e 's|@''HAVE_FCHOWNAT''@|$(HAVE_FCHOWNAT)|g' \ |
10565 | 64 -e 's|@''HAVE_FSYNC''@|$(HAVE_FSYNC)|g' \ |
8199
51d32a83a7df
Move more declarations into <unistd.h>.
Bruno Haible <bruno@clisp.org>
parents:
7865
diff
changeset
|
65 -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
|
66 -e 's|@''HAVE_GETDOMAINNAME''@|$(HAVE_GETDOMAINNAME)|g' \ |
10582
738187526552
New module 'getdtablesize'.
Bruno Haible <bruno@clisp.org>
parents:
10565
diff
changeset
|
67 -e 's|@''HAVE_GETDTABLESIZE''@|$(HAVE_GETDTABLESIZE)|g' \ |
10692
b867b19bccb3
Add gethostname() declaration to <unistd.h>.
Bruno Haible <bruno@clisp.org>
parents:
10666
diff
changeset
|
68 -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
|
69 -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
|
70 -e 's|@''HAVE_GETUSERSHELL''@|$(HAVE_GETUSERSHELL)|g' \ |
11041 | 71 -e 's|@''HAVE_LINK''@|$(HAVE_LINK)|g' \ |
11870 | 72 -e 's|@''HAVE_PIPE2''@|$(HAVE_PIPE2)|g' \ |
8199
51d32a83a7df
Move more declarations into <unistd.h>.
Bruno Haible <bruno@clisp.org>
parents:
7865
diff
changeset
|
73 -e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \ |
11956 | 74 -e 's|@''HAVE_READLINKAT''@|$(HAVE_READLINKAT)|g' \ |
8786 | 75 -e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \ |
11956 | 76 -e 's|@''HAVE_SYMLINKAT''@|$(HAVE_SYMLINKAT)|g' \ |
11942
d1047ae4b8d5
openat: declare in POSIX headers
Eric Blake <ebb9@byu.net>
parents:
11886
diff
changeset
|
77 -e 's|@''HAVE_UNLINKAT''@|$(HAVE_UNLINKAT)|g' \ |
9721 | 78 -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
|
79 -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
|
80 -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
|
81 -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
|
82 -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \ |
10609 | 83 -e 's|@''REPLACE_CLOSE''@|$(REPLACE_CLOSE)|g' \ |
11992
a1e0b2efc812
fchdir: improve use of replacement functions
Eric Blake <ebb9@byu.net>
parents:
11981
diff
changeset
|
84 -e 's|@''REPLACE_DUP''@|$(REPLACE_DUP)|g' \ |
11726
c694fa3f9d7d
dup2: work around mingw and cygwin 1.5 bug
Eric Blake <ebb9@byu.net>
parents:
11041
diff
changeset
|
85 -e 's|@''REPLACE_DUP2''@|$(REPLACE_DUP2)|g' \ |
8199
51d32a83a7df
Move more declarations into <unistd.h>.
Bruno Haible <bruno@clisp.org>
parents:
7865
diff
changeset
|
86 -e 's|@''REPLACE_FCHDIR''@|$(REPLACE_FCHDIR)|g' \ |
11942
d1047ae4b8d5
openat: declare in POSIX headers
Eric Blake <ebb9@byu.net>
parents:
11886
diff
changeset
|
87 -e 's|@''REPLACE_FCHOWNAT''@|$(REPLACE_FCHOWNAT)|g' \ |
8199
51d32a83a7df
Move more declarations into <unistd.h>.
Bruno Haible <bruno@clisp.org>
parents:
7865
diff
changeset
|
88 -e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \ |
9552
6632990b0812
Override getpagesize on mingw.
Martin Lambers <marlam@marlam.de>
parents:
9498
diff
changeset
|
89 -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
|
90 -e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \ |
11981 | 91 -e 's|@''REPLACE_LINK''@|$(REPLACE_LINK)|g' \ |
8872 | 92 -e 's|@''REPLACE_LSEEK''@|$(REPLACE_LSEEK)|g' \ |
11993
767d867147de
rmdir: work around cygwin 1.5.x and mingw bugs
Eric Blake <ebb9@byu.net>
parents:
11992
diff
changeset
|
93 -e 's|@''REPLACE_RMDIR''@|$(REPLACE_RMDIR)|g' \ |
10484 | 94 -e 's|@''REPLACE_WRITE''@|$(REPLACE_WRITE)|g' \ |
10610
9202c6340cce
Combine the two replacements of 'close'.
Paolo Bonzini <bonzini@gnu.org>
parents:
10609
diff
changeset
|
95 -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
|
96 -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
|
97 -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
|
98 < $(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
|
99 } > $@-t && \ |
7863 | 100 mv $@-t $@ |
101 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
|
102 |
143f906c9a6a
Fix use of unistd.h in getopt through a new unistd module.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
103 Include: |
143f906c9a6a
Fix use of unistd.h in getopt through a new unistd module.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
104 #include <unistd.h> |
143f906c9a6a
Fix use of unistd.h in getopt through a new unistd module.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
105 |
143f906c9a6a
Fix use of unistd.h in getopt through a new unistd module.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
106 License: |
9102
404dc8725caf
Use the synonymous term LGPLv2.
Bruno Haible <bruno@clisp.org>
parents:
8995
diff
changeset
|
107 LGPLv2+ |
6685
143f906c9a6a
Fix use of unistd.h in getopt through a new unistd module.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
108 |
143f906c9a6a
Fix use of unistd.h in getopt through a new unistd module.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
109 Maintainer: |
8995
1025663f7658
* m4/include_next.m4 (gl_INCLUDE_NEXT): Define and AC_SUBST
Paul Eggert <eggert@cs.ucla.edu>
parents:
8982
diff
changeset
|
110 all |