summaryrefslogtreecommitdiff
path: root/gnulib/lib
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2009-11-09 16:53:46 +0000
committerColin Watson <cjwatson@debian.org>2009-11-09 16:53:46 +0000
commit294aa8a9c4b4ff246793fe3f52926f632851d86f (patch)
treecd13797cafec7c482f444c19cf9f2425ecbd261c /gnulib/lib
parent7b3c53f2e67e5abdc9383b10f2ab53406590f352 (diff)
Upgrade to Gnulib 20090915.
Diffstat (limited to 'gnulib/lib')
-rw-r--r--gnulib/lib/Makefile.am320
-rw-r--r--gnulib/lib/Makefile.in391
-rw-r--r--gnulib/lib/argp-ba.c14
-rw-r--r--gnulib/lib/argp-pv.c14
-rw-r--r--gnulib/lib/at-func.c48
-rw-r--r--gnulib/lib/canonicalize-lgpl.c5
-rw-r--r--gnulib/lib/canonicalize.c7
-rw-r--r--gnulib/lib/chdir-long.c5
-rw-r--r--gnulib/lib/chown.c16
-rw-r--r--gnulib/lib/close.c2
-rw-r--r--gnulib/lib/dirent.in.h17
-rw-r--r--gnulib/lib/dup-safer.c2
-rw-r--r--gnulib/lib/dup2.c29
-rw-r--r--gnulib/lib/fchdir.c246
-rw-r--r--gnulib/lib/fchmodat.c14
-rw-r--r--gnulib/lib/fchownat.c13
-rw-r--r--gnulib/lib/fcntl--.h7
-rw-r--r--gnulib/lib/fcntl-safer.h6
-rw-r--r--gnulib/lib/fcntl.in.h71
-rw-r--r--gnulib/lib/fdopendir.c107
-rw-r--r--gnulib/lib/fstatat.c8
-rw-r--r--gnulib/lib/getcwd.c24
-rw-r--r--gnulib/lib/gettimeofday.c4
-rw-r--r--gnulib/lib/glob.c7
-rw-r--r--gnulib/lib/lchown.c24
-rw-r--r--gnulib/lib/mkdirat.c9
-rw-r--r--gnulib/lib/mkdtemp.c4
-rw-r--r--gnulib/lib/mkstemp.c4
-rw-r--r--gnulib/lib/open.c34
-rw-r--r--gnulib/lib/openat-priv.h22
-rw-r--r--gnulib/lib/openat-proc.c14
-rw-r--r--gnulib/lib/openat-safer.c46
-rw-r--r--gnulib/lib/openat.c80
-rw-r--r--gnulib/lib/openat.h86
-rw-r--r--gnulib/lib/realloc.c87
-rw-r--r--gnulib/lib/rename.c47
-rw-r--r--gnulib/lib/stddef.in.h86
-rw-r--r--gnulib/lib/stdio-write.c8
-rw-r--r--gnulib/lib/stdio.in.h628
-rw-r--r--gnulib/lib/stdlib.in.h27
-rw-r--r--gnulib/lib/strdup.c55
-rw-r--r--gnulib/lib/string.in.h14
-rw-r--r--gnulib/lib/sys_select.in.h6
-rw-r--r--gnulib/lib/sys_socket.in.h27
-rw-r--r--gnulib/lib/sys_stat.in.h71
-rw-r--r--gnulib/lib/tempname.c21
-rw-r--r--gnulib/lib/tempname.h6
-rw-r--r--gnulib/lib/unistd.in.h155
-rw-r--r--gnulib/lib/vasnprintf.c3
-rw-r--r--gnulib/lib/wctype.in.h49
50 files changed, 2018 insertions, 972 deletions
diff --git a/gnulib/lib/Makefile.am b/gnulib/lib/Makefile.am
index 073b20bd..51f825d1 100644
--- a/gnulib/lib/Makefile.am
+++ b/gnulib/lib/Makefile.am
@@ -63,9 +63,10 @@ BUILT_SOURCES += $(ALLOCA_H)
# We need the following in order to create <alloca.h> when the system
# doesn't have one that works with the given compiler.
alloca.h: alloca.in.h
+ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
cat $(srcdir)/alloca.in.h; \
- } > $@-t
+ } > $@-t && \
mv -f $@-t $@
MOSTLYCLEANFILES += alloca.h alloca.h-t
@@ -187,7 +188,7 @@ EXTRA_DIST += close-hook.h
# The Automake-defined pkg* macros are appended, in the order
# listed in the Automake 1.10a+ documentation.
configmake.h: Makefile
- rm -f $@-t
+ $(AM_V_GEN)rm -f $@-t && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
echo '#define PREFIX "$(prefix)"'; \
echo '#define EXEC_PREFIX "$(exec_prefix)"'; \
@@ -216,7 +217,7 @@ configmake.h: Makefile
echo '#define PKGINCLUDEDIR "$(pkgincludedir)"'; \
echo '#define PKGLIBDIR "$(pkglibdir)"'; \
echo '#define PKGLIBEXECDIR "$(pkglibexecdir)"'; \
- } | sed '/""/d' > $@-t
+ } | sed '/""/d' > $@-t && \
if test -f $@ && cmp $@-t $@ > /dev/null; then \
rm -f $@-t; \
else \
@@ -235,21 +236,23 @@ BUILT_SOURCES += $(DIRENT_H)
# We need the following in order to create <dirent.h> when the system
# doesn't have one that works with the given compiler.
dirent.h: dirent.in.h
- rm -f $@-t $@
+ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''NEXT_DIRENT_H''@|$(NEXT_DIRENT_H)|g' \
-e 's|@''GNULIB_DIRFD''@|$(GNULIB_DIRFD)|g' \
+ -e 's|@''GNULIB_FDOPENDIR''@|$(GNULIB_FDOPENDIR)|g' \
-e 's|@''GNULIB_SCANDIR''@|$(GNULIB_SCANDIR)|g' \
-e 's|@''GNULIB_ALPHASORT''@|$(GNULIB_ALPHASORT)|g' \
-e 's|@''HAVE_DECL_DIRFD''@|$(HAVE_DECL_DIRFD)|g' \
+ -e 's|@''HAVE_FDOPENDIR''@|$(HAVE_FDOPENDIR)|g' \
-e 's|@''HAVE_SCANDIR''@|$(HAVE_SCANDIR)|g' \
-e 's|@''HAVE_ALPHASORT''@|$(HAVE_ALPHASORT)|g' \
-e 's|@''REPLACE_FCHDIR''@|$(REPLACE_FCHDIR)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
< $(srcdir)/dirent.in.h; \
- } > $@-t
+ } > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += dirent.h dirent.h-t
@@ -291,7 +294,7 @@ BUILT_SOURCES += $(ERRNO_H)
# We need the following in order to create <errno.h> when the system
# doesn't have one that is POSIX compliant.
errno.h: errno.in.h
- rm -f $@-t $@
+ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
@@ -303,7 +306,7 @@ errno.h: errno.in.h
-e 's|@''EOVERFLOW_HIDDEN''@|$(EOVERFLOW_HIDDEN)|g' \
-e 's|@''EOVERFLOW_VALUE''@|$(EOVERFLOW_VALUE)|g' \
< $(srcdir)/errno.in.h; \
- } > $@-t
+ } > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += errno.h errno.h-t
@@ -347,28 +350,31 @@ EXTRA_libgnu_a_SOURCES += fclose.c
## end gnulib module fclose
-## begin gnulib module fcntl
+## begin gnulib module fcntl-h
BUILT_SOURCES += $(FCNTL_H)
# We need the following in order to create <fcntl.h> when the system
# doesn't have one that works with the given compiler.
fcntl.h: fcntl.in.h
- rm -f $@-t $@
+ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''NEXT_FCNTL_H''@|$(NEXT_FCNTL_H)|g' \
-e 's|@''GNULIB_OPEN''@|$(GNULIB_OPEN)|g' \
+ -e 's|@''GNULIB_OPENAT''@|$(GNULIB_OPENAT)|g' \
-e 's|@''REPLACE_OPEN''@|$(REPLACE_OPEN)|g' \
+ -e 's|@''HAVE_OPENAT''@|$(HAVE_OPENAT)|g' \
+ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
< $(srcdir)/fcntl.in.h; \
- } > $@-t
+ } > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += fcntl.h fcntl.h-t
EXTRA_DIST += fcntl.in.h
-## end gnulib module fcntl
+## end gnulib module fcntl-h
## begin gnulib module fcntl-safer
@@ -379,6 +385,15 @@ EXTRA_libgnu_a_SOURCES += creat-safer.c open-safer.c
## end gnulib module fcntl-safer
+## begin gnulib module fdopendir
+
+
+EXTRA_DIST += fdopendir.c openat-priv.h openat-proc.c
+
+EXTRA_libgnu_a_SOURCES += fdopendir.c openat-proc.c
+
+## end gnulib module fdopendir
+
## begin gnulib module file-set
libgnu_a_SOURCES += file-set.c
@@ -403,13 +418,13 @@ BUILT_SOURCES += $(FLOAT_H)
# We need the following in order to create <float.h> when the system
# doesn't have one that works with the given compiler.
float.h: float.in.h
- rm -f $@-t $@
+ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''NEXT_FLOAT_H''@|$(NEXT_FLOAT_H)|g' \
< $(srcdir)/float.in.h; \
- } > $@-t
+ } > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += float.h float.h-t
@@ -424,9 +439,10 @@ BUILT_SOURCES += $(FNMATCH_H)
# We need the following in order to create <fnmatch.h> when the system
# doesn't have one that supports the required API.
fnmatch.h: fnmatch.in.h
+ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
cat $(srcdir)/fnmatch.in.h; \
- } > $@-t
+ } > $@-t && \
mv -f $@-t $@
MOSTLYCLEANFILES += fnmatch.h fnmatch.h-t
@@ -454,16 +470,17 @@ EXTRA_libgnu_a_SOURCES += getlogin_r.c
## end gnulib module getlogin_r
-## begin gnulib module getopt
+## begin gnulib module getopt-posix
BUILT_SOURCES += $(GETOPT_H)
# We need the following in order to create <getopt.h> when the system
# doesn't have one that works with the given compiler.
getopt.h: getopt.in.h
+ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
cat $(srcdir)/getopt.in.h; \
- } > $@-t
+ } > $@-t && \
mv -f $@-t $@
MOSTLYCLEANFILES += getopt.h getopt.h-t
@@ -471,7 +488,7 @@ EXTRA_DIST += getopt.c getopt.in.h getopt1.c getopt_int.h
EXTRA_libgnu_a_SOURCES += getopt.c getopt1.c
-## end gnulib module getopt
+## end gnulib module getopt-posix
## begin gnulib module getpagesize
@@ -520,10 +537,11 @@ BUILT_SOURCES += $(GLOB_H)
# We need the following in order to create <glob.h> when the system
# doesn't have one that works with the given compiler.
glob.h: glob.in.h
+ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''HAVE_SYS_CDEFS_H''@|$(HAVE_SYS_CDEFS_H)|g' \
< $(srcdir)/glob.in.h; \
- } > $@-t
+ } > $@-t && \
mv -f $@-t $@
MOSTLYCLEANFILES += glob.h glob.h-t
@@ -645,14 +663,14 @@ uninstall-localcharset: all-local
fi
charset.alias: config.charset
- rm -f t-$@ $@
- $(SHELL) $(srcdir)/config.charset '$(host)' > t-$@
+ $(AM_V_GEN)rm -f t-$@ $@ && \
+ $(SHELL) $(srcdir)/config.charset '$(host)' > t-$@ && \
mv t-$@ $@
SUFFIXES += .sed .sin
.sin.sed:
- rm -f t-$@ $@
- sed -e '/^#/d' -e 's/@''PACKAGE''@/$(PACKAGE)/g' $< > t-$@
+ $(AM_V_GEN)rm -f t-$@ $@ && \
+ sed -e '/^#/d' -e 's/@''PACKAGE''@/$(PACKAGE)/g' $< > t-$@ && \
mv t-$@ $@
CLEANFILES += charset.alias ref-add.sed ref-del.sed
@@ -813,6 +831,15 @@ libgnu_a_SOURCES += openat-die.c
## end gnulib module openat-die
+## begin gnulib module openat-safer
+
+
+EXTRA_DIST += fcntl--.h fcntl-safer.h openat-safer.c
+
+EXTRA_libgnu_a_SOURCES += openat-safer.c
+
+## end gnulib module openat-safer
+
## begin gnulib module pathmax
@@ -838,6 +865,15 @@ EXTRA_libgnu_a_SOURCES += readlink.c
## end gnulib module readlink
+## begin gnulib module realloc-posix
+
+
+EXTRA_DIST += realloc.c
+
+EXTRA_libgnu_a_SOURCES += realloc.c
+
+## end gnulib module realloc-posix
+
## begin gnulib module regex
@@ -906,7 +942,7 @@ BUILT_SOURCES += signal.h
# We need the following in order to create <signal.h> when the system
# doesn't have a complete one.
signal.h: signal.in.h
- rm -f $@-t $@
+ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
@@ -922,7 +958,7 @@ signal.h: signal.in.h
-e 's|@''HAVE_TYPE_VOLATILE_SIG_ATOMIC_T''@|$(HAVE_TYPE_VOLATILE_SIG_ATOMIC_T)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
< $(srcdir)/signal.in.h; \
- } > $@-t
+ } > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += signal.h signal.h-t
@@ -970,13 +1006,13 @@ BUILT_SOURCES += $(STDARG_H)
# We need the following in order to create <stdarg.h> when the system
# doesn't have one that works with the given compiler.
stdarg.h: stdarg.in.h
- rm -f $@-t $@
+ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''NEXT_STDARG_H''@|$(NEXT_STDARG_H)|g' \
< $(srcdir)/stdarg.in.h; \
- } > $@-t
+ } > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += stdarg.h stdarg.h-t
@@ -991,10 +1027,10 @@ BUILT_SOURCES += $(STDBOOL_H)
# We need the following in order to create <stdbool.h> when the system
# doesn't have one that works.
stdbool.h: stdbool.in.h
- rm -f $@-t $@
+ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool.in.h; \
- } > $@-t
+ } > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += stdbool.h stdbool.h-t
@@ -1002,6 +1038,29 @@ EXTRA_DIST += stdbool.in.h
## end gnulib module stdbool
+## begin gnulib module stddef
+
+BUILT_SOURCES += $(STDDEF_H)
+
+# We need the following in order to create <stddef.h> when the system
+# doesn't have one that works with the given compiler.
+stddef.h: stddef.in.h
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''NEXT_STDDEF_H''@|$(NEXT_STDDEF_H)|g' \
+ -e 's|@''HAVE_WCHAR_T''@|$(HAVE_WCHAR_T)|g' \
+ -e 's|@''REPLACE_NULL''@|$(REPLACE_NULL)|g' \
+ < $(srcdir)/stddef.in.h; \
+ } > $@-t && \
+ mv $@-t $@
+MOSTLYCLEANFILES += stddef.h stddef.h-t
+
+EXTRA_DIST += stddef.in.h
+
+## end gnulib module stddef
+
## begin gnulib module stdint
BUILT_SOURCES += $(STDINT_H)
@@ -1009,7 +1068,7 @@ BUILT_SOURCES += $(STDINT_H)
# We need the following in order to create <stdint.h> when the system
# doesn't have one that works with the given compiler.
stdint.h: stdint.in.h
- rm -f $@-t $@
+ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@@ -1036,7 +1095,7 @@ stdint.h: stdint.in.h
-e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \
-e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \
< $(srcdir)/stdint.in.h; \
- } > $@-t
+ } > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += stdint.h stdint.h-t
@@ -1051,83 +1110,87 @@ BUILT_SOURCES += stdio.h
# We need the following in order to create <stdio.h> when the system
# doesn't have one that works with the given compiler.
stdio.h: stdio.in.h
- rm -f $@-t $@
+ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''NEXT_STDIO_H''@|$(NEXT_STDIO_H)|g' \
- -e 's|@''GNULIB_FPRINTF''@|$(GNULIB_FPRINTF)|g' \
- -e 's|@''GNULIB_FPRINTF_POSIX''@|$(GNULIB_FPRINTF_POSIX)|g' \
- -e 's|@''GNULIB_PRINTF''@|$(GNULIB_PRINTF)|g' \
- -e 's|@''GNULIB_PRINTF_POSIX''@|$(GNULIB_PRINTF_POSIX)|g' \
- -e 's|@''GNULIB_SNPRINTF''@|$(GNULIB_SNPRINTF)|g' \
- -e 's|@''GNULIB_SPRINTF_POSIX''@|$(GNULIB_SPRINTF_POSIX)|g' \
- -e 's|@''GNULIB_VFPRINTF''@|$(GNULIB_VFPRINTF)|g' \
- -e 's|@''GNULIB_VFPRINTF_POSIX''@|$(GNULIB_VFPRINTF_POSIX)|g' \
- -e 's|@''GNULIB_VPRINTF''@|$(GNULIB_VPRINTF)|g' \
- -e 's|@''GNULIB_VPRINTF_POSIX''@|$(GNULIB_VPRINTF_POSIX)|g' \
- -e 's|@''GNULIB_VSNPRINTF''@|$(GNULIB_VSNPRINTF)|g' \
- -e 's|@''GNULIB_VSPRINTF_POSIX''@|$(GNULIB_VSPRINTF_POSIX)|g' \
-e 's|@''GNULIB_DPRINTF''@|$(GNULIB_DPRINTF)|g' \
- -e 's|@''GNULIB_VDPRINTF''@|$(GNULIB_VDPRINTF)|g' \
- -e 's|@''GNULIB_VASPRINTF''@|$(GNULIB_VASPRINTF)|g' \
- -e 's|@''GNULIB_OBSTACK_PRINTF''@|$(GNULIB_OBSTACK_PRINTF)|g' \
- -e 's|@''GNULIB_OBSTACK_PRINTF_POSIX''@|$(GNULIB_OBSTACK_PRINTF_POSIX)|g' \
+ -e 's|@''GNULIB_FCLOSE''@|$(GNULIB_FCLOSE)|g' \
+ -e 's|@''GNULIB_FFLUSH''@|$(GNULIB_FFLUSH)|g' \
-e 's|@''GNULIB_FOPEN''@|$(GNULIB_FOPEN)|g' \
+ -e 's|@''GNULIB_FPRINTF''@|$(GNULIB_FPRINTF)|g' \
+ -e 's|@''GNULIB_FPRINTF_POSIX''@|$(GNULIB_FPRINTF_POSIX)|g' \
+ -e 's|@''GNULIB_FPURGE''@|$(GNULIB_FPURGE)|g' \
+ -e 's|@''GNULIB_FPUTC''@|$(GNULIB_FPUTC)|g' \
+ -e 's|@''GNULIB_FPUTS''@|$(GNULIB_FPUTS)|g' \
-e 's|@''GNULIB_FREOPEN''@|$(GNULIB_FREOPEN)|g' \
-e 's|@''GNULIB_FSEEK''@|$(GNULIB_FSEEK)|g' \
-e 's|@''GNULIB_FSEEKO''@|$(GNULIB_FSEEKO)|g' \
-e 's|@''GNULIB_FTELL''@|$(GNULIB_FTELL)|g' \
-e 's|@''GNULIB_FTELLO''@|$(GNULIB_FTELLO)|g' \
- -e 's|@''GNULIB_FFLUSH''@|$(GNULIB_FFLUSH)|g' \
- -e 's|@''GNULIB_FPURGE''@|$(GNULIB_FPURGE)|g' \
- -e 's|@''GNULIB_FCLOSE''@|$(GNULIB_FCLOSE)|g' \
- -e 's|@''GNULIB_FPUTC''@|$(GNULIB_FPUTC)|g' \
- -e 's|@''GNULIB_PUTC''@|$(GNULIB_PUTC)|g' \
- -e 's|@''GNULIB_PUTCHAR''@|$(GNULIB_PUTCHAR)|g' \
- -e 's|@''GNULIB_FPUTS''@|$(GNULIB_FPUTS)|g' \
- -e 's|@''GNULIB_PUTS''@|$(GNULIB_PUTS)|g' \
-e 's|@''GNULIB_FWRITE''@|$(GNULIB_FWRITE)|g' \
-e 's|@''GNULIB_GETDELIM''@|$(GNULIB_GETDELIM)|g' \
-e 's|@''GNULIB_GETLINE''@|$(GNULIB_GETLINE)|g' \
+ -e 's|@''GNULIB_OBSTACK_PRINTF''@|$(GNULIB_OBSTACK_PRINTF)|g' \
+ -e 's|@''GNULIB_OBSTACK_PRINTF_POSIX''@|$(GNULIB_OBSTACK_PRINTF_POSIX)|g' \
-e 's|@''GNULIB_PERROR''@|$(GNULIB_PERROR)|g' \
+ -e 's|@''GNULIB_POPEN''@|$(GNULIB_POPEN)|g' \
+ -e 's|@''GNULIB_PRINTF''@|$(GNULIB_PRINTF)|g' \
+ -e 's|@''GNULIB_PRINTF_POSIX''@|$(GNULIB_PRINTF_POSIX)|g' \
+ -e 's|@''GNULIB_PUTC''@|$(GNULIB_PUTC)|g' \
+ -e 's|@''GNULIB_PUTCHAR''@|$(GNULIB_PUTCHAR)|g' \
+ -e 's|@''GNULIB_PUTS''@|$(GNULIB_PUTS)|g' \
+ -e 's|@''GNULIB_RENAME''@|$(GNULIB_RENAME)|g' \
+ -e 's|@''GNULIB_SNPRINTF''@|$(GNULIB_SNPRINTF)|g' \
+ -e 's|@''GNULIB_SPRINTF_POSIX''@|$(GNULIB_SPRINTF_POSIX)|g' \
-e 's|@''GNULIB_STDIO_H_SIGPIPE''@|$(GNULIB_STDIO_H_SIGPIPE)|g' \
- -e 's|@''REPLACE_STDIO_WRITE_FUNCS''@|$(REPLACE_STDIO_WRITE_FUNCS)|g' \
- -e 's|@''REPLACE_FPRINTF''@|$(REPLACE_FPRINTF)|g' \
- -e 's|@''REPLACE_VFPRINTF''@|$(REPLACE_VFPRINTF)|g' \
- -e 's|@''REPLACE_PRINTF''@|$(REPLACE_PRINTF)|g' \
- -e 's|@''REPLACE_VPRINTF''@|$(REPLACE_VPRINTF)|g' \
- -e 's|@''REPLACE_SNPRINTF''@|$(REPLACE_SNPRINTF)|g' \
+ -e 's|@''GNULIB_VASPRINTF''@|$(GNULIB_VASPRINTF)|g' \
+ -e 's|@''GNULIB_VDPRINTF''@|$(GNULIB_VDPRINTF)|g' \
+ -e 's|@''GNULIB_VFPRINTF''@|$(GNULIB_VFPRINTF)|g' \
+ -e 's|@''GNULIB_VFPRINTF_POSIX''@|$(GNULIB_VFPRINTF_POSIX)|g' \
+ -e 's|@''GNULIB_VPRINTF''@|$(GNULIB_VPRINTF)|g' \
+ -e 's|@''GNULIB_VPRINTF_POSIX''@|$(GNULIB_VPRINTF_POSIX)|g' \
+ -e 's|@''GNULIB_VSNPRINTF''@|$(GNULIB_VSNPRINTF)|g' \
+ -e 's|@''GNULIB_VSPRINTF_POSIX''@|$(GNULIB_VSPRINTF_POSIX)|g' \
+ -e 's|@''HAVE_DECL_FPURGE''@|$(HAVE_DECL_FPURGE)|g' \
+ -e 's|@''HAVE_DECL_GETDELIM''@|$(HAVE_DECL_GETDELIM)|g' \
+ -e 's|@''HAVE_DECL_GETLINE''@|$(HAVE_DECL_GETLINE)|g' \
+ -e 's|@''HAVE_DECL_OBSTACK_PRINTF''@|$(HAVE_DECL_OBSTACK_PRINTF)|g' \
-e 's|@''HAVE_DECL_SNPRINTF''@|$(HAVE_DECL_SNPRINTF)|g' \
- -e 's|@''REPLACE_VSNPRINTF''@|$(REPLACE_VSNPRINTF)|g' \
-e 's|@''HAVE_DECL_VSNPRINTF''@|$(HAVE_DECL_VSNPRINTF)|g' \
- -e 's|@''REPLACE_SPRINTF''@|$(REPLACE_SPRINTF)|g' \
- -e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \
-e 's|@''HAVE_DPRINTF''@|$(HAVE_DPRINTF)|g' \
- -e 's|@''REPLACE_DPRINTF''@|$(REPLACE_DPRINTF)|g' \
- -e 's|@''HAVE_VDPRINTF''@|$(HAVE_VDPRINTF)|g' \
- -e 's|@''REPLACE_VDPRINTF''@|$(REPLACE_VDPRINTF)|g' \
-e 's|@''HAVE_VASPRINTF''@|$(HAVE_VASPRINTF)|g' \
- -e 's|@''REPLACE_VASPRINTF''@|$(REPLACE_VASPRINTF)|g' \
- -e 's|@''HAVE_DECL_OBSTACK_PRINTF''@|$(HAVE_DECL_OBSTACK_PRINTF)|g' \
- -e 's|@''REPLACE_OBSTACK_PRINTF''@|$(REPLACE_OBSTACK_PRINTF)|g' \
+ -e 's|@''HAVE_VDPRINTF''@|$(HAVE_VDPRINTF)|g' \
+ -e 's|@''REPLACE_DPRINTF''@|$(REPLACE_DPRINTF)|g' \
+ -e 's|@''REPLACE_FCLOSE''@|$(REPLACE_FCLOSE)|g' \
+ -e 's|@''REPLACE_FFLUSH''@|$(REPLACE_FFLUSH)|g' \
-e 's|@''REPLACE_FOPEN''@|$(REPLACE_FOPEN)|g' \
+ -e 's|@''REPLACE_FPRINTF''@|$(REPLACE_FPRINTF)|g' \
+ -e 's|@''REPLACE_FPURGE''@|$(REPLACE_FPURGE)|g' \
-e 's|@''REPLACE_FREOPEN''@|$(REPLACE_FREOPEN)|g' \
- -e 's|@''REPLACE_FSEEKO''@|$(REPLACE_FSEEKO)|g' \
-e 's|@''REPLACE_FSEEK''@|$(REPLACE_FSEEK)|g' \
- -e 's|@''REPLACE_FTELLO''@|$(REPLACE_FTELLO)|g' \
+ -e 's|@''REPLACE_FSEEKO''@|$(REPLACE_FSEEKO)|g' \
-e 's|@''REPLACE_FTELL''@|$(REPLACE_FTELL)|g' \
- -e 's|@''REPLACE_FFLUSH''@|$(REPLACE_FFLUSH)|g' \
- -e 's|@''REPLACE_FPURGE''@|$(REPLACE_FPURGE)|g' \
- -e 's|@''HAVE_DECL_FPURGE''@|$(HAVE_DECL_FPURGE)|g' \
- -e 's|@''REPLACE_FCLOSE''@|$(REPLACE_FCLOSE)|g' \
- -e 's|@''HAVE_DECL_GETDELIM''@|$(HAVE_DECL_GETDELIM)|g' \
- -e 's|@''HAVE_DECL_GETLINE''@|$(HAVE_DECL_GETLINE)|g' \
+ -e 's|@''REPLACE_FTELLO''@|$(REPLACE_FTELLO)|g' \
-e 's|@''REPLACE_GETLINE''@|$(REPLACE_GETLINE)|g' \
+ -e 's|@''REPLACE_OBSTACK_PRINTF''@|$(REPLACE_OBSTACK_PRINTF)|g' \
-e 's|@''REPLACE_PERROR''@|$(REPLACE_PERROR)|g' \
+ -e 's|@''REPLACE_POPEN''@|$(REPLACE_POPEN)|g' \
+ -e 's|@''REPLACE_PRINTF''@|$(REPLACE_PRINTF)|g' \
+ -e 's|@''REPLACE_RENAME''@|$(REPLACE_RENAME)|g' \
+ -e 's|@''REPLACE_SNPRINTF''@|$(REPLACE_SNPRINTF)|g' \
+ -e 's|@''REPLACE_SPRINTF''@|$(REPLACE_SPRINTF)|g' \
+ -e 's|@''REPLACE_STDIO_WRITE_FUNCS''@|$(REPLACE_STDIO_WRITE_FUNCS)|g' \
+ -e 's|@''REPLACE_VASPRINTF''@|$(REPLACE_VASPRINTF)|g' \
+ -e 's|@''REPLACE_VDPRINTF''@|$(REPLACE_VDPRINTF)|g' \
+ -e 's|@''REPLACE_VFPRINTF''@|$(REPLACE_VFPRINTF)|g' \
+ -e 's|@''REPLACE_VPRINTF''@|$(REPLACE_VPRINTF)|g' \
+ -e 's|@''REPLACE_VSNPRINTF''@|$(REPLACE_VSNPRINTF)|g' \
+ -e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
< $(srcdir)/stdio.in.h; \
- } > $@-t
+ } > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += stdio.h stdio.h-t
@@ -1144,7 +1207,7 @@ BUILT_SOURCES += stdlib.h
# We need the following in order to create <stdlib.h> when the system
# doesn't have one that works with the given compiler.
stdlib.h: stdlib.in.h
- rm -f $@-t $@
+ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
@@ -1157,6 +1220,7 @@ stdlib.h: stdlib.in.h
-e 's|@''GNULIB_GETLOADAVG''@|$(GNULIB_GETLOADAVG)|g' \
-e 's|@''GNULIB_GETSUBOPT''@|$(GNULIB_GETSUBOPT)|g' \
-e 's|@''GNULIB_MKDTEMP''@|$(GNULIB_MKDTEMP)|g' \
+ -e 's|@''GNULIB_MKOSTEMP''@|$(GNULIB_MKOSTEMP)|g' \
-e 's|@''GNULIB_MKSTEMP''@|$(GNULIB_MKSTEMP)|g' \
-e 's|@''GNULIB_PUTENV''@|$(GNULIB_PUTENV)|g' \
-e 's|@''GNULIB_RANDOM_R''@|$(GNULIB_RANDOM_R)|g' \
@@ -1171,6 +1235,7 @@ stdlib.h: stdlib.in.h
-e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \
-e 's|@''HAVE_MALLOC_POSIX''@|$(HAVE_MALLOC_POSIX)|g' \
-e 's|@''HAVE_MKDTEMP''@|$(HAVE_MKDTEMP)|g' \
+ -e 's|@''HAVE_MKOSTEMP''@|$(HAVE_MKOSTEMP)|g' \
-e 's|@''HAVE_REALLOC_POSIX''@|$(HAVE_REALLOC_POSIX)|g' \
-e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \
-e 's|@''HAVE_RPMATCH''@|$(HAVE_RPMATCH)|g' \
@@ -1188,7 +1253,7 @@ stdlib.h: stdlib.in.h
-e 's|@''VOID_UNSETENV''@|$(VOID_UNSETENV)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
< $(srcdir)/stdlib.in.h; \
- } > $@-t
+ } > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += stdlib.h stdlib.h-t
@@ -1223,6 +1288,15 @@ EXTRA_libgnu_a_SOURCES += strcspn.c
## end gnulib module strcspn
+## begin gnulib module strdup-posix
+
+
+EXTRA_DIST += strdup.c
+
+EXTRA_libgnu_a_SOURCES += strdup.c
+
+## end gnulib module strdup-posix
+
## begin gnulib module streq
@@ -1246,7 +1320,7 @@ BUILT_SOURCES += string.h
# We need the following in order to create <string.h> when the system
# doesn't have one that works with the given compiler.
string.h: string.in.h
- rm -f $@-t $@
+ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
@@ -1292,7 +1366,6 @@ string.h: string.in.h
-e 's|@''HAVE_STPNCPY''@|$(HAVE_STPNCPY)|g' \
-e 's|@''HAVE_STRCHRNUL''@|$(HAVE_STRCHRNUL)|g' \
-e 's|@''HAVE_DECL_STRDUP''@|$(HAVE_DECL_STRDUP)|g' \
- -e 's|@''HAVE_STRNDUP''@|$(HAVE_STRNDUP)|g' \
-e 's|@''HAVE_DECL_STRNDUP''@|$(HAVE_DECL_STRNDUP)|g' \
-e 's|@''HAVE_DECL_STRNLEN''@|$(HAVE_DECL_STRNLEN)|g' \
-e 's|@''HAVE_STRPBRK''@|$(HAVE_STRPBRK)|g' \
@@ -1308,10 +1381,13 @@ string.h: string.in.h
-e 's|@''REPLACE_STRDUP''@|$(REPLACE_STRDUP)|g' \
-e 's|@''REPLACE_STRSTR''@|$(REPLACE_STRSTR)|g' \
-e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \
+ -e 's|@''REPLACE_STRNDUP''@|$(REPLACE_STRNDUP)|g' \
-e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \
+ -e 's|@''REPLACE_STRTOK_R''@|$(REPLACE_STRTOK_R)|g' \
+ -e 's|@''UNDEFINE_STRTOK_R''@|$(UNDEFINE_STRTOK_R)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
< $(srcdir)/string.in.h; \
- } > $@-t
+ } > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += string.h string.h-t
@@ -1326,7 +1402,7 @@ BUILT_SOURCES += strings.h
# We need the following in order to create <strings.h> when the system
# doesn't have one that works with the given compiler.
strings.h: strings.in.h
- rm -f $@-t $@
+ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
@@ -1335,7 +1411,7 @@ strings.h: strings.in.h
-e 's|@''HAVE_DECL_STRNCASECMP''@|$(HAVE_DECL_STRNCASECMP)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
< $(srcdir)/strings.in.h; \
- } > $@-t
+ } > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += strings.h strings.h-t
@@ -1392,8 +1468,8 @@ BUILT_SOURCES += $(SYS_SELECT_H)
# We need the following in order to create <sys/select.h> when the system
# doesn't have one that works with the given compiler.
sys/select.h: sys_select.in.h
- @MKDIR_P@ sys
- rm -f $@-t $@
+ $(AM_V_at)$(MKDIR_P) sys
+ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
@@ -1404,7 +1480,7 @@ sys/select.h: sys_select.in.h
-e 's|@''REPLACE_SELECT''@|$(REPLACE_SELECT)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
< $(srcdir)/sys_select.in.h; \
- } > $@-t
+ } > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += sys/select.h sys/select.h-t
MOSTLYCLEANDIRS += sys
@@ -1420,7 +1496,8 @@ BUILT_SOURCES += $(SYS_SOCKET_H)
# We need the following in order to create <sys/socket.h> when the system
# doesn't have one that works with the given compiler.
sys/socket.h: sys_socket.in.h
- @MKDIR_P@ sys
+ $(AM_V_at)$(MKDIR_P) sys
+ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
@@ -1441,13 +1518,15 @@ sys/socket.h: sys_socket.in.h
-e 's|@''GNULIB_SENDTO''@|$(GNULIB_SENDTO)|g' \
-e 's|@''GNULIB_SETSOCKOPT''@|$(GNULIB_SETSOCKOPT)|g' \
-e 's|@''GNULIB_SHUTDOWN''@|$(GNULIB_SHUTDOWN)|g' \
+ -e 's|@''GNULIB_ACCEPT4''@|$(GNULIB_ACCEPT4)|g' \
-e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \
-e 's|@''HAVE_WS2TCPIP_H''@|$(HAVE_WS2TCPIP_H)|g' \
-e 's|@''HAVE_STRUCT_SOCKADDR_STORAGE''@|$(HAVE_STRUCT_SOCKADDR_STORAGE)|g' \
-e 's|@''HAVE_SA_FAMILY_T''@|$(HAVE_SA_FAMILY_T)|g' \
+ -e 's|@''HAVE_ACCEPT4''@|$(HAVE_ACCEPT4)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
< $(srcdir)/sys_socket.in.h; \
- } > $@-t
+ } > $@-t && \
mv -f $@-t $@
MOSTLYCLEANFILES += sys/socket.h sys/socket.h-t
MOSTLYCLEANDIRS += sys
@@ -1458,26 +1537,38 @@ EXTRA_DIST += sys_socket.in.h
## begin gnulib module sys_stat
-BUILT_SOURCES += $(SYS_STAT_H)
+BUILT_SOURCES += sys/stat.h
# We need the following in order to create <sys/stat.h> when the system
# has one that is incomplete.
sys/stat.h: sys_stat.in.h
- @MKDIR_P@ sys
- rm -f $@-t $@
+ $(AM_V_at)$(MKDIR_P) sys
+ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''NEXT_SYS_STAT_H''@|$(NEXT_SYS_STAT_H)|g' \
+ -e 's|@''GNULIB_FCHMODAT''@|$(GNULIB_FCHMODAT)|g' \
+ -e 's|@''GNULIB_FSTATAT''@|$(GNULIB_FSTATAT)|g' \
-e 's|@''GNULIB_LCHMOD''@|$(GNULIB_LCHMOD)|g' \
-e 's|@''GNULIB_LSTAT''@|$(GNULIB_LSTAT)|g' \
+ -e 's|@''GNULIB_MKDIRAT''@|$(GNULIB_MKDIRAT)|g' \
+ -e 's|@''GNULIB_MKFIFOAT''@|$(GNULIB_MKFIFOAT)|g' \
+ -e 's|@''GNULIB_MKNODAT''@|$(GNULIB_MKNODAT)|g' \
+ -e 's|@''HAVE_FCHMODAT''@|$(HAVE_FCHMODAT)|g' \
+ -e 's|@''HAVE_FSTATAT''@|$(HAVE_FSTATAT)|g' \
-e 's|@''HAVE_LCHMOD''@|$(HAVE_LCHMOD)|g' \
-e 's|@''HAVE_LSTAT''@|$(HAVE_LSTAT)|g' \
+ -e 's|@''HAVE_MKDIRAT''@|$(HAVE_MKDIRAT)|g' \
+ -e 's|@''HAVE_MKFIFOAT''@|$(HAVE_MKFIFOAT)|g' \
+ -e 's|@''HAVE_MKNODAT''@|$(HAVE_MKNODAT)|g' \
+ -e 's|@''REPLACE_FCHDIR''@|$(REPLACE_FCHDIR)|g' \
+ -e 's|@''REPLACE_FSTATAT''@|$(REPLACE_FSTATAT)|g' \
-e 's|@''REPLACE_LSTAT''@|$(REPLACE_LSTAT)|g' \
-e 's|@''REPLACE_MKDIR''@|$(REPLACE_MKDIR)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
< $(srcdir)/sys_stat.in.h; \
- } > $@-t
+ } > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += sys/stat.h sys/stat.h-t
MOSTLYCLEANDIRS += sys
@@ -1493,8 +1584,8 @@ BUILT_SOURCES += $(SYS_TIME_H)
# We need the following in order to create <sys/time.h> when the system
# doesn't have one that works with the given compiler.
sys/time.h: sys_time.in.h
- @MKDIR_P@ sys
- rm -f $@-t $@
+ $(AM_V_at)$(MKDIR_P) sys
+ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's/@''HAVE_SYS_TIME_H''@/$(HAVE_SYS_TIME_H)/g' \
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@@ -1503,7 +1594,7 @@ sys/time.h: sys_time.in.h
-e 's/@''REPLACE_GETTIMEOFDAY''@/$(REPLACE_GETTIMEOFDAY)/g' \
-e 's/@''HAVE_STRUCT_TIMEVAL''@/$(HAVE_STRUCT_TIMEVAL)/g' \
< $(srcdir)/sys_time.in.h; \
- } > $@-t
+ } > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += sys/time.h sys/time.h-t
@@ -1518,13 +1609,14 @@ BUILT_SOURCES += $(SYSEXITS_H)
# We need the following in order to create <sysexits.h> when the system
# doesn't have one that works with the given compiler.
sysexits.h: sysexits.in.h
+ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''HAVE_SYSEXITS_H''@|$(HAVE_SYSEXITS_H)|g' \
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''NEXT_SYSEXITS_H''@|$(NEXT_SYSEXITS_H)|g' \
< $(srcdir)/sysexits.in.h; \
- } > $@-t
+ } > $@-t && \
mv -f $@-t $@
MOSTLYCLEANFILES += sysexits.h sysexits.h-t
@@ -1562,7 +1654,7 @@ BUILT_SOURCES += unistd.h
# We need the following in order to create an empty placeholder for
# <unistd.h> when the system doesn't have one.
unistd.h: unistd.in.h
- rm -f $@-t $@
+ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@@ -1571,9 +1663,12 @@ unistd.h: unistd.in.h
-e 's|@''GNULIB_CHOWN''@|$(GNULIB_CHOWN)|g' \
-e 's|@''GNULIB_CLOSE''@|$(GNULIB_CLOSE)|g' \
-e 's|@''GNULIB_DUP2''@|$(GNULIB_DUP2)|g' \
+ -e 's|@''GNULIB_DUP3''@|$(GNULIB_DUP3)|g' \
-e 's|@''GNULIB_ENVIRON''@|$(GNULIB_ENVIRON)|g' \
-e 's|@''GNULIB_EUIDACCESS''@|$(GNULIB_EUIDACCESS)|g' \
+ -e 's|@''GNULIB_FACCESSAT''@|$(GNULIB_FACCESSAT)|g' \
-e 's|@''GNULIB_FCHDIR''@|$(GNULIB_FCHDIR)|g' \
+ -e 's|@''GNULIB_FCHOWNAT''@|$(GNULIB_FCHOWNAT)|g' \
-e 's|@''GNULIB_FSYNC''@|$(GNULIB_FSYNC)|g' \
-e 's|@''GNULIB_FTRUNCATE''@|$(GNULIB_FTRUNCATE)|g' \
-e 's|@''GNULIB_GETCWD''@|$(GNULIB_GETCWD)|g' \
@@ -1586,12 +1681,20 @@ unistd.h: unistd.in.h
-e 's|@''GNULIB_LCHOWN''@|$(GNULIB_LCHOWN)|g' \
-e 's|@''GNULIB_LINK''@|$(GNULIB_LINK)|g' \
-e 's|@''GNULIB_LSEEK''@|$(GNULIB_LSEEK)|g' \
+ -e 's|@''GNULIB_PIPE2''@|$(GNULIB_PIPE2)|g' \
-e 's|@''GNULIB_READLINK''@|$(GNULIB_READLINK)|g' \
+ -e 's|@''GNULIB_READLINKAT''@|$(GNULIB_READLINKAT)|g' \
-e 's|@''GNULIB_SLEEP''@|$(GNULIB_SLEEP)|g' \
+ -e 's|@''GNULIB_SYMLINKAT''@|$(GNULIB_SYMLINKAT)|g' \
+ -e 's|@''GNULIB_UNISTD_H_GETOPT''@|$(GNULIB_UNISTD_H_GETOPT)|g' \
-e 's|@''GNULIB_UNISTD_H_SIGPIPE''@|$(GNULIB_UNISTD_H_SIGPIPE)|g' \
+ -e 's|@''GNULIB_UNLINKAT''@|$(GNULIB_UNLINKAT)|g' \
-e 's|@''GNULIB_WRITE''@|$(GNULIB_WRITE)|g' \
-e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \
+ -e 's|@''HAVE_DUP3''@|$(HAVE_DUP3)|g' \
-e 's|@''HAVE_EUIDACCESS''@|$(HAVE_EUIDACCESS)|g' \
+ -e 's|@''HAVE_FACCESSAT''@|$(HAVE_FACCESSAT)|g' \
+ -e 's|@''HAVE_FCHOWNAT''@|$(HAVE_FCHOWNAT)|g' \
-e 's|@''HAVE_FSYNC''@|$(HAVE_FSYNC)|g' \
-e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \
-e 's|@''HAVE_GETDOMAINNAME''@|$(HAVE_GETDOMAINNAME)|g' \
@@ -1600,8 +1703,12 @@ unistd.h: unistd.in.h
-e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \
-e 's|@''HAVE_GETUSERSHELL''@|$(HAVE_GETUSERSHELL)|g' \
-e 's|@''HAVE_LINK''@|$(HAVE_LINK)|g' \
+ -e 's|@''HAVE_PIPE2''@|$(HAVE_PIPE2)|g' \
-e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \
+ -e 's|@''HAVE_READLINKAT''@|$(HAVE_READLINKAT)|g' \
-e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \
+ -e 's|@''HAVE_SYMLINKAT''@|$(HAVE_SYMLINKAT)|g' \
+ -e 's|@''HAVE_UNLINKAT''@|$(HAVE_UNLINKAT)|g' \
-e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \
-e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \
-e 's|@''HAVE_OS_H''@|$(HAVE_OS_H)|g' \
@@ -1610,15 +1717,18 @@ unistd.h: unistd.in.h
-e 's|@''REPLACE_CLOSE''@|$(REPLACE_CLOSE)|g' \
-e 's|@''REPLACE_DUP2''@|$(REPLACE_DUP2)|g' \
-e 's|@''REPLACE_FCHDIR''@|$(REPLACE_FCHDIR)|g' \
+ -e 's|@''REPLACE_FCHOWNAT''@|$(REPLACE_FCHOWNAT)|g' \
-e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \
-e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \
-e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \
+ -e 's|@''REPLACE_LINK''@|$(REPLACE_LINK)|g' \
-e 's|@''REPLACE_LSEEK''@|$(REPLACE_LSEEK)|g' \
-e 's|@''REPLACE_WRITE''@|$(REPLACE_WRITE)|g' \
-e 's|@''UNISTD_H_HAVE_WINSOCK2_H''@|$(UNISTD_H_HAVE_WINSOCK2_H)|g' \
+ -e 's|@''UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS''@|$(UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
< $(srcdir)/unistd.in.h; \
- } > $@-t
+ } > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += unistd.h unistd.h-t
@@ -1684,7 +1794,7 @@ BUILT_SOURCES += $(WCHAR_H)
# We need the following in order to create <wchar.h> when the system
# version does not work standalone.
wchar.h: wchar.in.h
- rm -f $@-t $@
+ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
@@ -1727,7 +1837,7 @@ wchar.h: wchar.in.h
-e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
< $(srcdir)/wchar.in.h; \
- } > $@-t
+ } > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += wchar.h wchar.h-t
@@ -1751,7 +1861,7 @@ BUILT_SOURCES += $(WCTYPE_H)
# We need the following in order to create <wctype.h> when the system
# doesn't have one that works with the given compiler.
wctype.h: wctype.in.h
- rm -f $@-t $@
+ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's/@''HAVE_WCTYPE_H''@/$(HAVE_WCTYPE_H)/g' \
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@@ -1761,7 +1871,7 @@ wctype.h: wctype.in.h
-e 's/@''HAVE_WINT_T''@/$(HAVE_WINT_T)/g' \
-e 's/@''REPLACE_ISWCNTRL''@/$(REPLACE_ISWCNTRL)/g' \
< $(srcdir)/wctype.in.h; \
- } > $@-t
+ } > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += wctype.h wctype.h-t
diff --git a/gnulib/lib/Makefile.in b/gnulib/lib/Makefile.in
index ee83295c..d2329764 100644
--- a/gnulib/lib/Makefile.in
+++ b/gnulib/lib/Makefile.in
@@ -87,6 +87,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/man-bdb.m4 \
$(top_srcdir)/gnulib/m4/fclose.m4 \
$(top_srcdir)/gnulib/m4/fcntl-safer.m4 \
$(top_srcdir)/gnulib/m4/fcntl_h.m4 \
+ $(top_srcdir)/gnulib/m4/fdopendir.m4 \
$(top_srcdir)/gnulib/m4/filenamecat.m4 \
$(top_srcdir)/gnulib/m4/float_h.m4 \
$(top_srcdir)/gnulib/m4/fnmatch.m4 \
@@ -154,6 +155,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/man-bdb.m4 \
$(top_srcdir)/gnulib/m4/progtest.m4 \
$(top_srcdir)/gnulib/m4/rawmemchr.m4 \
$(top_srcdir)/gnulib/m4/readlink.m4 \
+ $(top_srcdir)/gnulib/m4/realloc.m4 \
$(top_srcdir)/gnulib/m4/regex.m4 \
$(top_srcdir)/gnulib/m4/rename.m4 \
$(top_srcdir)/gnulib/m4/same.m4 \
@@ -168,6 +170,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/man-bdb.m4 \
$(top_srcdir)/gnulib/m4/ssize_t.m4 \
$(top_srcdir)/gnulib/m4/stdarg.m4 \
$(top_srcdir)/gnulib/m4/stdbool.m4 \
+ $(top_srcdir)/gnulib/m4/stddef_h.m4 \
$(top_srcdir)/gnulib/m4/stdint.m4 \
$(top_srcdir)/gnulib/m4/stdint_h.m4 \
$(top_srcdir)/gnulib/m4/stdio_h.m4 \
@@ -175,6 +178,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/man-bdb.m4 \
$(top_srcdir)/gnulib/m4/strcase.m4 \
$(top_srcdir)/gnulib/m4/strchrnul.m4 \
$(top_srcdir)/gnulib/m4/strcspn.m4 \
+ $(top_srcdir)/gnulib/m4/strdup.m4 \
$(top_srcdir)/gnulib/m4/strerror.m4 \
$(top_srcdir)/gnulib/m4/string_h.m4 \
$(top_srcdir)/gnulib/m4/strings_h.m4 \
@@ -354,6 +358,7 @@ GLOB_H = @GLOB_H@
GMSGFMT = @GMSGFMT@
GMSGFMT_015 = @GMSGFMT_015@
GNULIB_ACCEPT = @GNULIB_ACCEPT@
+GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@
GNULIB_ALPHASORT = @GNULIB_ALPHASORT@
GNULIB_ATOLL = @GNULIB_ATOLL@
GNULIB_BIND = @GNULIB_BIND@
@@ -365,10 +370,15 @@ GNULIB_CONNECT = @GNULIB_CONNECT@
GNULIB_DIRFD = @GNULIB_DIRFD@
GNULIB_DPRINTF = @GNULIB_DPRINTF@
GNULIB_DUP2 = @GNULIB_DUP2@
+GNULIB_DUP3 = @GNULIB_DUP3@
GNULIB_ENVIRON = @GNULIB_ENVIRON@
GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@
+GNULIB_FACCESSAT = @GNULIB_FACCESSAT@
GNULIB_FCHDIR = @GNULIB_FCHDIR@
+GNULIB_FCHMODAT = @GNULIB_FCHMODAT@
+GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@
GNULIB_FCLOSE = @GNULIB_FCLOSE@
+GNULIB_FDOPENDIR = @GNULIB_FDOPENDIR@
GNULIB_FFLUSH = @GNULIB_FFLUSH@
GNULIB_FOPEN = @GNULIB_FOPEN@
GNULIB_FPRINTF = @GNULIB_FPRINTF@
@@ -379,6 +389,7 @@ GNULIB_FPUTS = @GNULIB_FPUTS@
GNULIB_FREOPEN = @GNULIB_FREOPEN@
GNULIB_FSEEK = @GNULIB_FSEEK@
GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FSTATAT = @GNULIB_FSTATAT@
GNULIB_FSYNC = @GNULIB_FSYNC@
GNULIB_FTELL = @GNULIB_FTELL@
GNULIB_FTELLO = @GNULIB_FTELLO@
@@ -428,12 +439,19 @@ GNULIB_MEMCHR = @GNULIB_MEMCHR@
GNULIB_MEMMEM = @GNULIB_MEMMEM@
GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDIRAT = @GNULIB_MKDIRAT@
GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
+GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@
+GNULIB_MKNODAT = @GNULIB_MKNODAT@
+GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@
GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@
GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@
GNULIB_OPEN = @GNULIB_OPEN@
+GNULIB_OPENAT = @GNULIB_OPENAT@
GNULIB_PERROR = @GNULIB_PERROR@
+GNULIB_PIPE2 = @GNULIB_PIPE2@
+GNULIB_POPEN = @GNULIB_POPEN@
GNULIB_PRINTF = @GNULIB_PRINTF@
GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
GNULIB_PUTC = @GNULIB_PUTC@
@@ -443,9 +461,11 @@ GNULIB_PUTS = @GNULIB_PUTS@
GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_READLINKAT = @GNULIB_READLINKAT@
GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
GNULIB_RECV = @GNULIB_RECV@
GNULIB_RECVFROM = @GNULIB_RECVFROM@
+GNULIB_RENAME = @GNULIB_RENAME@
GNULIB_RPMATCH = @GNULIB_RPMATCH@
GNULIB_SCANDIR = @GNULIB_SCANDIR@
GNULIB_SELECT = @GNULIB_SELECT@
@@ -479,7 +499,10 @@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
GNULIB_STRTOLL = @GNULIB_STRTOLL@
GNULIB_STRTOULL = @GNULIB_STRTOULL@
GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@
+GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@
+GNULIB_UNISTD_H_GETOPT = @GNULIB_UNISTD_H_GETOPT@
GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
+GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
GNULIB_UNSETENV = @GNULIB_UNSETENV@
GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
GNULIB_VDPRINTF = @GNULIB_VDPRINTF@
@@ -496,6 +519,7 @@ GNULIB_WCTOB = @GNULIB_WCTOB@
GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
GNULIB_WRITE = @GNULIB_WRITE@
GREP = @GREP@
+HAVE_ACCEPT4 = @HAVE_ACCEPT4@
HAVE_ALPHASORT = @HAVE_ALPHASORT@
HAVE_ASPRINTF = @HAVE_ASPRINTF@
HAVE_ATOLL = @HAVE_ATOLL@
@@ -524,8 +548,14 @@ HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
HAVE_DPRINTF = @HAVE_DPRINTF@
HAVE_DUP2 = @HAVE_DUP2@
+HAVE_DUP3 = @HAVE_DUP3@
HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
+HAVE_FACCESSAT = @HAVE_FACCESSAT@
+HAVE_FCHMODAT = @HAVE_FCHMODAT@
+HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
+HAVE_FDOPENDIR = @HAVE_FDOPENDIR@
HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FSTATAT = @HAVE_FSTATAT@
HAVE_FSYNC = @HAVE_FSYNC@
HAVE_FTELLO = @HAVE_FTELLO@
HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
@@ -548,14 +578,21 @@ HAVE_MBSINIT = @HAVE_MBSINIT@
HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@
HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@
HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MKDIRAT = @HAVE_MKDIRAT@
HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_MKFIFOAT = @HAVE_MKFIFOAT@
+HAVE_MKNODAT = @HAVE_MKNODAT@
+HAVE_MKOSTEMP = @HAVE_MKOSTEMP@
+HAVE_OPENAT = @HAVE_OPENAT@
HAVE_OS_H = @HAVE_OS_H@
+HAVE_PIPE2 = @HAVE_PIPE2@
HAVE_POSIX_PRINTF = @HAVE_POSIX_PRINTF@
HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@
HAVE_RANDOM_H = @HAVE_RANDOM_H@
HAVE_RANDOM_R = @HAVE_RANDOM_R@
HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
HAVE_READLINK = @HAVE_READLINK@
+HAVE_READLINKAT = @HAVE_READLINKAT@
HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@
HAVE_RPMATCH = @HAVE_RPMATCH@
HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@
@@ -575,7 +612,6 @@ HAVE_STPNCPY = @HAVE_STPNCPY@
HAVE_STRCASECMP = @HAVE_STRCASECMP@
HAVE_STRCASESTR = @HAVE_STRCASESTR@
HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
-HAVE_STRNDUP = @HAVE_STRNDUP@
HAVE_STRPBRK = @HAVE_STRPBRK@
HAVE_STRSEP = @HAVE_STRSEP@
HAVE_STRTOD = @HAVE_STRTOD@
@@ -586,6 +622,7 @@ HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@
HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@
HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
+HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
HAVE_SYSEXITS_H = @HAVE_SYSEXITS_H@
HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
HAVE_SYS_CDEFS_H = @HAVE_SYS_CDEFS_H@
@@ -598,12 +635,14 @@ HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@
HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNLINKAT = @HAVE_UNLINKAT@
HAVE_UNSETENV = @HAVE_UNSETENV@
HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
HAVE_VASPRINTF = @HAVE_VASPRINTF@
HAVE_VDPRINTF = @HAVE_VDPRINTF@
HAVE_VISIBILITY = @HAVE_VISIBILITY@
HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WCHAR_T = @HAVE_WCHAR_T@
HAVE_WCRTOMB = @HAVE_WCRTOMB@
HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@
HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@
@@ -667,6 +706,7 @@ NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@
NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@
NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H = @NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H@
NEXT_AS_FIRST_DIRECTIVE_STDARG_H = @NEXT_AS_FIRST_DIRECTIVE_STDARG_H@
+NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@
NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@
NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@
@@ -686,6 +726,7 @@ NEXT_FCNTL_H = @NEXT_FCNTL_H@
NEXT_FLOAT_H = @NEXT_FLOAT_H@
NEXT_SIGNAL_H = @NEXT_SIGNAL_H@
NEXT_STDARG_H = @NEXT_STDARG_H@
+NEXT_STDDEF_H = @NEXT_STDDEF_H@
NEXT_STDINT_H = @NEXT_STDINT_H@
NEXT_STDIO_H = @NEXT_STDIO_H@
NEXT_STDLIB_H = @NEXT_STDLIB_H@
@@ -720,6 +761,7 @@ REPLACE_CLOSE = @REPLACE_CLOSE@
REPLACE_DPRINTF = @REPLACE_DPRINTF@
REPLACE_DUP2 = @REPLACE_DUP2@
REPLACE_FCHDIR = @REPLACE_FCHDIR@
+REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
REPLACE_FCLOSE = @REPLACE_FCLOSE@
REPLACE_FFLUSH = @REPLACE_FFLUSH@
REPLACE_FOPEN = @REPLACE_FOPEN@
@@ -728,6 +770,7 @@ REPLACE_FPURGE = @REPLACE_FPURGE@
REPLACE_FREOPEN = @REPLACE_FREOPEN@
REPLACE_FSEEK = @REPLACE_FSEEK@
REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FSTATAT = @REPLACE_FSTATAT@
REPLACE_FTELL = @REPLACE_FTELL@
REPLACE_FTELLO = @REPLACE_FTELLO@
REPLACE_GETCWD = @REPLACE_GETCWD@
@@ -736,6 +779,7 @@ REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LINK = @REPLACE_LINK@
REPLACE_LSEEK = @REPLACE_LSEEK@
REPLACE_LSTAT = @REPLACE_LSTAT@
REPLACE_MBRLEN = @REPLACE_MBRLEN@
@@ -748,11 +792,14 @@ REPLACE_MEMCHR = @REPLACE_MEMCHR@
REPLACE_MEMMEM = @REPLACE_MEMMEM@
REPLACE_MKDIR = @REPLACE_MKDIR@
REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_NULL = @REPLACE_NULL@
REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
REPLACE_OPEN = @REPLACE_OPEN@
REPLACE_PERROR = @REPLACE_PERROR@
+REPLACE_POPEN = @REPLACE_POPEN@
REPLACE_PRINTF = @REPLACE_PRINTF@
REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_RENAME = @REPLACE_RENAME@
REPLACE_SELECT = @REPLACE_SELECT@
REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
REPLACE_SPRINTF = @REPLACE_SPRINTF@
@@ -760,9 +807,11 @@ REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
REPLACE_STRDUP = @REPLACE_STRDUP@
REPLACE_STRERROR = @REPLACE_STRERROR@
+REPLACE_STRNDUP = @REPLACE_STRNDUP@
REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
REPLACE_STRSTR = @REPLACE_STRSTR@
REPLACE_STRTOD = @REPLACE_STRTOD@
+REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
REPLACE_VDPRINTF = @REPLACE_VDPRINTF@
REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
@@ -781,12 +830,12 @@ SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@
SIZE_T_SUFFIX = @SIZE_T_SUFFIX@
STDARG_H = @STDARG_H@
STDBOOL_H = @STDBOOL_H@
+STDDEF_H = @STDDEF_H@
STDINT_H = @STDINT_H@
STRIP = @STRIP@
SYSEXITS_H = @SYSEXITS_H@
SYS_SELECT_H = @SYS_SELECT_H@
SYS_SOCKET_H = @SYS_SOCKET_H@
-SYS_STAT_H = @SYS_STAT_H@
SYS_TIME_H = @SYS_TIME_H@
TRANS_APROPOS = @TRANS_APROPOS@
TRANS_APROPOS_UPPER = @TRANS_APROPOS_UPPER@
@@ -806,7 +855,9 @@ TRANS_WHATIS = @TRANS_WHATIS@
TRANS_WHATIS_UPPER = @TRANS_WHATIS_UPPER@
TRANS_ZSOELIM = @TRANS_ZSOELIM@
TRANS_ZSOELIM_UPPER = @TRANS_ZSOELIM_UPPER@
+UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
+UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
@@ -921,9 +972,10 @@ EXTRA_DIST = alignof.h alloca.c alloca.in.h areadlink.h atexit.c \
basename.c dirname.c dirname.h stripslash.c dup2.c errno.in.h \
error.c error.h exitfail.c exitfail.h fchdir.c fclose.c \
fcntl.in.h creat-safer.c fcntl--.h fcntl-safer.h open-safer.c \
- file-set.h filenamecat.c filenamecat.h float.in.h fnmatch.c \
- fnmatch.in.h fnmatch_loop.c getcwd.c getlogin_r.c getopt.c \
- getopt.in.h getopt1.c getopt_int.h getpagesize.c \
+ fdopendir.c openat-priv.h openat-proc.c file-set.h \
+ filenamecat.c filenamecat.h float.in.h fnmatch.c fnmatch.in.h \
+ fnmatch_loop.c getcwd.c getlogin_r.c getopt.c getopt.in.h \
+ getopt1.c getopt_int.h getpagesize.c \
$(top_srcdir)/tools/config.rpath gettimeofday.c glob-libc.h \
glob.c glob.in.h hash.c hash.h hash-triple.h \
$(top_srcdir)/tools/config.rpath intprops.h lchown.c \
@@ -933,14 +985,15 @@ EXTRA_DIST = alignof.h alloca.c alloca.in.h areadlink.h atexit.c \
mbsrtowcs.c memchr.c memchr.valgrind memcmp.c mempcpy.c \
memrchr.c mkdtemp.c mkstemp.c open.c at-func.c fchmodat.c \
fchownat.c fstatat.c mkdirat.c openat-priv.h openat-proc.c \
- openat.c openat.h pathmax.h rawmemchr.c rawmemchr.valgrind \
- readlink.c regcomp.c regex.c regex.h regex_internal.c \
- regex_internal.h regexec.c rename.c same.c same.h same-inode.h \
- save-cwd.c save-cwd.h setenv.c sig-handler.h sigaction.c \
- signal.in.h sigprocmask.c sleep.c snprintf.c stdarg.in.h \
- stdbool.in.h stdint.in.h stdio-write.c stdio.in.h stdlib.in.h \
+ openat.c openat.h fcntl--.h fcntl-safer.h openat-safer.c \
+ pathmax.h rawmemchr.c rawmemchr.valgrind readlink.c realloc.c \
+ regcomp.c regex.c regex.h regex_internal.c regex_internal.h \
+ regexec.c rename.c same.c same.h same-inode.h save-cwd.c \
+ save-cwd.h setenv.c sig-handler.h sigaction.c signal.in.h \
+ sigprocmask.c sleep.c snprintf.c stdarg.in.h stdbool.in.h \
+ stddef.in.h stdint.in.h stdio-write.c stdio.in.h stdlib.in.h \
strcasecmp.c strncasecmp.c strchrnul.c strchrnul.valgrind \
- strcspn.c streq.h strerror.c string.in.h strings.in.h \
+ strcspn.c strdup.c streq.h strerror.c string.in.h strings.in.h \
strndup.c strnlen.c strsep.c siglist.h strsignal.c \
sys_select.in.h sys_socket.in.h sys_stat.in.h sys_time.in.h \
sysexits.in.h tempname.c tempname.h \
@@ -952,21 +1005,21 @@ EXTRA_DIST = alignof.h alloca.c alloca.in.h areadlink.h atexit.c \
wctype.in.h xalloc.h xmalloc.c xgetcwd.c xgetcwd.h xalloc.h
BUILT_SOURCES = $(ALLOCA_H) configmake.h $(DIRENT_H) $(ERRNO_H) \
$(FCNTL_H) $(FLOAT_H) $(FNMATCH_H) $(GETOPT_H) $(GLOB_H) \
- signal.h $(STDARG_H) $(STDBOOL_H) $(STDINT_H) stdio.h stdlib.h \
- string.h strings.h $(SYS_SELECT_H) $(SYS_SOCKET_H) \
- $(SYS_STAT_H) $(SYS_TIME_H) $(SYSEXITS_H) unistd.h $(WCHAR_H) \
- $(WCTYPE_H)
+ signal.h $(STDARG_H) $(STDBOOL_H) $(STDDEF_H) $(STDINT_H) \
+ stdio.h stdlib.h string.h strings.h $(SYS_SELECT_H) \
+ $(SYS_SOCKET_H) sys/stat.h $(SYS_TIME_H) $(SYSEXITS_H) \
+ unistd.h $(WCHAR_H) $(WCTYPE_H)
SUFFIXES = .sed .sin
MOSTLYCLEANFILES = core *.stackdump alloca.h alloca.h-t dirent.h \
dirent.h-t errno.h errno.h-t fcntl.h fcntl.h-t float.h \
float.h-t fnmatch.h fnmatch.h-t getopt.h getopt.h-t glob.h \
glob.h-t signal.h signal.h-t stdarg.h stdarg.h-t stdbool.h \
- stdbool.h-t stdint.h stdint.h-t stdio.h stdio.h-t stdlib.h \
- stdlib.h-t string.h string.h-t strings.h strings.h-t \
- sys/select.h sys/select.h-t sys/socket.h sys/socket.h-t \
- sys/stat.h sys/stat.h-t sys/time.h sys/time.h-t sysexits.h \
- sysexits.h-t unistd.h unistd.h-t wchar.h wchar.h-t wctype.h \
- wctype.h-t
+ stdbool.h-t stddef.h stddef.h-t stdint.h stdint.h-t stdio.h \
+ stdio.h-t stdlib.h stdlib.h-t string.h string.h-t strings.h \
+ strings.h-t sys/select.h sys/select.h-t sys/socket.h \
+ sys/socket.h-t sys/stat.h sys/stat.h-t sys/time.h sys/time.h-t \
+ sysexits.h sysexits.h-t unistd.h unistd.h-t wchar.h wchar.h-t \
+ wctype.h wctype.h-t
MOSTLYCLEANDIRS = sys sys sys
CLEANFILES = configmake.h configmake.h-t charset.alias ref-add.sed \
ref-del.sed
@@ -1000,20 +1053,21 @@ EXTRA_libgnu_a_SOURCES = alloca.c atexit.c btowc.c canonicalize.c \
canonicalize-lgpl.c chdir-long.c chown.c fchown-stub.c close.c \
dirfd.c basename.c dirname.c stripslash.c dup2.c error.c \
exitfail.c fchdir.c fclose.c creat-safer.c open-safer.c \
- filenamecat.c fnmatch.c fnmatch_loop.c getcwd.c getlogin_r.c \
- getopt.c getopt1.c getpagesize.c gettimeofday.c glob.c hash.c \
- lchown.c lstat.c malloc.c malloc.c mbrtowc.c mbsinit.c \
- mbsrtowcs-state.c mbsrtowcs.c memchr.c memcmp.c mempcpy.c \
- memrchr.c mkdtemp.c mkstemp.c open.c at-func.c fchmodat.c \
- fchownat.c fstatat.c mkdirat.c openat-proc.c openat.c \
- rawmemchr.c readlink.c regcomp.c regex.c regex_internal.c \
+ fdopendir.c openat-proc.c filenamecat.c fnmatch.c \
+ fnmatch_loop.c getcwd.c getlogin_r.c getopt.c getopt1.c \
+ getpagesize.c gettimeofday.c glob.c hash.c lchown.c lstat.c \
+ malloc.c malloc.c mbrtowc.c mbsinit.c mbsrtowcs-state.c \
+ mbsrtowcs.c memchr.c memcmp.c mempcpy.c memrchr.c mkdtemp.c \
+ mkstemp.c open.c at-func.c fchmodat.c fchownat.c fstatat.c \
+ mkdirat.c openat-proc.c openat.c openat-safer.c rawmemchr.c \
+ readlink.c realloc.c regcomp.c regex.c regex_internal.c \
regexec.c rename.c same.c save-cwd.c setenv.c sigaction.c \
sigprocmask.c sleep.c snprintf.c stdio-write.c strcasecmp.c \
- strncasecmp.c strchrnul.c strcspn.c strerror.c strndup.c \
- strnlen.c strsep.c strsignal.c tempname.c dup-safer.c \
- fd-safer.c pipe-safer.c unsetenv.c asnprintf.c printf-args.c \
- printf-parse.c vasnprintf.c asprintf.c vasprintf.c vsnprintf.c \
- wcrtomb.c xmalloc.c xgetcwd.c
+ strncasecmp.c strchrnul.c strcspn.c strdup.c strerror.c \
+ strndup.c strnlen.c strsep.c strsignal.c tempname.c \
+ dup-safer.c fd-safer.c pipe-safer.c unsetenv.c asnprintf.c \
+ printf-args.c printf-parse.c vasnprintf.c asprintf.c \
+ vasprintf.c vsnprintf.c wcrtomb.c xmalloc.c xgetcwd.c
LINK_WARNING_H = $(top_srcdir)/tools/link-warning.h
charset_alias = $(DESTDIR)$(libdir)/charset.alias
charset_tmp = $(DESTDIR)$(libdir)/charset.tmp
@@ -1128,6 +1182,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchownat.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fclose.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fd-safer.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdopendir.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file-set.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filenamecat.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fnmatch.Po@am__quote@
@@ -1163,12 +1218,14 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openat-die.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openat-proc.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openat-safer.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openat.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pipe-safer.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printf-args.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printf-parse.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rawmemchr.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readlink.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/realloc.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regcomp.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regex.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regex_internal.Po@am__quote@
@@ -1185,6 +1242,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strcasecmp.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strchrnul.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strcspn.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strdup.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strerror.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stripslash.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strncasecmp.Po@am__quote@
@@ -1553,9 +1611,10 @@ uninstall-am: uninstall-local
# We need the following in order to create <alloca.h> when the system
# doesn't have one that works with the given compiler.
alloca.h: alloca.in.h
+ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
cat $(srcdir)/alloca.in.h; \
- } > $@-t
+ } > $@-t && \
mv -f $@-t $@
# Retrieve values of the variables through 'configure' followed by
@@ -1576,7 +1635,7 @@ alloca.h: alloca.in.h
# The Automake-defined pkg* macros are appended, in the order
# listed in the Automake 1.10a+ documentation.
configmake.h: Makefile
- rm -f $@-t
+ $(AM_V_GEN)rm -f $@-t && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
echo '#define PREFIX "$(prefix)"'; \
echo '#define EXEC_PREFIX "$(exec_prefix)"'; \
@@ -1605,7 +1664,7 @@ configmake.h: Makefile
echo '#define PKGINCLUDEDIR "$(pkgincludedir)"'; \
echo '#define PKGLIBDIR "$(pkglibdir)"'; \
echo '#define PKGLIBEXECDIR "$(pkglibexecdir)"'; \
- } | sed '/""/d' > $@-t
+ } | sed '/""/d' > $@-t && \
if test -f $@ && cmp $@-t $@ > /dev/null; then \
rm -f $@-t; \
else \
@@ -1615,27 +1674,29 @@ configmake.h: Makefile
# We need the following in order to create <dirent.h> when the system
# doesn't have one that works with the given compiler.
dirent.h: dirent.in.h
- rm -f $@-t $@
+ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''NEXT_DIRENT_H''@|$(NEXT_DIRENT_H)|g' \
-e 's|@''GNULIB_DIRFD''@|$(GNULIB_DIRFD)|g' \
+ -e 's|@''GNULIB_FDOPENDIR''@|$(GNULIB_FDOPENDIR)|g' \
-e 's|@''GNULIB_SCANDIR''@|$(GNULIB_SCANDIR)|g' \
-e 's|@''GNULIB_ALPHASORT''@|$(GNULIB_ALPHASORT)|g' \
-e 's|@''HAVE_DECL_DIRFD''@|$(HAVE_DECL_DIRFD)|g' \
+ -e 's|@''HAVE_FDOPENDIR''@|$(HAVE_FDOPENDIR)|g' \
-e 's|@''HAVE_SCANDIR''@|$(HAVE_SCANDIR)|g' \
-e 's|@''HAVE_ALPHASORT''@|$(HAVE_ALPHASORT)|g' \
-e 's|@''REPLACE_FCHDIR''@|$(REPLACE_FCHDIR)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
< $(srcdir)/dirent.in.h; \
- } > $@-t
+ } > $@-t && \
mv $@-t $@
# We need the following in order to create <errno.h> when the system
# doesn't have one that is POSIX compliant.
errno.h: errno.in.h
- rm -f $@-t $@
+ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
@@ -1647,58 +1708,64 @@ errno.h: errno.in.h
-e 's|@''EOVERFLOW_HIDDEN''@|$(EOVERFLOW_HIDDEN)|g' \
-e 's|@''EOVERFLOW_VALUE''@|$(EOVERFLOW_VALUE)|g' \
< $(srcdir)/errno.in.h; \
- } > $@-t
+ } > $@-t && \
mv $@-t $@
# We need the following in order to create <fcntl.h> when the system
# doesn't have one that works with the given compiler.
fcntl.h: fcntl.in.h
- rm -f $@-t $@
+ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''NEXT_FCNTL_H''@|$(NEXT_FCNTL_H)|g' \
-e 's|@''GNULIB_OPEN''@|$(GNULIB_OPEN)|g' \
+ -e 's|@''GNULIB_OPENAT''@|$(GNULIB_OPENAT)|g' \
-e 's|@''REPLACE_OPEN''@|$(REPLACE_OPEN)|g' \
+ -e 's|@''HAVE_OPENAT''@|$(HAVE_OPENAT)|g' \
+ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
< $(srcdir)/fcntl.in.h; \
- } > $@-t
+ } > $@-t && \
mv $@-t $@
# We need the following in order to create <float.h> when the system
# doesn't have one that works with the given compiler.
float.h: float.in.h
- rm -f $@-t $@
+ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''NEXT_FLOAT_H''@|$(NEXT_FLOAT_H)|g' \
< $(srcdir)/float.in.h; \
- } > $@-t
+ } > $@-t && \
mv $@-t $@
# We need the following in order to create <fnmatch.h> when the system
# doesn't have one that supports the required API.
fnmatch.h: fnmatch.in.h
+ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
cat $(srcdir)/fnmatch.in.h; \
- } > $@-t
+ } > $@-t && \
mv -f $@-t $@
# We need the following in order to create <getopt.h> when the system
# doesn't have one that works with the given compiler.
getopt.h: getopt.in.h
+ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
cat $(srcdir)/getopt.in.h; \
- } > $@-t
+ } > $@-t && \
mv -f $@-t $@
# We need the following in order to create <glob.h> when the system
# doesn't have one that works with the given compiler.
glob.h: glob.in.h
+ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''HAVE_SYS_CDEFS_H''@|$(HAVE_SYS_CDEFS_H)|g' \
< $(srcdir)/glob.in.h; \
- } > $@-t
+ } > $@-t && \
mv -f $@-t $@
# We need the following in order to install a simple file in $(libdir)
@@ -1752,18 +1819,18 @@ uninstall-localcharset: all-local
fi
charset.alias: config.charset
- rm -f t-$@ $@
- $(SHELL) $(srcdir)/config.charset '$(host)' > t-$@
+ $(AM_V_GEN)rm -f t-$@ $@ && \
+ $(SHELL) $(srcdir)/config.charset '$(host)' > t-$@ && \
mv t-$@ $@
.sin.sed:
- rm -f t-$@ $@
- sed -e '/^#/d' -e 's/@''PACKAGE''@/$(PACKAGE)/g' $< > t-$@
+ $(AM_V_GEN)rm -f t-$@ $@ && \
+ sed -e '/^#/d' -e 's/@''PACKAGE''@/$(PACKAGE)/g' $< > t-$@ && \
mv t-$@ $@
# We need the following in order to create <signal.h> when the system
# doesn't have a complete one.
signal.h: signal.in.h
- rm -f $@-t $@
+ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
@@ -1779,34 +1846,48 @@ signal.h: signal.in.h
-e 's|@''HAVE_TYPE_VOLATILE_SIG_ATOMIC_T''@|$(HAVE_TYPE_VOLATILE_SIG_ATOMIC_T)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
< $(srcdir)/signal.in.h; \
- } > $@-t
+ } > $@-t && \
mv $@-t $@
# We need the following in order to create <stdarg.h> when the system
# doesn't have one that works with the given compiler.
stdarg.h: stdarg.in.h
- rm -f $@-t $@
+ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''NEXT_STDARG_H''@|$(NEXT_STDARG_H)|g' \
< $(srcdir)/stdarg.in.h; \
- } > $@-t
+ } > $@-t && \
mv $@-t $@
# We need the following in order to create <stdbool.h> when the system
# doesn't have one that works.
stdbool.h: stdbool.in.h
- rm -f $@-t $@
+ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool.in.h; \
- } > $@-t
+ } > $@-t && \
+ mv $@-t $@
+
+# We need the following in order to create <stddef.h> when the system
+# doesn't have one that works with the given compiler.
+stddef.h: stddef.in.h
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''NEXT_STDDEF_H''@|$(NEXT_STDDEF_H)|g' \
+ -e 's|@''HAVE_WCHAR_T''@|$(HAVE_WCHAR_T)|g' \
+ -e 's|@''REPLACE_NULL''@|$(REPLACE_NULL)|g' \
+ < $(srcdir)/stddef.in.h; \
+ } > $@-t && \
mv $@-t $@
# We need the following in order to create <stdint.h> when the system
# doesn't have one that works with the given compiler.
stdint.h: stdint.in.h
- rm -f $@-t $@
+ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@@ -1833,95 +1914,99 @@ stdint.h: stdint.in.h
-e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \
-e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \
< $(srcdir)/stdint.in.h; \
- } > $@-t
+ } > $@-t && \
mv $@-t $@
# We need the following in order to create <stdio.h> when the system
# doesn't have one that works with the given compiler.
stdio.h: stdio.in.h
- rm -f $@-t $@
+ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''NEXT_STDIO_H''@|$(NEXT_STDIO_H)|g' \
- -e 's|@''GNULIB_FPRINTF''@|$(GNULIB_FPRINTF)|g' \
- -e 's|@''GNULIB_FPRINTF_POSIX''@|$(GNULIB_FPRINTF_POSIX)|g' \
- -e 's|@''GNULIB_PRINTF''@|$(GNULIB_PRINTF)|g' \
- -e 's|@''GNULIB_PRINTF_POSIX''@|$(GNULIB_PRINTF_POSIX)|g' \
- -e 's|@''GNULIB_SNPRINTF''@|$(GNULIB_SNPRINTF)|g' \
- -e 's|@''GNULIB_SPRINTF_POSIX''@|$(GNULIB_SPRINTF_POSIX)|g' \
- -e 's|@''GNULIB_VFPRINTF''@|$(GNULIB_VFPRINTF)|g' \
- -e 's|@''GNULIB_VFPRINTF_POSIX''@|$(GNULIB_VFPRINTF_POSIX)|g' \
- -e 's|@''GNULIB_VPRINTF''@|$(GNULIB_VPRINTF)|g' \
- -e 's|@''GNULIB_VPRINTF_POSIX''@|$(GNULIB_VPRINTF_POSIX)|g' \
- -e 's|@''GNULIB_VSNPRINTF''@|$(GNULIB_VSNPRINTF)|g' \
- -e 's|@''GNULIB_VSPRINTF_POSIX''@|$(GNULIB_VSPRINTF_POSIX)|g' \
-e 's|@''GNULIB_DPRINTF''@|$(GNULIB_DPRINTF)|g' \
- -e 's|@''GNULIB_VDPRINTF''@|$(GNULIB_VDPRINTF)|g' \
- -e 's|@''GNULIB_VASPRINTF''@|$(GNULIB_VASPRINTF)|g' \
- -e 's|@''GNULIB_OBSTACK_PRINTF''@|$(GNULIB_OBSTACK_PRINTF)|g' \
- -e 's|@''GNULIB_OBSTACK_PRINTF_POSIX''@|$(GNULIB_OBSTACK_PRINTF_POSIX)|g' \
+ -e 's|@''GNULIB_FCLOSE''@|$(GNULIB_FCLOSE)|g' \
+ -e 's|@''GNULIB_FFLUSH''@|$(GNULIB_FFLUSH)|g' \
-e 's|@''GNULIB_FOPEN''@|$(GNULIB_FOPEN)|g' \
+ -e 's|@''GNULIB_FPRINTF''@|$(GNULIB_FPRINTF)|g' \
+ -e 's|@''GNULIB_FPRINTF_POSIX''@|$(GNULIB_FPRINTF_POSIX)|g' \
+ -e 's|@''GNULIB_FPURGE''@|$(GNULIB_FPURGE)|g' \
+ -e 's|@''GNULIB_FPUTC''@|$(GNULIB_FPUTC)|g' \
+ -e 's|@''GNULIB_FPUTS''@|$(GNULIB_FPUTS)|g' \
-e 's|@''GNULIB_FREOPEN''@|$(GNULIB_FREOPEN)|g' \
-e 's|@''GNULIB_FSEEK''@|$(GNULIB_FSEEK)|g' \
-e 's|@''GNULIB_FSEEKO''@|$(GNULIB_FSEEKO)|g' \
-e 's|@''GNULIB_FTELL''@|$(GNULIB_FTELL)|g' \
-e 's|@''GNULIB_FTELLO''@|$(GNULIB_FTELLO)|g' \
- -e 's|@''GNULIB_FFLUSH''@|$(GNULIB_FFLUSH)|g' \
- -e 's|@''GNULIB_FPURGE''@|$(GNULIB_FPURGE)|g' \
- -e 's|@''GNULIB_FCLOSE''@|$(GNULIB_FCLOSE)|g' \
- -e 's|@''GNULIB_FPUTC''@|$(GNULIB_FPUTC)|g' \
- -e 's|@''GNULIB_PUTC''@|$(GNULIB_PUTC)|g' \
- -e 's|@''GNULIB_PUTCHAR''@|$(GNULIB_PUTCHAR)|g' \
- -e 's|@''GNULIB_FPUTS''@|$(GNULIB_FPUTS)|g' \
- -e 's|@''GNULIB_PUTS''@|$(GNULIB_PUTS)|g' \
-e 's|@''GNULIB_FWRITE''@|$(GNULIB_FWRITE)|g' \
-e 's|@''GNULIB_GETDELIM''@|$(GNULIB_GETDELIM)|g' \
-e 's|@''GNULIB_GETLINE''@|$(GNULIB_GETLINE)|g' \
+ -e 's|@''GNULIB_OBSTACK_PRINTF''@|$(GNULIB_OBSTACK_PRINTF)|g' \
+ -e 's|@''GNULIB_OBSTACK_PRINTF_POSIX''@|$(GNULIB_OBSTACK_PRINTF_POSIX)|g' \
-e 's|@''GNULIB_PERROR''@|$(GNULIB_PERROR)|g' \
+ -e 's|@''GNULIB_POPEN''@|$(GNULIB_POPEN)|g' \
+ -e 's|@''GNULIB_PRINTF''@|$(GNULIB_PRINTF)|g' \
+ -e 's|@''GNULIB_PRINTF_POSIX''@|$(GNULIB_PRINTF_POSIX)|g' \
+ -e 's|@''GNULIB_PUTC''@|$(GNULIB_PUTC)|g' \
+ -e 's|@''GNULIB_PUTCHAR''@|$(GNULIB_PUTCHAR)|g' \
+ -e 's|@''GNULIB_PUTS''@|$(GNULIB_PUTS)|g' \
+ -e 's|@''GNULIB_RENAME''@|$(GNULIB_RENAME)|g' \
+ -e 's|@''GNULIB_SNPRINTF''@|$(GNULIB_SNPRINTF)|g' \
+ -e 's|@''GNULIB_SPRINTF_POSIX''@|$(GNULIB_SPRINTF_POSIX)|g' \
-e 's|@''GNULIB_STDIO_H_SIGPIPE''@|$(GNULIB_STDIO_H_SIGPIPE)|g' \
- -e 's|@''REPLACE_STDIO_WRITE_FUNCS''@|$(REPLACE_STDIO_WRITE_FUNCS)|g' \
- -e 's|@''REPLACE_FPRINTF''@|$(REPLACE_FPRINTF)|g' \
- -e 's|@''REPLACE_VFPRINTF''@|$(REPLACE_VFPRINTF)|g' \
- -e 's|@''REPLACE_PRINTF''@|$(REPLACE_PRINTF)|g' \
- -e 's|@''REPLACE_VPRINTF''@|$(REPLACE_VPRINTF)|g' \
- -e 's|@''REPLACE_SNPRINTF''@|$(REPLACE_SNPRINTF)|g' \
+ -e 's|@''GNULIB_VASPRINTF''@|$(GNULIB_VASPRINTF)|g' \
+ -e 's|@''GNULIB_VDPRINTF''@|$(GNULIB_VDPRINTF)|g' \
+ -e 's|@''GNULIB_VFPRINTF''@|$(GNULIB_VFPRINTF)|g' \
+ -e 's|@''GNULIB_VFPRINTF_POSIX''@|$(GNULIB_VFPRINTF_POSIX)|g' \
+ -e 's|@''GNULIB_VPRINTF''@|$(GNULIB_VPRINTF)|g' \
+ -e 's|@''GNULIB_VPRINTF_POSIX''@|$(GNULIB_VPRINTF_POSIX)|g' \
+ -e 's|@''GNULIB_VSNPRINTF''@|$(GNULIB_VSNPRINTF)|g' \
+ -e 's|@''GNULIB_VSPRINTF_POSIX''@|$(GNULIB_VSPRINTF_POSIX)|g' \
+ -e 's|@''HAVE_DECL_FPURGE''@|$(HAVE_DECL_FPURGE)|g' \
+ -e 's|@''HAVE_DECL_GETDELIM''@|$(HAVE_DECL_GETDELIM)|g' \
+ -e 's|@''HAVE_DECL_GETLINE''@|$(HAVE_DECL_GETLINE)|g' \
+ -e 's|@''HAVE_DECL_OBSTACK_PRINTF''@|$(HAVE_DECL_OBSTACK_PRINTF)|g' \
-e 's|@''HAVE_DECL_SNPRINTF''@|$(HAVE_DECL_SNPRINTF)|g' \
- -e 's|@''REPLACE_VSNPRINTF''@|$(REPLACE_VSNPRINTF)|g' \
-e 's|@''HAVE_DECL_VSNPRINTF''@|$(HAVE_DECL_VSNPRINTF)|g' \
- -e 's|@''REPLACE_SPRINTF''@|$(REPLACE_SPRINTF)|g' \
- -e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \
-e 's|@''HAVE_DPRINTF''@|$(HAVE_DPRINTF)|g' \
- -e 's|@''REPLACE_DPRINTF''@|$(REPLACE_DPRINTF)|g' \
- -e 's|@''HAVE_VDPRINTF''@|$(HAVE_VDPRINTF)|g' \
- -e 's|@''REPLACE_VDPRINTF''@|$(REPLACE_VDPRINTF)|g' \
-e 's|@''HAVE_VASPRINTF''@|$(HAVE_VASPRINTF)|g' \
- -e 's|@''REPLACE_VASPRINTF''@|$(REPLACE_VASPRINTF)|g' \
- -e 's|@''HAVE_DECL_OBSTACK_PRINTF''@|$(HAVE_DECL_OBSTACK_PRINTF)|g' \
- -e 's|@''REPLACE_OBSTACK_PRINTF''@|$(REPLACE_OBSTACK_PRINTF)|g' \
+ -e 's|@''HAVE_VDPRINTF''@|$(HAVE_VDPRINTF)|g' \
+ -e 's|@''REPLACE_DPRINTF''@|$(REPLACE_DPRINTF)|g' \
+ -e 's|@''REPLACE_FCLOSE''@|$(REPLACE_FCLOSE)|g' \
+ -e 's|@''REPLACE_FFLUSH''@|$(REPLACE_FFLUSH)|g' \
-e 's|@''REPLACE_FOPEN''@|$(REPLACE_FOPEN)|g' \
+ -e 's|@''REPLACE_FPRINTF''@|$(REPLACE_FPRINTF)|g' \
+ -e 's|@''REPLACE_FPURGE''@|$(REPLACE_FPURGE)|g' \
-e 's|@''REPLACE_FREOPEN''@|$(REPLACE_FREOPEN)|g' \
- -e 's|@''REPLACE_FSEEKO''@|$(REPLACE_FSEEKO)|g' \
-e 's|@''REPLACE_FSEEK''@|$(REPLACE_FSEEK)|g' \
- -e 's|@''REPLACE_FTELLO''@|$(REPLACE_FTELLO)|g' \
+ -e 's|@''REPLACE_FSEEKO''@|$(REPLACE_FSEEKO)|g' \
-e 's|@''REPLACE_FTELL''@|$(REPLACE_FTELL)|g' \
- -e 's|@''REPLACE_FFLUSH''@|$(REPLACE_FFLUSH)|g' \
- -e 's|@''REPLACE_FPURGE''@|$(REPLACE_FPURGE)|g' \
- -e 's|@''HAVE_DECL_FPURGE''@|$(HAVE_DECL_FPURGE)|g' \
- -e 's|@''REPLACE_FCLOSE''@|$(REPLACE_FCLOSE)|g' \
- -e 's|@''HAVE_DECL_GETDELIM''@|$(HAVE_DECL_GETDELIM)|g' \
- -e 's|@''HAVE_DECL_GETLINE''@|$(HAVE_DECL_GETLINE)|g' \
+ -e 's|@''REPLACE_FTELLO''@|$(REPLACE_FTELLO)|g' \
-e 's|@''REPLACE_GETLINE''@|$(REPLACE_GETLINE)|g' \
+ -e 's|@''REPLACE_OBSTACK_PRINTF''@|$(REPLACE_OBSTACK_PRINTF)|g' \
-e 's|@''REPLACE_PERROR''@|$(REPLACE_PERROR)|g' \
+ -e 's|@''REPLACE_POPEN''@|$(REPLACE_POPEN)|g' \
+ -e 's|@''REPLACE_PRINTF''@|$(REPLACE_PRINTF)|g' \
+ -e 's|@''REPLACE_RENAME''@|$(REPLACE_RENAME)|g' \
+ -e 's|@''REPLACE_SNPRINTF''@|$(REPLACE_SNPRINTF)|g' \
+ -e 's|@''REPLACE_SPRINTF''@|$(REPLACE_SPRINTF)|g' \
+ -e 's|@''REPLACE_STDIO_WRITE_FUNCS''@|$(REPLACE_STDIO_WRITE_FUNCS)|g' \
+ -e 's|@''REPLACE_VASPRINTF''@|$(REPLACE_VASPRINTF)|g' \
+ -e 's|@''REPLACE_VDPRINTF''@|$(REPLACE_VDPRINTF)|g' \
+ -e 's|@''REPLACE_VFPRINTF''@|$(REPLACE_VFPRINTF)|g' \
+ -e 's|@''REPLACE_VPRINTF''@|$(REPLACE_VPRINTF)|g' \
+ -e 's|@''REPLACE_VSNPRINTF''@|$(REPLACE_VSNPRINTF)|g' \
+ -e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
< $(srcdir)/stdio.in.h; \
- } > $@-t
+ } > $@-t && \
mv $@-t $@
# We need the following in order to create <stdlib.h> when the system
# doesn't have one that works with the given compiler.
stdlib.h: stdlib.in.h
- rm -f $@-t $@
+ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
@@ -1934,6 +2019,7 @@ stdlib.h: stdlib.in.h
-e 's|@''GNULIB_GETLOADAVG''@|$(GNULIB_GETLOADAVG)|g' \
-e 's|@''GNULIB_GETSUBOPT''@|$(GNULIB_GETSUBOPT)|g' \
-e 's|@''GNULIB_MKDTEMP''@|$(GNULIB_MKDTEMP)|g' \
+ -e 's|@''GNULIB_MKOSTEMP''@|$(GNULIB_MKOSTEMP)|g' \
-e 's|@''GNULIB_MKSTEMP''@|$(GNULIB_MKSTEMP)|g' \
-e 's|@''GNULIB_PUTENV''@|$(GNULIB_PUTENV)|g' \
-e 's|@''GNULIB_RANDOM_R''@|$(GNULIB_RANDOM_R)|g' \
@@ -1948,6 +2034,7 @@ stdlib.h: stdlib.in.h
-e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \
-e 's|@''HAVE_MALLOC_POSIX''@|$(HAVE_MALLOC_POSIX)|g' \
-e 's|@''HAVE_MKDTEMP''@|$(HAVE_MKDTEMP)|g' \
+ -e 's|@''HAVE_MKOSTEMP''@|$(HAVE_MKOSTEMP)|g' \
-e 's|@''HAVE_REALLOC_POSIX''@|$(HAVE_REALLOC_POSIX)|g' \
-e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \
-e 's|@''HAVE_RPMATCH''@|$(HAVE_RPMATCH)|g' \
@@ -1965,13 +2052,13 @@ stdlib.h: stdlib.in.h
-e 's|@''VOID_UNSETENV''@|$(VOID_UNSETENV)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
< $(srcdir)/stdlib.in.h; \
- } > $@-t
+ } > $@-t && \
mv $@-t $@
# We need the following in order to create <string.h> when the system
# doesn't have one that works with the given compiler.
string.h: string.in.h
- rm -f $@-t $@
+ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
@@ -2017,7 +2104,6 @@ string.h: string.in.h
-e 's|@''HAVE_STPNCPY''@|$(HAVE_STPNCPY)|g' \
-e 's|@''HAVE_STRCHRNUL''@|$(HAVE_STRCHRNUL)|g' \
-e 's|@''HAVE_DECL_STRDUP''@|$(HAVE_DECL_STRDUP)|g' \
- -e 's|@''HAVE_STRNDUP''@|$(HAVE_STRNDUP)|g' \
-e 's|@''HAVE_DECL_STRNDUP''@|$(HAVE_DECL_STRNDUP)|g' \
-e 's|@''HAVE_DECL_STRNLEN''@|$(HAVE_DECL_STRNLEN)|g' \
-e 's|@''HAVE_STRPBRK''@|$(HAVE_STRPBRK)|g' \
@@ -2033,16 +2119,19 @@ string.h: string.in.h
-e 's|@''REPLACE_STRDUP''@|$(REPLACE_STRDUP)|g' \
-e 's|@''REPLACE_STRSTR''@|$(REPLACE_STRSTR)|g' \
-e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \
+ -e 's|@''REPLACE_STRNDUP''@|$(REPLACE_STRNDUP)|g' \
-e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \
+ -e 's|@''REPLACE_STRTOK_R''@|$(REPLACE_STRTOK_R)|g' \
+ -e 's|@''UNDEFINE_STRTOK_R''@|$(UNDEFINE_STRTOK_R)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
< $(srcdir)/string.in.h; \
- } > $@-t
+ } > $@-t && \
mv $@-t $@
# We need the following in order to create <strings.h> when the system
# doesn't have one that works with the given compiler.
strings.h: strings.in.h
- rm -f $@-t $@
+ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
@@ -2051,14 +2140,14 @@ strings.h: strings.in.h
-e 's|@''HAVE_DECL_STRNCASECMP''@|$(HAVE_DECL_STRNCASECMP)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
< $(srcdir)/strings.in.h; \
- } > $@-t
+ } > $@-t && \
mv $@-t $@
# We need the following in order to create <sys/select.h> when the system
# doesn't have one that works with the given compiler.
sys/select.h: sys_select.in.h
- @MKDIR_P@ sys
- rm -f $@-t $@
+ $(AM_V_at)$(MKDIR_P) sys
+ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
@@ -2069,13 +2158,14 @@ sys/select.h: sys_select.in.h
-e 's|@''REPLACE_SELECT''@|$(REPLACE_SELECT)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
< $(srcdir)/sys_select.in.h; \
- } > $@-t
+ } > $@-t && \
mv $@-t $@
# We need the following in order to create <sys/socket.h> when the system
# doesn't have one that works with the given compiler.
sys/socket.h: sys_socket.in.h
- @MKDIR_P@ sys
+ $(AM_V_at)$(MKDIR_P) sys
+ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
@@ -2096,40 +2186,54 @@ sys/socket.h: sys_socket.in.h
-e 's|@''GNULIB_SENDTO''@|$(GNULIB_SENDTO)|g' \
-e 's|@''GNULIB_SETSOCKOPT''@|$(GNULIB_SETSOCKOPT)|g' \
-e 's|@''GNULIB_SHUTDOWN''@|$(GNULIB_SHUTDOWN)|g' \
+ -e 's|@''GNULIB_ACCEPT4''@|$(GNULIB_ACCEPT4)|g' \
-e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \
-e 's|@''HAVE_WS2TCPIP_H''@|$(HAVE_WS2TCPIP_H)|g' \
-e 's|@''HAVE_STRUCT_SOCKADDR_STORAGE''@|$(HAVE_STRUCT_SOCKADDR_STORAGE)|g' \
-e 's|@''HAVE_SA_FAMILY_T''@|$(HAVE_SA_FAMILY_T)|g' \
+ -e 's|@''HAVE_ACCEPT4''@|$(HAVE_ACCEPT4)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
< $(srcdir)/sys_socket.in.h; \
- } > $@-t
+ } > $@-t && \
mv -f $@-t $@
# We need the following in order to create <sys/stat.h> when the system
# has one that is incomplete.
sys/stat.h: sys_stat.in.h
- @MKDIR_P@ sys
- rm -f $@-t $@
+ $(AM_V_at)$(MKDIR_P) sys
+ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''NEXT_SYS_STAT_H''@|$(NEXT_SYS_STAT_H)|g' \
+ -e 's|@''GNULIB_FCHMODAT''@|$(GNULIB_FCHMODAT)|g' \
+ -e 's|@''GNULIB_FSTATAT''@|$(GNULIB_FSTATAT)|g' \
-e 's|@''GNULIB_LCHMOD''@|$(GNULIB_LCHMOD)|g' \
-e 's|@''GNULIB_LSTAT''@|$(GNULIB_LSTAT)|g' \
+ -e 's|@''GNULIB_MKDIRAT''@|$(GNULIB_MKDIRAT)|g' \
+ -e 's|@''GNULIB_MKFIFOAT''@|$(GNULIB_MKFIFOAT)|g' \
+ -e 's|@''GNULIB_MKNODAT''@|$(GNULIB_MKNODAT)|g' \
+ -e 's|@''HAVE_FCHMODAT''@|$(HAVE_FCHMODAT)|g' \
+ -e 's|@''HAVE_FSTATAT''@|$(HAVE_FSTATAT)|g' \
-e 's|@''HAVE_LCHMOD''@|$(HAVE_LCHMOD)|g' \
-e 's|@''HAVE_LSTAT''@|$(HAVE_LSTAT)|g' \
+ -e 's|@''HAVE_MKDIRAT''@|$(HAVE_MKDIRAT)|g' \
+ -e 's|@''HAVE_MKFIFOAT''@|$(HAVE_MKFIFOAT)|g' \
+ -e 's|@''HAVE_MKNODAT''@|$(HAVE_MKNODAT)|g' \
+ -e 's|@''REPLACE_FCHDIR''@|$(REPLACE_FCHDIR)|g' \
+ -e 's|@''REPLACE_FSTATAT''@|$(REPLACE_FSTATAT)|g' \
-e 's|@''REPLACE_LSTAT''@|$(REPLACE_LSTAT)|g' \
-e 's|@''REPLACE_MKDIR''@|$(REPLACE_MKDIR)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
< $(srcdir)/sys_stat.in.h; \
- } > $@-t
+ } > $@-t && \
mv $@-t $@
# We need the following in order to create <sys/time.h> when the system
# doesn't have one that works with the given compiler.
sys/time.h: sys_time.in.h
- @MKDIR_P@ sys
- rm -f $@-t $@
+ $(AM_V_at)$(MKDIR_P) sys
+ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's/@''HAVE_SYS_TIME_H''@/$(HAVE_SYS_TIME_H)/g' \
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@@ -2138,25 +2242,26 @@ sys/time.h: sys_time.in.h
-e 's/@''REPLACE_GETTIMEOFDAY''@/$(REPLACE_GETTIMEOFDAY)/g' \
-e 's/@''HAVE_STRUCT_TIMEVAL''@/$(HAVE_STRUCT_TIMEVAL)/g' \
< $(srcdir)/sys_time.in.h; \
- } > $@-t
+ } > $@-t && \
mv $@-t $@
# We need the following in order to create <sysexits.h> when the system
# doesn't have one that works with the given compiler.
sysexits.h: sysexits.in.h
+ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''HAVE_SYSEXITS_H''@|$(HAVE_SYSEXITS_H)|g' \
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''NEXT_SYSEXITS_H''@|$(NEXT_SYSEXITS_H)|g' \
< $(srcdir)/sysexits.in.h; \
- } > $@-t
+ } > $@-t && \
mv -f $@-t $@
# We need the following in order to create an empty placeholder for
# <unistd.h> when the system doesn't have one.
unistd.h: unistd.in.h
- rm -f $@-t $@
+ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@@ -2165,9 +2270,12 @@ unistd.h: unistd.in.h
-e 's|@''GNULIB_CHOWN''@|$(GNULIB_CHOWN)|g' \
-e 's|@''GNULIB_CLOSE''@|$(GNULIB_CLOSE)|g' \
-e 's|@''GNULIB_DUP2''@|$(GNULIB_DUP2)|g' \
+ -e 's|@''GNULIB_DUP3''@|$(GNULIB_DUP3)|g' \
-e 's|@''GNULIB_ENVIRON''@|$(GNULIB_ENVIRON)|g' \
-e 's|@''GNULIB_EUIDACCESS''@|$(GNULIB_EUIDACCESS)|g' \
+ -e 's|@''GNULIB_FACCESSAT''@|$(GNULIB_FACCESSAT)|g' \
-e 's|@''GNULIB_FCHDIR''@|$(GNULIB_FCHDIR)|g' \
+ -e 's|@''GNULIB_FCHOWNAT''@|$(GNULIB_FCHOWNAT)|g' \
-e 's|@''GNULIB_FSYNC''@|$(GNULIB_FSYNC)|g' \
-e 's|@''GNULIB_FTRUNCATE''@|$(GNULIB_FTRUNCATE)|g' \
-e 's|@''GNULIB_GETCWD''@|$(GNULIB_GETCWD)|g' \
@@ -2180,12 +2288,20 @@ unistd.h: unistd.in.h
-e 's|@''GNULIB_LCHOWN''@|$(GNULIB_LCHOWN)|g' \
-e 's|@''GNULIB_LINK''@|$(GNULIB_LINK)|g' \
-e 's|@''GNULIB_LSEEK''@|$(GNULIB_LSEEK)|g' \
+ -e 's|@''GNULIB_PIPE2''@|$(GNULIB_PIPE2)|g' \
-e 's|@''GNULIB_READLINK''@|$(GNULIB_READLINK)|g' \
+ -e 's|@''GNULIB_READLINKAT''@|$(GNULIB_READLINKAT)|g' \
-e 's|@''GNULIB_SLEEP''@|$(GNULIB_SLEEP)|g' \
+ -e 's|@''GNULIB_SYMLINKAT''@|$(GNULIB_SYMLINKAT)|g' \
+ -e 's|@''GNULIB_UNISTD_H_GETOPT''@|$(GNULIB_UNISTD_H_GETOPT)|g' \
-e 's|@''GNULIB_UNISTD_H_SIGPIPE''@|$(GNULIB_UNISTD_H_SIGPIPE)|g' \
+ -e 's|@''GNULIB_UNLINKAT''@|$(GNULIB_UNLINKAT)|g' \
-e 's|@''GNULIB_WRITE''@|$(GNULIB_WRITE)|g' \
-e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \
+ -e 's|@''HAVE_DUP3''@|$(HAVE_DUP3)|g' \
-e 's|@''HAVE_EUIDACCESS''@|$(HAVE_EUIDACCESS)|g' \
+ -e 's|@''HAVE_FACCESSAT''@|$(HAVE_FACCESSAT)|g' \
+ -e 's|@''HAVE_FCHOWNAT''@|$(HAVE_FCHOWNAT)|g' \
-e 's|@''HAVE_FSYNC''@|$(HAVE_FSYNC)|g' \
-e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \
-e 's|@''HAVE_GETDOMAINNAME''@|$(HAVE_GETDOMAINNAME)|g' \
@@ -2194,8 +2310,12 @@ unistd.h: unistd.in.h
-e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \
-e 's|@''HAVE_GETUSERSHELL''@|$(HAVE_GETUSERSHELL)|g' \
-e 's|@''HAVE_LINK''@|$(HAVE_LINK)|g' \
+ -e 's|@''HAVE_PIPE2''@|$(HAVE_PIPE2)|g' \
-e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \
+ -e 's|@''HAVE_READLINKAT''@|$(HAVE_READLINKAT)|g' \
-e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \
+ -e 's|@''HAVE_SYMLINKAT''@|$(HAVE_SYMLINKAT)|g' \
+ -e 's|@''HAVE_UNLINKAT''@|$(HAVE_UNLINKAT)|g' \
-e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \
-e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \
-e 's|@''HAVE_OS_H''@|$(HAVE_OS_H)|g' \
@@ -2204,21 +2324,24 @@ unistd.h: unistd.in.h
-e 's|@''REPLACE_CLOSE''@|$(REPLACE_CLOSE)|g' \
-e 's|@''REPLACE_DUP2''@|$(REPLACE_DUP2)|g' \
-e 's|@''REPLACE_FCHDIR''@|$(REPLACE_FCHDIR)|g' \
+ -e 's|@''REPLACE_FCHOWNAT''@|$(REPLACE_FCHOWNAT)|g' \
-e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \
-e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \
-e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \
+ -e 's|@''REPLACE_LINK''@|$(REPLACE_LINK)|g' \
-e 's|@''REPLACE_LSEEK''@|$(REPLACE_LSEEK)|g' \
-e 's|@''REPLACE_WRITE''@|$(REPLACE_WRITE)|g' \
-e 's|@''UNISTD_H_HAVE_WINSOCK2_H''@|$(UNISTD_H_HAVE_WINSOCK2_H)|g' \
+ -e 's|@''UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS''@|$(UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
< $(srcdir)/unistd.in.h; \
- } > $@-t
+ } > $@-t && \
mv $@-t $@
# We need the following in order to create <wchar.h> when the system
# version does not work standalone.
wchar.h: wchar.in.h
- rm -f $@-t $@
+ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
@@ -2261,13 +2384,13 @@ wchar.h: wchar.in.h
-e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
< $(srcdir)/wchar.in.h; \
- } > $@-t
+ } > $@-t && \
mv $@-t $@
# We need the following in order to create <wctype.h> when the system
# doesn't have one that works with the given compiler.
wctype.h: wctype.in.h
- rm -f $@-t $@
+ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's/@''HAVE_WCTYPE_H''@/$(HAVE_WCTYPE_H)/g' \
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@@ -2277,7 +2400,7 @@ wctype.h: wctype.in.h
-e 's/@''HAVE_WINT_T''@/$(HAVE_WINT_T)/g' \
-e 's/@''REPLACE_ISWCNTRL''@/$(REPLACE_ISWCNTRL)/g' \
< $(srcdir)/wctype.in.h; \
- } > $@-t
+ } > $@-t && \
mv $@-t $@
mostlyclean-local: mostlyclean-generic
diff --git a/gnulib/lib/argp-ba.c b/gnulib/lib/argp-ba.c
index 3e8bb962..5da64e6f 100644
--- a/gnulib/lib/argp-ba.c
+++ b/gnulib/lib/argp-ba.c
@@ -1,5 +1,5 @@
/* Default definition for ARGP_PROGRAM_BUG_ADDRESS.
- Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1999, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
@@ -21,4 +21,14 @@
the ARGP_HELP_BUG_ADDR flag is set (as it is by various standard help
messages), embedded in a sentence that says something like `Report bugs to
ADDR.'. */
-const char *argp_program_bug_address;
+const char *argp_program_bug_address
+/* This variable should be zero-initialized. On most systems, putting it into
+ BSS is sufficient. Not so on MacOS X 10.3 and 10.4, see
+ <http://lists.gnu.org/archive/html/bug-gnulib/2009-01/msg00329.html>
+ <http://lists.gnu.org/archive/html/bug-gnulib/2009-08/msg00096.html>. */
+#if defined __ELF__
+ /* On ELF systems, variables in BSS behave well. */
+#else
+ = (const char *) 0
+#endif
+ ;
diff --git a/gnulib/lib/argp-pv.c b/gnulib/lib/argp-pv.c
index 411f6ede..8add4b02 100644
--- a/gnulib/lib/argp-pv.c
+++ b/gnulib/lib/argp-pv.c
@@ -1,5 +1,5 @@
/* Default definition for ARGP_PROGRAM_VERSION.
- Copyright (C) 1996, 1997, 1999, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1999, 2006, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
@@ -20,4 +20,14 @@
--version is added (unless the ARGP_NO_HELP flag is used), which will
print this string followed by a newline and exit (unless the
ARGP_NO_EXIT flag is used). Overridden by ARGP_PROGRAM_VERSION_HOOK. */
-const char *argp_program_version;
+const char *argp_program_version
+/* This variable should be zero-initialized. On most systems, putting it into
+ BSS is sufficient. Not so on MacOS X 10.3 and 10.4, see
+ <http://lists.gnu.org/archive/html/bug-gnulib/2009-01/msg00329.html>
+ <http://lists.gnu.org/archive/html/bug-gnulib/2009-08/msg00096.html>. */
+#if defined __ELF__
+ /* On ELF systems, variables in BSS behave well. */
+#else
+ = (const char *) 0
+#endif
+ ;
diff --git a/gnulib/lib/at-func.c b/gnulib/lib/at-func.c
index c7963fe3..3188770c 100644
--- a/gnulib/lib/at-func.c
+++ b/gnulib/lib/at-func.c
@@ -1,5 +1,5 @@
/* Define an at-style functions like fstatat, unlinkat, fchownat, etc.
- Copyright (C) 2006 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -16,35 +16,58 @@
/* written by Jim Meyering */
-#define CALL_FUNC(F) \
- (AT_FUNC_USE_F1_COND \
+#ifdef AT_FUNC_USE_F1_COND
+# define CALL_FUNC(F) \
+ (flag == AT_FUNC_USE_F1_COND \
? AT_FUNC_F1 (F AT_FUNC_POST_FILE_ARGS) \
: AT_FUNC_F2 (F AT_FUNC_POST_FILE_ARGS))
+# define VALIDATE_FLAG(F) \
+ if (flag & ~AT_FUNC_USE_F1_COND) \
+ { \
+ errno = EINVAL; \
+ return -1; \
+ }
+#else
+# define CALL_FUNC(F) (AT_FUNC_F1 (F AT_FUNC_POST_FILE_ARGS))
+# define VALIDATE_FLAG(F) /* empty */
+#endif
+
+#ifdef AT_FUNC_RESULT
+# define FUNC_RESULT AT_FUNC_RESULT
+#else
+# define FUNC_RESULT int
+#endif
-/* Call AT_FUNC_F1 or AT_FUNC_F2 (testing AT_FUNC_USE_F1_COND to
- determine which) to operate on FILE, which is in the directory
- open on descriptor FD. If possible, do it without changing the
+/* Call AT_FUNC_F1 to operate on FILE, which is in the directory
+ open on descriptor FD. If AT_FUNC_USE_F1_COND is defined to a value,
+ AT_FUNC_POST_FILE_PARAM_DECLS must inlude a parameter named flag;
+ call AT_FUNC_F2 if FLAG is 0 or fail if FLAG contains more bits than
+ AT_FUNC_USE_F1_COND. If possible, do it without changing the
working directory. Otherwise, resort to using save_cwd/fchdir,
then AT_FUNC_F?/restore_cwd. If either the save_cwd or the restore_cwd
fails, then give a diagnostic and exit nonzero. */
-int
+FUNC_RESULT
AT_FUNC_NAME (int fd, char const *file AT_FUNC_POST_FILE_PARAM_DECLS)
{
+ /* Be careful to choose names unlikely to conflict with
+ AT_FUNC_POST_FILE_PARAM_DECLS. */
struct saved_cwd saved_cwd;
int saved_errno;
- int err;
+ FUNC_RESULT err;
+
+ VALIDATE_FLAG (flag);
if (fd == AT_FDCWD || IS_ABSOLUTE_FILE_NAME (file))
return CALL_FUNC (file);
{
- char buf[OPENAT_BUFFER_SIZE];
- char *proc_file = openat_proc_name (buf, fd, file);
+ char proc_buf[OPENAT_BUFFER_SIZE];
+ char *proc_file = openat_proc_name (proc_buf, fd, file);
if (proc_file)
{
- int proc_result = CALL_FUNC (proc_file);
+ FUNC_RESULT proc_result = CALL_FUNC (proc_file);
int proc_errno = errno;
- if (proc_file != buf)
+ if (proc_file != proc_buf)
free (proc_file);
/* If the syscall succeeds, or if it fails with an unexpected
errno value, then return right away. Otherwise, fall through
@@ -83,3 +106,4 @@ AT_FUNC_NAME (int fd, char const *file AT_FUNC_POST_FILE_PARAM_DECLS)
return err;
}
#undef CALL_FUNC
+#undef FUNC_RESULT
diff --git a/gnulib/lib/canonicalize-lgpl.c b/gnulib/lib/canonicalize-lgpl.c
index 3aaa310e..6b5663a3 100644
--- a/gnulib/lib/canonicalize-lgpl.c
+++ b/gnulib/lib/canonicalize-lgpl.c
@@ -1,5 +1,5 @@
/* Return the canonical absolute name of a given file.
- Copyright (C) 1996-2003, 2005-2008 Free Software Foundation, Inc.
+ Copyright (C) 1996-2003, 2005-2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
This program is free software: you can redistribute it and/or modify
@@ -50,9 +50,6 @@
#include <errno.h>
#ifndef _LIBC
# define __set_errno(e) errno = (e)
-# ifndef ENAMETOOLONG
-# define ENAMETOOLONG EINVAL
-# endif
#endif
#ifdef _LIBC
diff --git a/gnulib/lib/canonicalize.c b/gnulib/lib/canonicalize.c
index 4f348398..523e0820 100644
--- a/gnulib/lib/canonicalize.c
+++ b/gnulib/lib/canonicalize.c
@@ -1,5 +1,5 @@
/* Return the canonical absolute name of a given file.
- Copyright (C) 1996-2008 Free Software Foundation, Inc.
+ Copyright (C) 1996-2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -38,9 +38,6 @@
#include "xalloc.h"
#include "xgetcwd.h"
-#ifndef ELOOP
-# define ELOOP 0
-#endif
#ifndef __set_errno
# define __set_errno(Val) errno = (Val)
#endif
@@ -199,7 +196,7 @@ canonicalize_filename_mode (const char *name, canonicalize_mode_t can_mode)
dest = rname + 1;
}
- for (start = end = name; *start; start = end)
+ for (start = name; *start; start = end)
{
/* Skip sequence of multiple file name separators. */
while (*start == '/')
diff --git a/gnulib/lib/chdir-long.c b/gnulib/lib/chdir-long.c
index 291b58c2..ba47d599 100644
--- a/gnulib/lib/chdir-long.c
+++ b/gnulib/lib/chdir-long.c
@@ -1,5 +1,5 @@
/* provide a chdir function that tries not to fail due to ENAMETOOLONG
- Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+ Copyright (C) 2004-2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -20,7 +20,6 @@
#include "chdir-long.h"
-#include <fcntl.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
@@ -28,7 +27,7 @@
#include <stdio.h>
#include <assert.h>
-#include "openat.h"
+#include "fcntl--.h"
#ifndef PATH_MAX
# error "compile this file only if your system defines PATH_MAX"
diff --git a/gnulib/lib/chown.c b/gnulib/lib/chown.c
index 3582b04d..b851cbc4 100644
--- a/gnulib/lib/chown.c
+++ b/gnulib/lib/chown.c
@@ -1,7 +1,7 @@
/* provide consistent interface to chown for systems that don't interpret
an ID of -1 as meaning `don't change the corresponding ID'.
- Copyright (C) 1997, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2004-2007, 2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -46,7 +46,8 @@
int
rpl_chown (const char *file, uid_t uid, gid_t gid)
{
-#if CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE
+#if HAVE_CHOWN
+# if CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE
if (gid == (gid_t) -1 || uid == (uid_t) -1)
{
struct stat file_stats;
@@ -61,9 +62,9 @@ rpl_chown (const char *file, uid_t uid, gid_t gid)
if (uid == (uid_t) -1)
uid = file_stats.st_uid;
}
-#endif
+# endif
-#if CHOWN_MODIFIES_SYMLINK
+# if CHOWN_MODIFIES_SYMLINK
{
/* Handle the case in which the system-supplied chown function
does *not* follow symlinks. Instead, it changes permissions
@@ -97,7 +98,12 @@ rpl_chown (const char *file, uid_t uid, gid_t gid)
else if (errno != EACCES)
return -1;
}
-#endif
+# endif
return chown (file, uid, gid);
+
+#else /* !HAVE_CHOWN */
+ errno = ENOSYS;
+ return -1;
+#endif
}
diff --git a/gnulib/lib/close.c b/gnulib/lib/close.c
index 0e56dcb2..5278f24b 100644
--- a/gnulib/lib/close.c
+++ b/gnulib/lib/close.c
@@ -33,7 +33,7 @@ rpl_close (int fd)
int retval = close (fd);
#endif
-#ifdef FCHDIR_REPLACEMENT
+#if REPLACE_FCHDIR
if (retval >= 0)
_gl_unregister_fd (fd);
#endif
diff --git a/gnulib/lib/dirent.in.h b/gnulib/lib/dirent.in.h
index 15f0245b..89307656 100644
--- a/gnulib/lib/dirent.in.h
+++ b/gnulib/lib/dirent.in.h
@@ -58,6 +58,23 @@ extern int dirfd (DIR const *dir);
dirfd (d))
#endif
+#if @GNULIB_FDOPENDIR@
+# if !@HAVE_FDOPENDIR@
+/* Open a directory stream visiting the given directory file
+ descriptor. Return NULL and set errno if fd is not visiting a
+ directory. On success, this function consumes fd (it will be
+ implicitly closed either by this function or by a subsequent
+ closedir). */
+extern DIR *fdopendir (int fd);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef fdopendir
+# define fdopendir(f) \
+ (GL_LINK_WARNING ("fdopendir is unportable - " \
+ "use gnulib module fdopendir for portability"), \
+ fdopendir (f))
+#endif
+
#if @GNULIB_SCANDIR@
/* Scan the directory DIR, calling FILTER on each directory entry.
Entries for which FILTER returns nonzero are individually malloc'd,
diff --git a/gnulib/lib/dup-safer.c b/gnulib/lib/dup-safer.c
index 7d9b2be3..22b96bab 100644
--- a/gnulib/lib/dup-safer.c
+++ b/gnulib/lib/dup-safer.c
@@ -32,7 +32,7 @@
int
dup_safer (int fd)
{
-#if defined F_DUPFD && !defined FCHDIR_REPLACEMENT
+#if defined F_DUPFD && !REPLACE_FCHDIR
return fcntl (fd, F_DUPFD, STDERR_FILENO + 1);
#else
/* fd_safer calls us back, but eventually the recursion unwinds and
diff --git a/gnulib/lib/dup2.c b/gnulib/lib/dup2.c
index 6d618293..140af1b9 100644
--- a/gnulib/lib/dup2.c
+++ b/gnulib/lib/dup2.c
@@ -55,8 +55,25 @@ rpl_dup2 (int fd, int desired_fd)
}
# endif
result = dup2 (fd, desired_fd);
+# ifdef __linux__
+ /* Correct a Linux return value.
+ <http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.30.y.git;a=commitdiff;h=2b79bc4f7ebbd5af3c8b867968f9f15602d5f802>
+ */
+ if (fd == desired_fd && result == (unsigned int) -EBADF)
+ {
+ errno = EBADF;
+ result = -1;
+ }
+# endif
if (result == 0)
result = desired_fd;
+ /* Correct a cygwin 1.5.x errno value. */
+ else if (result == -1 && errno == EMFILE)
+ errno = EBADF;
+#if REPLACE_FCHDIR
+ if (fd != desired_fd && result == desired_fd)
+ result = _gl_register_dup (fd, desired_fd);
+#endif
return result;
}
@@ -85,13 +102,19 @@ dupfd (int fd, int desired_fd)
int
dup2 (int fd, int desired_fd)
{
+ int result;
if (fd == desired_fd)
- return fd;
+ return fcntl (fd, F_GETFL) < 0 ? -1 : fd;
close (desired_fd);
# ifdef F_DUPFD
- return fcntl (fd, F_DUPFD, desired_fd);
+ result = fcntl (fd, F_DUPFD, desired_fd);
# else
- return dupfd (fd, desired_fd);
+ result = dupfd (fd, desired_fd);
# endif
+#if REPLACE_FCHDIR
+ if (0 <= result)
+ result = _gl_register_dup (fd, desired_fd);
+#endif
+ return result;
}
#endif /* !REPLACE_DUP2 */
diff --git a/gnulib/lib/fchdir.c b/gnulib/lib/fchdir.c
index d51d9630..f3556291 100644
--- a/gnulib/lib/fchdir.c
+++ b/gnulib/lib/fchdir.c
@@ -19,10 +19,11 @@
/* Specification. */
#include <unistd.h>
+#include <assert.h>
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
-#include <stdarg.h>
+#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
@@ -30,80 +31,161 @@
#include "canonicalize.h"
+#ifndef REPLACE_OPEN_DIRECTORY
+# define REPLACE_OPEN_DIRECTORY 0
+#endif
+
/* This replacement assumes that a directory is not renamed while opened
- through a file descriptor. */
+ through a file descriptor.
+
+ FIXME: On mingw, this would be possible to enforce if we were to
+ also open a HANDLE to each directory currently visited by a file
+ descriptor, since mingw refuses to rename any in-use file system
+ object. */
/* Array of file descriptors opened. If it points to a directory, it stores
- info about this directory; otherwise it stores an errno value of ENOTDIR. */
+ info about this directory. */
typedef struct
{
char *name; /* Absolute name of the directory, or NULL. */
- int saved_errno; /* If name == NULL: The error code describing the failure
- reason. */
+ /* FIXME - add a DIR* member to make dirfd possible on mingw? */
} dir_info_t;
static dir_info_t *dirs;
static size_t dirs_allocated;
-/* Try to ensure dirs has enough room for a slot at index fd. */
-static void
+/* Try to ensure dirs has enough room for a slot at index fd. Return
+ false and set errno to ENOMEM on allocation failure. */
+static bool
ensure_dirs_slot (size_t fd)
{
if (fd >= dirs_allocated)
{
size_t new_allocated;
dir_info_t *new_dirs;
- size_t i;
new_allocated = 2 * dirs_allocated + 1;
if (new_allocated <= fd)
new_allocated = fd + 1;
new_dirs =
(dirs != NULL
- ? (dir_info_t *) realloc (dirs, new_allocated * sizeof (dir_info_t))
- : (dir_info_t *) malloc (new_allocated * sizeof (dir_info_t)));
- if (new_dirs != NULL)
- {
- for (i = dirs_allocated; i < new_allocated; i++)
- {
- new_dirs[i].name = NULL;
- new_dirs[i].saved_errno = ENOTDIR;
- }
- dirs = new_dirs;
- dirs_allocated = new_allocated;
- }
+ ? (dir_info_t *) realloc (dirs, new_allocated * sizeof *dirs)
+ : (dir_info_t *) malloc (new_allocated * sizeof *dirs));
+ if (new_dirs == NULL)
+ return false;
+ memset (new_dirs + dirs_allocated, 0,
+ (new_allocated - dirs_allocated) * sizeof *dirs);
+ dirs = new_dirs;
+ dirs_allocated = new_allocated;
}
+ return true;
}
/* Hook into the gnulib replacements for open() and close() to keep track
of the open file descriptors. */
+/* Close FD, cleaning up any fd to name mapping if fd was visiting a
+ directory. */
void
_gl_unregister_fd (int fd)
{
if (fd >= 0 && fd < dirs_allocated)
{
- if (dirs[fd].name != NULL)
- free (dirs[fd].name);
+ free (dirs[fd].name);
dirs[fd].name = NULL;
- dirs[fd].saved_errno = ENOTDIR;
}
}
-void
+/* Mark FD as visiting FILENAME. FD must be non-negative, and refer
+ to an open file descriptor. If REPLACE_OPEN_DIRECTORY is non-zero,
+ this should only be called if FD is visiting a directory. Close FD
+ and return -1 if there is insufficient memory to track the
+ directory name; otherwise return FD. */
+int
_gl_register_fd (int fd, const char *filename)
{
struct stat statbuf;
- ensure_dirs_slot (fd);
- if (fd < dirs_allocated
- && fstat (fd, &statbuf) >= 0 && S_ISDIR (statbuf.st_mode))
+ assert (0 <= fd);
+ if (REPLACE_OPEN_DIRECTORY
+ || (fstat (fd, &statbuf) == 0 && S_ISDIR (statbuf.st_mode)))
{
- dirs[fd].name = canonicalize_file_name (filename);
- if (dirs[fd].name == NULL)
- dirs[fd].saved_errno = errno;
+ if (!ensure_dirs_slot (fd)
+ || (dirs[fd].name = canonicalize_file_name (filename)) == NULL)
+ {
+ int saved_errno = errno;
+ close (fd);
+ errno = saved_errno;
+ return -1;
+ }
}
+ return fd;
+}
+
+/* Mark NEWFD as a duplicate of OLDFD; useful from dup, dup2, dup3,
+ and fcntl. Both arguments must be valid and distinct file
+ descriptors. Close NEWFD and return -1 if OLDFD is tracking a
+ directory, but there is insufficient memory to track the same
+ directory in NEWFD; otherwise return NEWFD.
+
+ FIXME: Need to implement rpl_fcntl in gnulib, and have it call
+ this. */
+int
+_gl_register_dup (int oldfd, int newfd)
+{
+ assert (0 <= oldfd && 0 <= newfd && oldfd != newfd);
+ if (oldfd < dirs_allocated && dirs[oldfd].name)
+ {
+ /* Duplicated a directory; must ensure newfd is allocated. */
+ if (!ensure_dirs_slot (newfd)
+ || (dirs[newfd].name = strdup (dirs[oldfd].name)) == NULL)
+ {
+ int saved_errno = errno;
+ close (newfd);
+ errno = saved_errno;
+ newfd = -1;
+ }
+ }
+ else if (newfd < dirs_allocated)
+ {
+ /* Duplicated a non-directory; ensure newfd is cleared. */
+ free (dirs[newfd].name);
+ dirs[newfd].name = NULL;
+ }
+ return newfd;
+}
+
+/* If FD is currently visiting a directory, then return the name of
+ that directory. Otherwise, return NULL and set errno. */
+const char *
+_gl_directory_name (int fd)
+{
+ if (0 <= fd && fd < dirs_allocated && dirs[fd].name != NULL)
+ return dirs[fd].name;
+ /* At this point, fd is either invalid, or open but not a directory.
+ If dup2 fails, errno is correctly EBADF. */
+ if (0 <= fd)
+ {
+ if (dup2 (fd, fd) == fd)
+ errno = ENOTDIR;
+ }
+ else
+ errno = EBADF;
+ return NULL;
}
+/* Return stat information about FD in STATBUF. Needed when
+ rpl_open() used a dummy file to work around an open() that can't
+ normally visit directories. */
+#if REPLACE_OPEN_DIRECTORY
+int
+rpl_fstat (int fd, struct stat *statbuf)
+{
+ if (0 <= fd && fd < dirs_allocated && dirs[fd].name != NULL)
+ return stat (dirs[fd].name, statbuf);
+ return fstat (fd, statbuf);
+}
+#endif
+
/* Override opendir() and closedir(), to keep track of the open file
descriptors. Needed because there is a function dirfd(). */
@@ -129,13 +211,18 @@ rpl_opendir (const char *filename)
if (dp != NULL)
{
int fd = dirfd (dp);
- if (fd >= 0)
- _gl_register_fd (fd, filename);
+ if (0 <= fd && _gl_register_fd (fd, filename) != fd)
+ {
+ int saved_errno = errno;
+ closedir (dp);
+ errno = saved_errno;
+ return NULL;
+ }
}
return dp;
}
-/* Override dup() and dup2(), to keep track of open file descriptors. */
+/* Override dup(), to keep track of open file descriptors. */
int
rpl_dup (int oldfd)
@@ -143,102 +230,17 @@ rpl_dup (int oldfd)
{
int newfd = dup (oldfd);
- if (oldfd >= 0 && newfd >= 0)
- {
- ensure_dirs_slot (newfd);
- if (newfd < dirs_allocated)
- {
- if (oldfd < dirs_allocated)
- {
- if (dirs[oldfd].name != NULL)
- {
- dirs[newfd].name = strdup (dirs[oldfd].name);
- if (dirs[newfd].name == NULL)
- dirs[newfd].saved_errno = ENOMEM;
- }
- else
- {
- dirs[newfd].name = NULL;
- dirs[newfd].saved_errno = dirs[oldfd].saved_errno;
- }
- }
- else
- {
- dirs[newfd].name = NULL;
- dirs[newfd].saved_errno = ENOMEM;
- }
- }
- }
+ if (0 <= newfd)
+ newfd = _gl_register_dup (oldfd, newfd);
return newfd;
}
-/* Our <unistd.h> replacement overrides dup2 twice; be sure to pick
- the one we want. */
-#if REPLACE_DUP2
-# undef dup2
-# define dup2 rpl_dup2
-#endif
-
-int
-rpl_dup2_fchdir (int oldfd, int newfd)
-{
- int retval = dup2 (oldfd, newfd);
-
- if (retval >= 0 && newfd != oldfd)
- {
- ensure_dirs_slot (newfd);
- if (newfd < dirs_allocated)
- {
- if (oldfd < dirs_allocated)
- {
- if (dirs[oldfd].name != NULL)
- {
- dirs[newfd].name = strdup (dirs[oldfd].name);
- if (dirs[newfd].name == NULL)
- dirs[newfd].saved_errno = ENOMEM;
- }
- else
- {
- dirs[newfd].name = NULL;
- dirs[newfd].saved_errno = dirs[oldfd].saved_errno;
- }
- }
- else
- {
- dirs[newfd].name = NULL;
- dirs[newfd].saved_errno = ENOMEM;
- }
- }
- }
- return retval;
-}
/* Implement fchdir() in terms of chdir(). */
int
fchdir (int fd)
{
- if (fd >= 0)
- {
- if (fd < dirs_allocated)
- {
- if (dirs[fd].name != NULL)
- return chdir (dirs[fd].name);
- else
- {
- errno = dirs[fd].saved_errno;
- return -1;
- }
- }
- else
- {
- errno = ENOMEM;
- return -1;
- }
- }
- else
- {
- errno = EBADF;
- return -1;
- }
+ const char *name = _gl_directory_name (fd);
+ return name ? chdir (name) : -1;
}
diff --git a/gnulib/lib/fchmodat.c b/gnulib/lib/fchmodat.c
index 935bdcbc..53cafe06 100644
--- a/gnulib/lib/fchmodat.c
+++ b/gnulib/lib/fchmodat.c
@@ -1,5 +1,5 @@
/* Change the protections of file relative to an open directory.
- Copyright (C) 2006 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -18,10 +18,12 @@
#include <config.h>
-#include "openat.h"
+#include <sys/stat.h>
+
#include "dirname.h" /* solely for definition of IS_ABSOLUTE_FILE_NAME */
-#include "save-cwd.h"
+#include "openat.h"
#include "openat-priv.h"
+#include "save-cwd.h"
#ifndef HAVE_LCHMOD
/* Use a different name, to avoid conflicting with any
@@ -35,15 +37,15 @@ static int lchmod (char const *f, mode_t m) { errno = ENOSYS; return -1; }
Invoke chmod or lchmod on file, FILE, using mode MODE, in the directory
open on descriptor FD. If possible, do it without changing the
working directory. Otherwise, resort to using save_cwd/fchdir,
- then mkdir/restore_cwd. If either the save_cwd or the restore_cwd
- fails, then give a diagnostic and exit nonzero.
+ then (chmod|lchmod)/restore_cwd. If either the save_cwd or the
+ restore_cwd fails, then give a diagnostic and exit nonzero.
Note that an attempt to use a FLAG value of AT_SYMLINK_NOFOLLOW
on a system without lchmod support causes this function to fail. */
#define AT_FUNC_NAME fchmodat
#define AT_FUNC_F1 lchmod
#define AT_FUNC_F2 chmod
-#define AT_FUNC_USE_F1_COND flag == AT_SYMLINK_NOFOLLOW
+#define AT_FUNC_USE_F1_COND AT_SYMLINK_NOFOLLOW
#define AT_FUNC_POST_FILE_PARAM_DECLS , mode_t mode, int flag
#define AT_FUNC_POST_FILE_ARGS , mode
#include "at-func.c"
diff --git a/gnulib/lib/fchownat.c b/gnulib/lib/fchownat.c
index a1d5e60f..6da35373 100644
--- a/gnulib/lib/fchownat.c
+++ b/gnulib/lib/fchownat.c
@@ -4,7 +4,7 @@
when the buggy fchownat-with-AT_SYMLINK_NOFOLLOW operates on a symlink, it
mistakenly affects the symlink referent, rather than the symlink itself.
- Copyright (C) 2006-2007 Free Software Foundation, Inc.
+ Copyright (C) 2006-2007, 2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -23,26 +23,25 @@
#include <config.h>
-#include "openat.h"
-
#include <unistd.h>
#include "dirname.h" /* solely for definition of IS_ABSOLUTE_FILE_NAME */
-#include "save-cwd.h"
+#include "openat.h"
#include "openat-priv.h"
+#include "save-cwd.h"
/* Replacement for Solaris' function by the same name.
Invoke chown or lchown on file, FILE, using OWNER and GROUP, in the
directory open on descriptor FD. If FLAG is AT_SYMLINK_NOFOLLOW, then
use lchown, otherwise, use chown. If possible, do it without changing
the working directory. Otherwise, resort to using save_cwd/fchdir,
- then mkdir/restore_cwd. If either the save_cwd or the restore_cwd
- fails, then give a diagnostic and exit nonzero. */
+ then (chown|lchown)/restore_cwd. If either the save_cwd or the
+ restore_cwd fails, then give a diagnostic and exit nonzero. */
#define AT_FUNC_NAME fchownat
#define AT_FUNC_F1 lchown
#define AT_FUNC_F2 chown
-#define AT_FUNC_USE_F1_COND flag == AT_SYMLINK_NOFOLLOW
+#define AT_FUNC_USE_F1_COND AT_SYMLINK_NOFOLLOW
#define AT_FUNC_POST_FILE_PARAM_DECLS , uid_t owner, gid_t group, int flag
#define AT_FUNC_POST_FILE_ARGS , owner, group
#include "at-func.c"
diff --git a/gnulib/lib/fcntl--.h b/gnulib/lib/fcntl--.h
index 5a6a8792..588b69aa 100644
--- a/gnulib/lib/fcntl--.h
+++ b/gnulib/lib/fcntl--.h
@@ -1,6 +1,6 @@
/* Like fcntl.h, but redefine some names to avoid glitches.
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -25,3 +25,8 @@
#undef creat
#define creat creat_safer
+
+#if GNULIB_OPENAT_SAFER
+# undef openat
+# define openat openat_safer
+#endif
diff --git a/gnulib/lib/fcntl-safer.h b/gnulib/lib/fcntl-safer.h
index 99f38656..2b10ba68 100644
--- a/gnulib/lib/fcntl-safer.h
+++ b/gnulib/lib/fcntl-safer.h
@@ -1,6 +1,6 @@
/* Invoke fcntl-like functions, but avoid some glitches.
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -21,3 +21,7 @@
int open_safer (char const *, int, ...);
int creat_safer (char const *, mode_t);
+
+#if GNULIB_OPENAT_SAFER
+int openat_safer (int, char const *, int, ...);
+#endif
diff --git a/gnulib/lib/fcntl.in.h b/gnulib/lib/fcntl.in.h
index fd7520e8..cadb6a15 100644
--- a/gnulib/lib/fcntl.in.h
+++ b/gnulib/lib/fcntl.in.h
@@ -1,6 +1,6 @@
/* Like <fcntl.h>, but with non-working flags defined to 0.
- Copyright (C) 2006-2008 Free Software Foundation, Inc.
+ Copyright (C) 2006-2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -44,6 +44,9 @@
#define _GL_FCNTL_H
+/* The definition of GL_LINK_WARNING is copied here. */
+
+
/* Declare overridden functions. */
#ifdef __cplusplus
@@ -58,15 +61,29 @@ extern int open (const char *filename, int flags, ...);
# endif
#endif
-#ifdef FCHDIR_REPLACEMENT
-/* gnulib internal function. */
-extern void _gl_register_fd (int fd, const char *filename);
+#if @GNULIB_OPENAT@
+# if !@HAVE_OPENAT@
+# undef openat
+# define openat rpl_openat
+int openat (int fd, char const *file, int flags, /* mode_t mode */ ...);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef openat
+# define openat(f,u,g) \
+ (GL_LINK_WARNING ("openat is not portable - " \
+ "use gnulib module openat for portability"), \
+ openat)
#endif
#ifdef __cplusplus
}
#endif
+/* Fix up the FD_* macros. */
+
+#ifndef FD_CLOEXEC
+# define FD_CLOEXEC 1
+#endif
/* Fix up the O_* macros. */
@@ -75,6 +92,12 @@ extern void _gl_register_fd (int fd, const char *filename);
# define O_DIRECT O_DIRECTIO
#endif
+#if !defined O_CLOEXEC && defined O_NOINHERIT
+/* Mingw spells it `O_NOINHERIT'. Intentionally leave it
+ undefined if not available. */
+# define O_CLOEXEC O_NOINHERIT
+#endif
+
#ifndef O_DIRECT
# define O_DIRECT 0
#endif
@@ -119,6 +142,10 @@ extern void _gl_register_fd (int fd, const char *filename);
# define O_SYNC 0
#endif
+#ifndef O_TTY_INIT
+# define O_TTY_INIT 0
+#endif
+
/* For systems that distinguish between text and binary I/O.
O_BINARY is usually declared in fcntl.h */
#if !defined O_BINARY && defined _O_BINARY
@@ -138,6 +165,42 @@ extern void _gl_register_fd (int fd, const char *filename);
# define O_TEXT 0
#endif
+/* Fix up the AT_* macros. */
+
+/* Work around a bug in Solaris 9 and 10: AT_FDCWD is positive. Its
+ value exceeds INT_MAX, so its use as an int doesn't conform to the
+ C standard, and GCC and Sun C complain in some cases. If the bug
+ is present, undef AT_FDCWD here, so it can be redefined below. */
+#if 0 < AT_FDCWD && AT_FDCWD == 0xffd19553
+# undef AT_FDCWD
+#endif
+
+/* Use the same bit pattern as Solaris 9, but with the proper
+ signedness. The bit pattern is important, in case this actually is
+ Solaris with the above workaround. */
+#ifndef AT_FDCWD
+# define AT_FDCWD (-3041965)
+#endif
+
+/* Use the same values as Solaris 9. This shouldn't matter, but
+ there's no real reason to differ. */
+#ifndef AT_SYMLINK_NOFOLLOW
+# define AT_SYMLINK_NOFOLLOW 4096
+#endif
+
+#ifndef AT_REMOVEDIR
+# define AT_REMOVEDIR 1
+#endif
+
+/* Solaris 9 lacks these two, so just pick unique values. */
+#ifndef AT_SYMLINK_FOLLOW
+# define AT_SYMLINK_FOLLOW 2
+#endif
+
+#ifndef AT_EACCESS
+# define AT_EACCESS 4
+#endif
+
#endif /* _GL_FCNTL_H */
#endif /* _GL_FCNTL_H */
diff --git a/gnulib/lib/fdopendir.c b/gnulib/lib/fdopendir.c
new file mode 100644
index 00000000..14dc111c
--- /dev/null
+++ b/gnulib/lib/fdopendir.c
@@ -0,0 +1,107 @@
+/* provide a replacement fdopendir function
+ Copyright (C) 2004-2009 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* written by Jim Meyering */
+
+#include <config.h>
+
+#include <dirent.h>
+
+#include <stdlib.h>
+#include <unistd.h>
+
+#include "openat.h"
+#include "openat-priv.h"
+#include "save-cwd.h"
+
+#if GNULIB_DIRENT_SAFER
+# include "dirent--.h"
+#endif
+
+/* Replacement for Solaris' function by the same name.
+ <http://www.google.com/search?q=fdopendir+site:docs.sun.com>
+ First, try to simulate it via opendir ("/proc/self/fd/FD"). Failing
+ that, simulate it by using fchdir metadata, or by doing
+ save_cwd/fchdir/opendir(".")/restore_cwd.
+ If either the save_cwd or the restore_cwd fails (relatively unlikely),
+ then give a diagnostic and exit nonzero.
+ Otherwise, this function works just like Solaris' fdopendir.
+
+ W A R N I N G:
+ Unlike other fd-related functions, this one effectively consumes
+ its FD parameter. The caller should not close or otherwise
+ manipulate FD if this function returns successfully. Also, this
+ implementation does not guarantee that dirfd(fdopendir(n))==n;
+ the open directory stream may use a clone of FD, or have no
+ associated fd at all. */
+DIR *
+fdopendir (int fd)
+{
+ int saved_errno;
+ DIR *dir;
+
+ char buf[OPENAT_BUFFER_SIZE];
+ char *proc_file = openat_proc_name (buf, fd, ".");
+ if (proc_file)
+ {
+ dir = opendir (proc_file);
+ saved_errno = errno;
+ }
+ else
+ {
+ dir = NULL;
+ saved_errno = EOPNOTSUPP;
+ }
+
+ /* If the syscall fails with an expected errno value, resort to
+ save_cwd/restore_cwd. */
+ if (! dir && EXPECTED_ERRNO (saved_errno))
+ {
+#if REPLACE_FCHDIR
+ const char *name = _gl_directory_name (fd);
+ if (name)
+ dir = opendir (name);
+ saved_errno = errno;
+#else /* !REPLACE_FCHDIR */
+ struct saved_cwd saved_cwd;
+ if (save_cwd (&saved_cwd) != 0)
+ openat_save_fail (errno);
+
+ if (fchdir (fd) != 0)
+ {
+ dir = NULL;
+ saved_errno = errno;
+ }
+ else
+ {
+ dir = opendir (".");
+ saved_errno = errno;
+
+ if (restore_cwd (&saved_cwd) != 0)
+ openat_restore_fail (errno);
+ }
+
+ free_cwd (&saved_cwd);
+#endif /* !REPLACE_FCHDIR */
+ }
+
+ if (dir)
+ close (fd);
+ if (proc_file != buf)
+ free (proc_file);
+ errno = saved_errno;
+ return dir;
+}
diff --git a/gnulib/lib/fstatat.c b/gnulib/lib/fstatat.c
index 8b629122..9b0c1afa 100644
--- a/gnulib/lib/fstatat.c
+++ b/gnulib/lib/fstatat.c
@@ -1,6 +1,6 @@
/* Work around an fstatat bug on Solaris 9.
- Copyright (C) 2006 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -19,12 +19,14 @@
#include <config.h>
-#define COMPILING_FSTATAT 1
-#include "openat.h"
+#include <sys/stat.h>
#include <errno.h>
+#include <fcntl.h>
#include <string.h>
+#undef fstatat
+
/* fstatat should always follow symbolic links that end in /, but on
Solaris 9 it doesn't if AT_SYMLINK_NOFOLLOW is specified. This is
the same problem that lstat.c addresses, so solve it in a similar
diff --git a/gnulib/lib/getcwd.c b/gnulib/lib/getcwd.c
index b9e57d31..6658ed58 100644
--- a/gnulib/lib/getcwd.c
+++ b/gnulib/lib/getcwd.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-1999, 2004-2008 Free Software Foundation, Inc.
+/* Copyright (C) 1991-1999, 2004-2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
This program is free software: you can redistribute it and/or modify
@@ -59,20 +59,6 @@
#include <limits.h>
-/* Work around a bug in Solaris 9 and 10: AT_FDCWD is positive. Its
- value exceeds INT_MAX, so its use as an int doesn't conform to the
- C standard, and GCC and Sun C complain in some cases. */
-#if 0 < AT_FDCWD && AT_FDCWD == 0xffd19553
-# undef AT_FDCWD
-# define AT_FDCWD (-3041965)
-#endif
-
-#ifdef ENAMETOOLONG
-# define is_ENAMETOOLONG(x) ((x) == ENAMETOOLONG)
-#else
-# define is_ENAMETOOLONG(x) 0
-#endif
-
#ifndef MAX
# define MAX(a, b) ((a) < (b) ? (b) : (a))
#endif
@@ -103,7 +89,11 @@
#endif
/* The results of opendir() in this file are not used with dirfd and fchdir,
- therefore save some unnecessary recursion in fchdir.c. */
+ and we do not leak fds to any single-threaded code that could use stdio,
+ therefore save some unnecessary recursion in fchdir.c.
+ FIXME - if the kernel ever adds support for multi-thread safety for
+ avoiding standard fds, then we should use opendir_safer and
+ openat_safer. */
#undef opendir
#undef closedir
@@ -160,7 +150,7 @@ __getcwd (char *buf, size_t size)
# undef getcwd
dir = getcwd (buf, size);
- if (dir || (errno != ERANGE && !is_ENAMETOOLONG (errno) && errno != ENOENT))
+ if (dir || (errno != ERANGE && errno != ENAMETOOLONG && errno != ENOENT))
return dir;
#endif
diff --git a/gnulib/lib/gettimeofday.c b/gnulib/lib/gettimeofday.c
index eb6bf9c1..63ee747c 100644
--- a/gnulib/lib/gettimeofday.c
+++ b/gnulib/lib/gettimeofday.c
@@ -1,6 +1,6 @@
/* Provide gettimeofday for systems that don't have it or for which it's broken.
- Copyright (C) 2001, 2002, 2003, 2005, 2006, 2007 Free Software
+ Copyright (C) 2001, 2002, 2003, 2005, 2006, 2007, 2009 Free Software
Foundation, Inc.
This program is free software; you can redistribute it and/or modify
@@ -111,7 +111,7 @@ rpl_gettimeofday (struct timeval *restrict tv, void *restrict tz)
struct tm save = *localtime_buffer_addr;
# endif
- int result = gettimeofday (tv, tz);
+ int result = gettimeofday (tv, (struct timezone *) tz);
# if GETTIMEOFDAY_CLOBBERS_LOCALTIME
*localtime_buffer_addr = save;
diff --git a/gnulib/lib/glob.c b/gnulib/lib/glob.c
index 6214eb8c..d25c81b5 100644
--- a/gnulib/lib/glob.c
+++ b/gnulib/lib/glob.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2002, 2003, 2004, 2005, 2006, 2007, 2008
+/* Copyright (C) 1991-2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -186,7 +186,10 @@ static const char *next_brace_sub (const char *begin, int flags) __THROW;
#ifndef _LIBC
/* The results of opendir() in this file are not used with dirfd and fchdir,
- therefore save some unnecessary work in fchdir.c. */
+ and we do not leak fds to any single-threaded code that could use stdio,
+ therefore save some unnecessary recursion in fchdir.c and opendir_safer.c.
+ FIXME - if the kernel ever adds support for multi-thread safety for
+ avoiding standard fds, then we should use opendir_safer. */
# undef opendir
# undef closedir
diff --git a/gnulib/lib/lchown.c b/gnulib/lib/lchown.c
index 07aef873..8cf10dd0 100644
--- a/gnulib/lib/lchown.c
+++ b/gnulib/lib/lchown.c
@@ -1,7 +1,7 @@
/* Provide a stub lchown function for systems that lack it.
- Copyright (C) 1998, 1999, 2002, 2004, 2006, 2007 Free Software
- Foundation, Inc.
+ Copyright (C) 1998, 1999, 2002, 2004, 2006, 2007, 2009 Free
+ Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -30,16 +30,6 @@
#include <errno.h>
#include <sys/stat.h>
-/* Some systems don't have EOPNOTSUPP. */
-#ifndef EOPNOTSUPP
-# ifdef ENOTSUP
-# define EOPNOTSUPP ENOTSUP
-# else
-/* Some systems don't have ENOTSUP either. */
-# define EOPNOTSUPP EINVAL
-# endif
-#endif
-
/* Work just like chown, except when FILE is a symbolic link.
In that case, set errno to EOPNOTSUPP and return -1.
But if autoconf tests determined that chown modifies
@@ -48,7 +38,8 @@
int
lchown (const char *file, uid_t uid, gid_t gid)
{
-#if ! CHOWN_MODIFIES_SYMLINK
+#if HAVE_CHOWN
+# if ! CHOWN_MODIFIES_SYMLINK
struct stat stats;
if (lstat (file, &stats) == 0 && S_ISLNK (stats.st_mode))
@@ -56,7 +47,12 @@ lchown (const char *file, uid_t uid, gid_t gid)
errno = EOPNOTSUPP;
return -1;
}
-#endif
+# endif
return chown (file, uid, gid);
+
+#else /* !HAVE_CHOWN */
+ errno = ENOSYS;
+ return -1;
+#endif
}
diff --git a/gnulib/lib/mkdirat.c b/gnulib/lib/mkdirat.c
index 6b6278b1..33ece9cc 100644
--- a/gnulib/lib/mkdirat.c
+++ b/gnulib/lib/mkdirat.c
@@ -1,5 +1,5 @@
/* fd-relative mkdir
- Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -18,13 +18,12 @@
#include <config.h>
-#include "openat.h"
-
#include <unistd.h>
#include "dirname.h" /* solely for definition of IS_ABSOLUTE_FILE_NAME */
-#include "save-cwd.h"
+#include "openat.h"
#include "openat-priv.h"
+#include "save-cwd.h"
/* Solaris 10 has no function like this.
Create a subdirectory, FILE, with mode MODE, in the directory
@@ -35,8 +34,6 @@
#define AT_FUNC_NAME mkdirat
#define AT_FUNC_F1 mkdir
-#define AT_FUNC_F2 mkdir
-#define AT_FUNC_USE_F1_COND 1
#define AT_FUNC_POST_FILE_PARAM_DECLS , mode_t mode
#define AT_FUNC_POST_FILE_ARGS , mode
#include "at-func.c"
diff --git a/gnulib/lib/mkdtemp.c b/gnulib/lib/mkdtemp.c
index 6b9dd151..b5181d15 100644
--- a/gnulib/lib/mkdtemp.c
+++ b/gnulib/lib/mkdtemp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2001-2003, 2006-2007 Free Software Foundation, Inc.
+/* Copyright (C) 1999, 2001-2003, 2006-2007, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
This program is free software: you can redistribute it and/or modify
@@ -31,7 +31,7 @@
char *
mkdtemp (char *template)
{
- if (gen_tempname (template, GT_DIR))
+ if (gen_tempname (template, 0, GT_DIR))
return NULL;
else
return template;
diff --git a/gnulib/lib/mkstemp.c b/gnulib/lib/mkstemp.c
index 1b052f9b..ccf7a7be 100644
--- a/gnulib/lib/mkstemp.c
+++ b/gnulib/lib/mkstemp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 1999, 2001, 2005, 2006, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 1999, 2001, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
This file is derived from the one in the GNU C Library.
This program is free software: you can redistribute it and/or modify
@@ -40,5 +40,5 @@ int
mkstemp (template)
char *template;
{
- return __gen_tempname (template, __GT_FILE);
+ return __gen_tempname (template, 0, __GT_FILE);
}
diff --git a/gnulib/lib/open.c b/gnulib/lib/open.c
index 326e6d15..08ecaff4 100644
--- a/gnulib/lib/open.c
+++ b/gnulib/lib/open.c
@@ -38,6 +38,11 @@ orig_open (const char *filename, int flags, mode_t mode)
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <unistd.h>
+
+#ifndef REPLACE_OPEN_DIRECTORY
+# define REPLACE_OPEN_DIRECTORY 0
+#endif
int
open (const char *filename, int flags, ...)
@@ -98,6 +103,29 @@ open (const char *filename, int flags, ...)
fd = orig_open (filename, flags, mode);
+#if REPLACE_FCHDIR
+ /* Implementing fchdir and fdopendir requires the ability to open a
+ directory file descriptor. If open doesn't support that (as on
+ mingw), we use a dummy file that behaves the same as directories
+ on Linux (ie. always reports EOF on attempts to read()), and
+ override fstat() in fchdir.c to hide the fact that we have a
+ dummy. */
+ if (REPLACE_OPEN_DIRECTORY && fd < 0 && errno == EACCES
+ && (mode & O_ACCMODE) == O_RDONLY)
+ {
+ struct stat statbuf;
+ if (stat (filename, &statbuf) == 0 && S_ISDIR (statbuf.st_mode))
+ {
+ /* Maximum recursion depth of 1. */
+ fd = open ("/dev/null", flags, mode);
+ if (0 <= fd)
+ fd = _gl_register_fd (fd, filename);
+ }
+ else
+ errno = EACCES;
+ }
+#endif
+
#if OPEN_TRAILING_SLASH_BUG
/* If the filename ends in a slash and fd does not refer to a directory,
then fail.
@@ -128,9 +156,9 @@ open (const char *filename, int flags, ...)
}
#endif
-#ifdef FCHDIR_REPLACEMENT
- if (fd >= 0)
- _gl_register_fd (fd, filename);
+#if REPLACE_FCHDIR
+ if (!REPLACE_OPEN_DIRECTORY && 0 <= fd)
+ fd = _gl_register_fd (fd, filename);
#endif
return fd;
diff --git a/gnulib/lib/openat-priv.h b/gnulib/lib/openat-priv.h
index 9254f6bb..22804162 100644
--- a/gnulib/lib/openat-priv.h
+++ b/gnulib/lib/openat-priv.h
@@ -1,6 +1,6 @@
/* Internals for openat-like functions.
- Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -23,26 +23,6 @@
#define OPENAT_BUFFER_SIZE 512
char *openat_proc_name (char buf[OPENAT_BUFFER_SIZE], int fd, char const *file);
-/* Some systems don't have ENOSYS. */
-#ifndef ENOSYS
-# ifdef ENOTSUP
-# define ENOSYS ENOTSUP
-# else
-/* Some systems don't have ENOTSUP either. */
-# define ENOSYS EINVAL
-# endif
-#endif
-
-/* Some systems don't have EOPNOTSUPP. */
-#ifndef EOPNOTSUPP
-# ifdef ENOTSUP
-# define EOPNOTSUPP ENOTSUP
-# else
-/* Some systems don't have ENOTSUP either. */
-# define EOPNOTSUPP EINVAL
-# endif
-#endif
-
/* Trying to access a BUILD_PROC_NAME file will fail on systems without
/proc support, and even on systems *with* ProcFS support. Return
nonzero if the failure may be legitimate, e.g., because /proc is not
diff --git a/gnulib/lib/openat-proc.c b/gnulib/lib/openat-proc.c
index e84dc454..76e1c6dd 100644
--- a/gnulib/lib/openat-proc.c
+++ b/gnulib/lib/openat-proc.c
@@ -1,6 +1,6 @@
/* Create /proc/self/fd-related names for subfiles of open directories.
- Copyright (C) 2006 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -34,7 +34,10 @@
#include "xalloc.h"
/* The results of open() in this file are not used with fchdir,
- therefore save some unnecessary work in fchdir.c. */
+ and we do not leak fds to any single-threaded code that could use stdio,
+ therefore save some unnecessary work in fchdir.c.
+ FIXME - if the kernel ever adds support for multi-thread safety for
+ avoiding standard fds, then we should use open_safer. */
#undef open
#undef close
@@ -54,6 +57,13 @@ openat_proc_name (char buf[OPENAT_BUFFER_SIZE], int fd, char const *file)
{
static int proc_status = 0;
+ /* Make sure the caller gets ENOENT when appropriate. */
+ if (!*file)
+ {
+ buf[0] = '\0';
+ return buf;
+ }
+
if (! proc_status)
{
/* Set PROC_STATUS to a positive value if /proc/self/fd is
diff --git a/gnulib/lib/openat-safer.c b/gnulib/lib/openat-safer.c
new file mode 100644
index 00000000..58d9a5e5
--- /dev/null
+++ b/gnulib/lib/openat-safer.c
@@ -0,0 +1,46 @@
+/* Invoke openat, but avoid some glitches.
+
+ Copyright (C) 2005, 2006, 2008-2009 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Paul Eggert for open, ported by Eric Blake for openat. */
+
+#include <config.h>
+
+#include "fcntl-safer.h"
+
+#include <fcntl.h>
+#include <stdarg.h>
+#include "unistd-safer.h"
+
+int
+openat_safer (int fd, char const *file, int flags, ...)
+{
+ mode_t mode = 0;
+
+ if (flags & O_CREAT)
+ {
+ va_list ap;
+ va_start (ap, flags);
+
+ /* We have to use PROMOTED_MODE_T instead of mode_t, otherwise GCC 4
+ creates crashing code when 'mode_t' is smaller than 'int'. */
+ mode = va_arg (ap, PROMOTED_MODE_T);
+
+ va_end (ap);
+ }
+
+ return fd_safer (openat (fd, file, flags, mode));
+}
diff --git a/gnulib/lib/openat.c b/gnulib/lib/openat.c
index 77a85bff..e1471b8c 100644
--- a/gnulib/lib/openat.c
+++ b/gnulib/lib/openat.c
@@ -25,10 +25,16 @@
#include <sys/stat.h>
#include "dirname.h" /* solely for definition of IS_ABSOLUTE_FILE_NAME */
-#include "fcntl--.h"
#include "openat-priv.h"
#include "save-cwd.h"
+/* We can't use "fcntl--.h", so that openat_safer does not interfere. */
+#if GNULIB_FCNTL_SAFER
+# include "fcntl-safer.h"
+# undef open
+# define open open_safer
+#endif
+
/* Replacement for Solaris' openat function.
<http://www.google.com/search?q=openat+site:docs.sun.com>
First, try to simulate it via open ("/proc/self/fd/FD/FILE").
@@ -152,74 +158,6 @@ openat_needs_fchdir (void)
return needs_fchdir;
}
-#if !HAVE_FDOPENDIR
-
-/* Replacement for Solaris' function by the same name.
- <http://www.google.com/search?q=fdopendir+site:docs.sun.com>
- First, try to simulate it via opendir ("/proc/self/fd/FD"). Failing
- that, simulate it by doing save_cwd/fchdir/opendir(".")/restore_cwd.
- If either the save_cwd or the restore_cwd fails (relatively unlikely),
- then give a diagnostic and exit nonzero.
- Otherwise, this function works just like Solaris' fdopendir.
-
- W A R N I N G:
- Unlike the other fd-related functions here, this one
- effectively consumes its FD parameter. The caller should not
- close or otherwise manipulate FD if this function returns successfully. */
-DIR *
-fdopendir (int fd)
-{
- struct saved_cwd saved_cwd;
- int saved_errno;
- DIR *dir;
-
- char buf[OPENAT_BUFFER_SIZE];
- char *proc_file = openat_proc_name (buf, fd, ".");
- if (proc_file)
- {
- dir = opendir (proc_file);
- saved_errno = errno;
- }
- else
- {
- dir = NULL;
- saved_errno = EOPNOTSUPP;
- }
-
- /* If the syscall fails with an expected errno value, resort to
- save_cwd/restore_cwd. */
- if (! dir && EXPECTED_ERRNO (saved_errno))
- {
- if (save_cwd (&saved_cwd) != 0)
- openat_save_fail (errno);
-
- if (fchdir (fd) != 0)
- {
- dir = NULL;
- saved_errno = errno;
- }
- else
- {
- dir = opendir (".");
- saved_errno = errno;
-
- if (restore_cwd (&saved_cwd) != 0)
- openat_restore_fail (errno);
- }
-
- free_cwd (&saved_cwd);
- }
-
- if (dir)
- close (fd);
- if (proc_file != buf)
- free (proc_file);
- errno = saved_errno;
- return dir;
-}
-
-#endif
-
/* Replacement for Solaris' function by the same name.
<http://www.google.com/search?q=fstatat+site:docs.sun.com>
First, try to simulate it via l?stat ("/proc/self/fd/FD/FILE").
@@ -231,7 +169,7 @@ fdopendir (int fd)
#define AT_FUNC_NAME fstatat
#define AT_FUNC_F1 lstat
#define AT_FUNC_F2 stat
-#define AT_FUNC_USE_F1_COND flag == AT_SYMLINK_NOFOLLOW
+#define AT_FUNC_USE_F1_COND AT_SYMLINK_NOFOLLOW
#define AT_FUNC_POST_FILE_PARAM_DECLS , struct stat *st, int flag
#define AT_FUNC_POST_FILE_ARGS , st
#include "at-func.c"
@@ -253,7 +191,7 @@ fdopendir (int fd)
#define AT_FUNC_NAME unlinkat
#define AT_FUNC_F1 rmdir
#define AT_FUNC_F2 unlink
-#define AT_FUNC_USE_F1_COND flag == AT_REMOVEDIR
+#define AT_FUNC_USE_F1_COND AT_REMOVEDIR
#define AT_FUNC_POST_FILE_PARAM_DECLS , int flag
#define AT_FUNC_POST_FILE_ARGS /* empty */
#include "at-func.c"
diff --git a/gnulib/lib/openat.h b/gnulib/lib/openat.h
index 68c7df0b..433b9983 100644
--- a/gnulib/lib/openat.h
+++ b/gnulib/lib/openat.h
@@ -1,5 +1,5 @@
/* provide a replacement openat function
- Copyright (C) 2004, 2005, 2006, 2008 Free Software Foundation, Inc.
+ Copyright (C) 2004-2006, 2008-2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -16,6 +16,9 @@
/* written by Jim Meyering */
+#ifndef _GL_HEADER_OPENAT
+#define _GL_HEADER_OPENAT
+
#include <fcntl.h>
#include <sys/types.h>
@@ -34,46 +37,10 @@
# define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
#endif
-/* Work around a bug in Solaris 9 and 10: AT_FDCWD is positive. Its
- value exceeds INT_MAX, so its use as an int doesn't conform to the
- C standard, and GCC and Sun C complain in some cases. If the bug
- is present, undef AT_FDCWD here, so it can be redefined below. */
-#if 0 < AT_FDCWD && AT_FDCWD == 0xffd19553
-# undef AT_FDCWD
-#endif
-
-/* Use the same bit pattern as Solaris 9, but with the proper
- signedness. The bit pattern is important, in case this actually is
- Solaris with the above workaround. */
-#ifndef AT_FDCWD
-# define AT_FDCWD (-3041965)
-#endif
-
-/* Use the same values as Solaris 9. This shouldn't matter, but
- there's no real reason to differ. */
-#ifndef AT_SYMLINK_NOFOLLOW
-# define AT_SYMLINK_NOFOLLOW 4096
-# define AT_REMOVEDIR 1
-#endif
-
-#ifdef __OPENAT_PREFIX
+#if !HAVE_OPENAT
-# undef openat
-# define __OPENAT_CONCAT(x, y) x ## y
-# define __OPENAT_XCONCAT(x, y) __OPENAT_CONCAT (x, y)
-# define __OPENAT_ID(y) __OPENAT_XCONCAT (__OPENAT_PREFIX, y)
-# define openat __OPENAT_ID (openat)
-int openat (int fd, char const *file, int flags, /* mode_t mode */ ...);
int openat_permissive (int fd, char const *file, int flags, mode_t mode,
int *cwd_errno);
-# if ! HAVE_FDOPENDIR
-# define fdopendir __OPENAT_ID (fdopendir)
-# endif
-DIR *fdopendir (int fd);
-# define fstatat __OPENAT_ID (fstatat)
-int fstatat (int fd, char const *file, struct stat *st, int flag);
-# define unlinkat __OPENAT_ID (unlinkat)
-int unlinkat (int fd, char const *file, int flag);
bool openat_needs_fchdir (void);
#else
@@ -84,19 +51,8 @@ bool openat_needs_fchdir (void);
#endif
-#if HAVE_OPENAT && ! LSTAT_FOLLOWS_SLASHED_SYMLINK
-int rpl_fstatat (int fd, char const *file, struct stat *st, int flag);
-# if !COMPILING_FSTATAT
-# undef fstatat
-# define fstatat rpl_fstatat
-# endif
-#endif
-
-int mkdirat (int fd, char const *file, mode_t mode);
void openat_restore_fail (int) ATTRIBUTE_NORETURN;
void openat_save_fail (int) ATTRIBUTE_NORETURN;
-int fchmodat (int fd, char const *file, mode_t mode, int flag);
-int fchownat (int fd, char const *file, uid_t owner, gid_t group, int flag);
/* Using these function names makes application code
slightly more readable than it would be with
@@ -124,3 +80,35 @@ lchmodat (int fd, char const *file, mode_t mode)
{
return fchmodat (fd, file, mode, AT_SYMLINK_NOFOLLOW);
}
+
+static inline int
+statat (int fd, char const *name, struct stat *st)
+{
+ return fstatat (fd, name, st, 0);
+}
+
+static inline int
+lstatat (int fd, char const *name, struct stat *st)
+{
+ return fstatat (fd, name, st, AT_SYMLINK_NOFOLLOW);
+}
+
+#if GNULIB_FACCESSAT
+/* For now, there are no wrappers named laccessat or leuidaccessat,
+ since gnulib doesn't support faccessat(,AT_SYMLINK_NOFOLLOW) and
+ since access rights on symlinks are of limited utility. */
+
+static inline int
+accessat (int fd, char const *file, int mode)
+{
+ return faccessat (fd, file, mode, 0);
+}
+
+static inline int
+euidaccessat (int fd, char const *file, int mode)
+{
+ return faccessat (fd, file, mode, AT_EACCESS);
+}
+#endif
+
+#endif /* _GL_HEADER_OPENAT */
diff --git a/gnulib/lib/realloc.c b/gnulib/lib/realloc.c
new file mode 100644
index 00000000..b61c2ca8
--- /dev/null
+++ b/gnulib/lib/realloc.c
@@ -0,0 +1,87 @@
+/* realloc() function that is glibc compatible.
+
+ Copyright (C) 1997, 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* written by Jim Meyering and Bruno Haible */
+
+#include <config.h>
+
+/* Only the AC_FUNC_REALLOC macro defines 'realloc' already in config.h. */
+#ifdef realloc
+# define NEED_REALLOC_GNU 1
+#endif
+
+/* Infer the properties of the system's malloc function.
+ Only the AC_FUNC_MALLOC macro defines 'malloc' already in config.h. */
+#if GNULIB_MALLOC_GNU && !defined malloc
+# define SYSTEM_MALLOC_GLIBC_COMPATIBLE 1
+#endif
+
+/* Below we want to call the system's malloc and realloc.
+ Undefine the symbols here so that including <stdlib.h> provides a
+ declaration of malloc(), not of rpl_malloc(), and likewise for realloc. */
+#undef malloc
+#undef realloc
+
+/* Specification. */
+#include <stdlib.h>
+
+#include <errno.h>
+
+/* Below we want to call the system's malloc and realloc.
+ Undefine the symbols, if they were defined by gnulib's <stdlib.h>
+ replacement. */
+#undef malloc
+#undef realloc
+
+/* Change the size of an allocated block of memory P to N bytes,
+ with error checking. If N is zero, change it to 1. If P is NULL,
+ use malloc. */
+
+void *
+rpl_realloc (void *p, size_t n)
+{
+ void *result;
+
+#if NEED_REALLOC_GNU
+ if (n == 0)
+ {
+ n = 1;
+
+ /* In theory realloc might fail, so don't rely on it to free. */
+ free (p);
+ p = NULL;
+ }
+#endif
+
+ if (p == NULL)
+ {
+#if GNULIB_REALLOC_GNU && !NEED_REALLOC_GNU && !SYSTEM_MALLOC_GLIBC_COMPATIBLE
+ if (n == 0)
+ n = 1;
+#endif
+ result = malloc (n);
+ }
+ else
+ result = realloc (p, n);
+
+#if !HAVE_REALLOC_POSIX
+ if (result == NULL)
+ errno = ENOMEM;
+#endif
+
+ return result;
+}
diff --git a/gnulib/lib/rename.c b/gnulib/lib/rename.c
index b27fd910..5cd4dee9 100644
--- a/gnulib/lib/rename.c
+++ b/gnulib/lib/rename.c
@@ -3,7 +3,8 @@
a trailing slash. On mingw, rename fails when the destination
exists.
- Copyright (C) 2001, 2002, 2003, 2005, 2006, 2009 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2003, 2005, 2006, 2009 Free Software
+ Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -21,16 +22,20 @@
/* written by Volker Borchert */
#include <config.h>
+
+#include <stdio.h>
+
#undef rename
-#if RENAME_DEST_EXISTS_BUG
-/* This replacement must come first, otherwise when cross
- * compiling to Windows we will guess that it has the trailing
- * slash bug and entirely miss this one. */
-#include <errno.h>
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+/* The mingw rename has problems with trailing slashes; it also
+ requires use of native Windows calls to allow atomic renames over
+ existing files. */
+
+# include <errno.h>
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
/* Rename the file SRC to DST. This replacement is necessary on
Windows, on which the system rename function will not replace
@@ -114,10 +119,10 @@ rpl_rename (char const *src, char const *dst)
errno = EPERM; /* ? */
break;
-#ifndef ERROR_FILE_TOO_LARGE
+# ifndef ERROR_FILE_TOO_LARGE
/* This value is documented but not defined in all versions of windows.h. */
-#define ERROR_FILE_TOO_LARGE 223
-#endif
+# define ERROR_FILE_TOO_LARGE 223
+# endif
case ERROR_FILE_TOO_LARGE:
errno = EFBIG;
break;
@@ -129,13 +134,18 @@ rpl_rename (char const *src, char const *dst)
return -1;
}
-#elif RENAME_TRAILING_SLASH_BUG
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "dirname.h"
-#include "xalloc.h"
+#else /* ! W32 platform */
+
+# if RENAME_DEST_EXISTS_BUG
+# error Please report your platform and this message to bug-gnulib@gnu.org.
+# elif RENAME_TRAILING_SLASH_BUG
+# include <stdio.h>
+# include <stdlib.h>
+# include <string.h>
+
+# include "dirname.h"
+# include "xalloc.h"
/* Rename the file SRC to DST, removing any trailing
slashes from SRC. Needed for SunOS 4.1.1_U1. */
@@ -162,4 +172,5 @@ rpl_rename (char const *src, char const *dst)
return ret_val;
}
-#endif /* RENAME_TRAILING_SLASH_BUG */
+# endif /* RENAME_TRAILING_SLASH_BUG */
+#endif /* ! W32 platform */
diff --git a/gnulib/lib/stddef.in.h b/gnulib/lib/stddef.in.h
new file mode 100644
index 00000000..aff3b94c
--- /dev/null
+++ b/gnulib/lib/stddef.in.h
@@ -0,0 +1,86 @@
+/* A substitute for POSIX 2008 <stddef.h>, for platforms that have issues.
+
+ Copyright (C) 2009 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+
+/* Written by Eric Blake. */
+
+/*
+ * POSIX 2008 <stddef.h> for platforms that have issues.
+ * <http://www.opengroup.org/susv3xbd/stddef.h.html>
+ */
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+
+#if defined __need_wchar_t || defined __need_size_t \
+ || defined __need_ptrdiff_t || defined __need_NULL \
+ || defined __need_wint_t
+/* Special invocation convention inside gcc header files. In
+ particular, gcc provides a version of <stddef.h> that blindly
+ redefines NULL even when __need_wint_t was defined, even though
+ wint_t is not normally provided by <stddef.h>. Hence, we must
+ remember if special invocation has ever been used to obtain wint_t,
+ in which case we need to clean up NULL yet again. */
+
+# if !(defined _GL_STDDEF_H && defined _GL_STDDEF_WINT_T)
+# ifdef __need_wint_t
+# undef _GL_STDDEF_H
+# define _GL_STDDEF_WINT_T
+# endif
+# @INCLUDE_NEXT@ @NEXT_STDDEF_H@
+# endif
+
+#else
+/* Normal invocation convention. */
+
+# ifndef _GL_STDDEF_H
+
+/* The include_next requires a split double-inclusion guard. */
+
+# @INCLUDE_NEXT@ @NEXT_STDDEF_H@
+
+# ifndef _GL_STDDEF_H
+# define _GL_STDDEF_H
+
+/* On NetBSD 5.0, the definition of NULL lacks proper parentheses. */
+#if @REPLACE_NULL@
+# undef NULL
+# ifdef __cplusplus
+ /* ISO C++ says that the macro NULL must expand to an integer constant
+ expression, hence '((void *) 0)' is not allowed in C++. */
+# if __GNUG__ >= 3
+ /* GNU C++ has a __null macro that behaves like an integer ('int' or
+ 'long') but has the same size as a pointer. Use that, to avoid
+ warnings. */
+# define NULL __null
+# else
+# define NULL 0L
+# endif
+# else
+# define NULL ((void *) 0)
+# endif
+#endif
+
+/* Some platforms lack wchar_t. */
+#if !@HAVE_WCHAR_T@
+# define wchar_t int
+#endif
+
+# endif /* _GL_STDDEF_H */
+# endif /* _GL_STDDEF_H */
+#endif /* __need_XXX */
diff --git a/gnulib/lib/stdio-write.c b/gnulib/lib/stdio-write.c
index f1d0fcb7..15cc5ed7 100644
--- a/gnulib/lib/stdio-write.c
+++ b/gnulib/lib/stdio-write.c
@@ -1,5 +1,5 @@
/* POSIX compatible FILE stream write function.
- Copyright (C) 2008 Free Software Foundation, Inc.
+ Copyright (C) 2008-2009 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2008.
This program is free software: you can redistribute it and/or modify
@@ -63,6 +63,7 @@
}
# if !REPLACE_PRINTF_POSIX /* avoid collision with printf.c */
+# if !DEPENDS_ON_LIBINTL /* avoid collision with intl/printf.c */
int
printf (const char *format, ...)
{
@@ -75,6 +76,7 @@ printf (const char *format, ...)
return retval;
}
+# endif
# endif
# if !REPLACE_FPRINTF_POSIX /* avoid collision with fprintf.c */
@@ -92,7 +94,7 @@ fprintf (FILE *stream, const char *format, ...)
}
# endif
-# if !REPLACE_VFPRINTF_POSIX /* avoid collision with vprintf.c */
+# if !REPLACE_VPRINTF_POSIX /* avoid collision with vprintf.c */
int
vprintf (const char *format, va_list args)
{
@@ -100,7 +102,7 @@ vprintf (const char *format, va_list args)
}
# endif
-# if !REPLACE_VPRINTF_POSIX /* avoid collision with vfprintf.c */
+# if !REPLACE_VFPRINTF_POSIX /* avoid collision with vfprintf.c */
int
vfprintf (FILE *stream, const char *format, va_list args)
#undef vfprintf
diff --git a/gnulib/lib/stdio.in.h b/gnulib/lib/stdio.in.h
index 0445c6f1..6e402dc0 100644
--- a/gnulib/lib/stdio.in.h
+++ b/gnulib/lib/stdio.in.h
@@ -68,154 +68,6 @@
extern "C" {
#endif
-
-#if @GNULIB_FPRINTF_POSIX@
-# if @REPLACE_FPRINTF@
-# define fprintf rpl_fprintf
-extern int fprintf (FILE *fp, const char *format, ...)
- __attribute__ ((__format__ (__printf__, 2, 3)));
-# endif
-#elif @GNULIB_FPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
-# define fprintf rpl_fprintf
-extern int fprintf (FILE *fp, const char *format, ...)
- __attribute__ ((__format__ (__printf__, 2, 3)));
-#elif defined GNULIB_POSIXCHECK
-# undef fprintf
-# define fprintf \
- (GL_LINK_WARNING ("fprintf is not always POSIX compliant - " \
- "use gnulib module fprintf-posix for portable " \
- "POSIX compliance"), \
- fprintf)
-#endif
-
-#if @GNULIB_VFPRINTF_POSIX@
-# if @REPLACE_VFPRINTF@
-# define vfprintf rpl_vfprintf
-extern int vfprintf (FILE *fp, const char *format, va_list args)
- __attribute__ ((__format__ (__printf__, 2, 0)));
-# endif
-#elif @GNULIB_VFPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
-# define vfprintf rpl_vfprintf
-extern int vfprintf (FILE *fp, const char *format, va_list args)
- __attribute__ ((__format__ (__printf__, 2, 0)));
-#elif defined GNULIB_POSIXCHECK
-# undef vfprintf
-# define vfprintf(s,f,a) \
- (GL_LINK_WARNING ("vfprintf is not always POSIX compliant - " \
- "use gnulib module vfprintf-posix for portable " \
- "POSIX compliance"), \
- vfprintf (s, f, a))
-#endif
-
-#if @GNULIB_PRINTF_POSIX@
-# if @REPLACE_PRINTF@
-/* Don't break __attribute__((format(printf,M,N))). */
-# define printf __printf__
-extern int printf (const char *format, ...)
- __attribute__ ((__format__ (__printf__, 1, 2)));
-# endif
-#elif @GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
-/* Don't break __attribute__((format(printf,M,N))). */
-# define printf __printf__
-extern int printf (const char *format, ...)
- __attribute__ ((__format__ (__printf__, 1, 2)));
-#elif defined GNULIB_POSIXCHECK
-# undef printf
-# define printf \
- (GL_LINK_WARNING ("printf is not always POSIX compliant - " \
- "use gnulib module printf-posix for portable " \
- "POSIX compliance"), \
- printf)
-/* Don't break __attribute__((format(printf,M,N))). */
-# define format(kind,m,n) format (__##kind##__, m, n)
-# define __format__(kind,m,n) __format__ (__##kind##__, m, n)
-# define ____printf____ __printf__
-# define ____scanf____ __scanf__
-# define ____strftime____ __strftime__
-# define ____strfmon____ __strfmon__
-#endif
-
-#if @GNULIB_VPRINTF_POSIX@
-# if @REPLACE_VPRINTF@
-# define vprintf rpl_vprintf
-extern int vprintf (const char *format, va_list args)
- __attribute__ ((__format__ (__printf__, 1, 0)));
-# endif
-#elif @GNULIB_VPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
-# define vprintf rpl_vprintf
-extern int vprintf (const char *format, va_list args)
- __attribute__ ((__format__ (__printf__, 1, 0)));
-#elif defined GNULIB_POSIXCHECK
-# undef vprintf
-# define vprintf(f,a) \
- (GL_LINK_WARNING ("vprintf is not always POSIX compliant - " \
- "use gnulib module vprintf-posix for portable " \
- "POSIX compliance"), \
- vprintf (f, a))
-#endif
-
-#if @GNULIB_SNPRINTF@
-# if @REPLACE_SNPRINTF@
-# define snprintf rpl_snprintf
-# endif
-# if @REPLACE_SNPRINTF@ || !@HAVE_DECL_SNPRINTF@
-extern int snprintf (char *str, size_t size, const char *format, ...)
- __attribute__ ((__format__ (__printf__, 3, 4)));
-# endif
-#elif defined GNULIB_POSIXCHECK
-# undef snprintf
-# define snprintf \
- (GL_LINK_WARNING ("snprintf is unportable - " \
- "use gnulib module snprintf for portability"), \
- snprintf)
-#endif
-
-#if @GNULIB_VSNPRINTF@
-# if @REPLACE_VSNPRINTF@
-# define vsnprintf rpl_vsnprintf
-# endif
-# if @REPLACE_VSNPRINTF@ || !@HAVE_DECL_VSNPRINTF@
-extern int vsnprintf (char *str, size_t size, const char *format, va_list args)
- __attribute__ ((__format__ (__printf__, 3, 0)));
-# endif
-#elif defined GNULIB_POSIXCHECK
-# undef vsnprintf
-# define vsnprintf(b,s,f,a) \
- (GL_LINK_WARNING ("vsnprintf is unportable - " \
- "use gnulib module vsnprintf for portability"), \
- vsnprintf (b, s, f, a))
-#endif
-
-#if @GNULIB_SPRINTF_POSIX@
-# if @REPLACE_SPRINTF@
-# define sprintf rpl_sprintf
-extern int sprintf (char *str, const char *format, ...)
- __attribute__ ((__format__ (__printf__, 2, 3)));
-# endif
-#elif defined GNULIB_POSIXCHECK
-# undef sprintf
-# define sprintf \
- (GL_LINK_WARNING ("sprintf is not always POSIX compliant - " \
- "use gnulib module sprintf-posix for portable " \
- "POSIX compliance"), \
- sprintf)
-#endif
-
-#if @GNULIB_VSPRINTF_POSIX@
-# if @REPLACE_VSPRINTF@
-# define vsprintf rpl_vsprintf
-extern int vsprintf (char *str, const char *format, va_list args)
- __attribute__ ((__format__ (__printf__, 2, 0)));
-# endif
-#elif defined GNULIB_POSIXCHECK
-# undef vsprintf
-# define vsprintf(b,f,a) \
- (GL_LINK_WARNING ("vsprintf is not always POSIX compliant - " \
- "use gnulib module vsprintf-posix for portable " \
- "POSIX compliance"), \
- vsprintf (b, f, a))
-#endif
-
#if @GNULIB_DPRINTF@
# if @REPLACE_DPRINTF@
# define dprintf rpl_dprintf
@@ -232,57 +84,39 @@ extern int dprintf (int fd, const char *format, ...)
dprintf (d, f, a))
#endif
-#if @GNULIB_VDPRINTF@
-# if @REPLACE_VDPRINTF@
-# define vdprintf rpl_vdprintf
-# endif
-# if @REPLACE_VDPRINTF@ || !@HAVE_VDPRINTF@
-extern int vdprintf (int fd, const char *format, va_list args)
- __attribute__ ((__format__ (__printf__, 2, 0)));
+#if @GNULIB_FCLOSE@
+# if @REPLACE_FCLOSE@
+# define fclose rpl_fclose
+ /* Close STREAM and its underlying file descriptor. */
+extern int fclose (FILE *stream);
# endif
#elif defined GNULIB_POSIXCHECK
-# undef vdprintf
-# define vdprintf(d,f,a) \
- (GL_LINK_WARNING ("vdprintf is unportable - " \
- "use gnulib module vdprintf for portability"), \
- vdprintf (d, f, a))
-#endif
-
-#if @GNULIB_VASPRINTF@
-# if @REPLACE_VASPRINTF@
-# define asprintf rpl_asprintf
-# define vasprintf rpl_vasprintf
-# endif
-# if @REPLACE_VASPRINTF@ || !@HAVE_VASPRINTF@
- /* Write formatted output to a string dynamically allocated with malloc().
- If the memory allocation succeeds, store the address of the string in
- *RESULT and return the number of resulting bytes, excluding the trailing
- NUL. Upon memory allocation error, or some other error, return -1. */
- extern int asprintf (char **result, const char *format, ...)
- __attribute__ ((__format__ (__printf__, 2, 3)));
- extern int vasprintf (char **result, const char *format, va_list args)
- __attribute__ ((__format__ (__printf__, 2, 0)));
-# endif
+# undef fclose
+# define fclose(f) \
+ (GL_LINK_WARNING ("fclose is not always POSIX compliant - " \
+ "use gnulib module fclose for portable " \
+ "POSIX compliance"), \
+ fclose (f))
#endif
-#if @GNULIB_OBSTACK_PRINTF@
-# if @REPLACE_OBSTACK_PRINTF@
-# define obstack_printf rpl_osbtack_printf
-# define obstack_vprintf rpl_obstack_vprintf
-# endif
-# if @REPLACE_OBSTACK_PRINTF@ || !@HAVE_DECL_OBSTACK_PRINTF@
- struct obstack;
- /* Grow an obstack with formatted output. Return the number of
- bytes added to OBS. No trailing nul byte is added, and the
- object should be closed with obstack_finish before use. Upon
- memory allocation error, call obstack_alloc_failed_handler. Upon
- other error, return -1. */
- extern int obstack_printf (struct obstack *obs, const char *format, ...)
- __attribute__ ((__format__ (__printf__, 2, 3)));
- extern int obstack_vprintf (struct obstack *obs, const char *format,
- va_list args)
- __attribute__ ((__format__ (__printf__, 2, 0)));
+#if @GNULIB_FFLUSH@
+# if @REPLACE_FFLUSH@
+# define fflush rpl_fflush
+ /* Flush all pending data on STREAM according to POSIX rules. Both
+ output and seekable input streams are supported.
+ Note! LOSS OF DATA can occur if fflush is applied on an input stream
+ that is _not_seekable_ or on an update stream that is _not_seekable_
+ and in which the most recent operation was input. Seekability can
+ be tested with lseek(fileno(fp),0,SEEK_CUR). */
+ extern int fflush (FILE *gl_stream);
# endif
+#elif defined GNULIB_POSIXCHECK
+# undef fflush
+# define fflush(f) \
+ (GL_LINK_WARNING ("fflush is not always POSIX compliant - " \
+ "use gnulib module fflush for portable " \
+ "POSIX compliance"), \
+ fflush (f))
#endif
#if @GNULIB_FOPEN@
@@ -299,6 +133,58 @@ extern FILE * fopen (const char *filename, const char *mode);
fopen (f, m))
#endif
+#if @GNULIB_FPRINTF_POSIX@
+# if @REPLACE_FPRINTF@
+# define fprintf rpl_fprintf
+extern int fprintf (FILE *fp, const char *format, ...)
+ __attribute__ ((__format__ (__printf__, 2, 3)));
+# endif
+#elif @GNULIB_FPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
+# define fprintf rpl_fprintf
+extern int fprintf (FILE *fp, const char *format, ...)
+ __attribute__ ((__format__ (__printf__, 2, 3)));
+#elif defined GNULIB_POSIXCHECK
+# undef fprintf
+# define fprintf \
+ (GL_LINK_WARNING ("fprintf is not always POSIX compliant - " \
+ "use gnulib module fprintf-posix for portable " \
+ "POSIX compliance"), \
+ fprintf)
+#endif
+
+#if @GNULIB_FPURGE@
+# if @REPLACE_FPURGE@
+# define fpurge rpl_fpurge
+# endif
+# if @REPLACE_FPURGE@ || !@HAVE_DECL_FPURGE@
+ /* Discard all pending buffered I/O data on STREAM.
+ STREAM must not be wide-character oriented.
+ When discarding pending output, the file position is set back to where it
+ was before the write calls. When discarding pending input, the file
+ position is advanced to match the end of the previously read input.
+ Return 0 if successful. Upon error, return -1 and set errno. */
+ extern int fpurge (FILE *gl_stream);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef fpurge
+# define fpurge(f) \
+ (GL_LINK_WARNING ("fpurge is not always present - " \
+ "use gnulib module fpurge for portability"), \
+ fpurge (f))
+#endif
+
+#if @GNULIB_FPUTC@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
+# undef fputc
+# define fputc rpl_fputc
+extern int fputc (int c, FILE *stream);
+#endif
+
+#if @GNULIB_FPUTS@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
+# undef fputs
+# define fputs rpl_fputs
+extern int fputs (const char *string, FILE *stream);
+#endif
+
#if @GNULIB_FREOPEN@
# if @REPLACE_FREOPEN@
# undef freopen
@@ -313,22 +199,6 @@ extern FILE * freopen (const char *filename, const char *mode, FILE *stream);
freopen (f, m, s))
#endif
-#if @GNULIB_FSEEKO@
-# if @REPLACE_FSEEKO@
-/* Provide fseek, fseeko functions that are aware of a preceding
- fflush(), and which detect pipes. */
-# define fseeko rpl_fseeko
-extern int fseeko (FILE *fp, off_t offset, int whence);
-# define fseek(fp, offset, whence) fseeko (fp, (off_t)(offset), whence)
-# endif
-#elif defined GNULIB_POSIXCHECK
-# undef fseeko
-# define fseeko(f,o,w) \
- (GL_LINK_WARNING ("fseeko is unportable - " \
- "use gnulib module fseeko for portability"), \
- fseeko (f, o, w))
-#endif
-
#if @GNULIB_FSEEK@ && @REPLACE_FSEEK@
extern int rpl_fseek (FILE *fp, long offset, int whence);
# undef fseek
@@ -351,18 +221,20 @@ extern int rpl_fseek (FILE *fp, long offset, int whence);
# endif
#endif
-#if @GNULIB_FTELLO@
-# if @REPLACE_FTELLO@
-# define ftello rpl_ftello
-extern off_t ftello (FILE *fp);
-# define ftell(fp) ftello (fp)
+#if @GNULIB_FSEEKO@
+# if @REPLACE_FSEEKO@
+/* Provide fseek, fseeko functions that are aware of a preceding
+ fflush(), and which detect pipes. */
+# define fseeko rpl_fseeko
+extern int fseeko (FILE *fp, off_t offset, int whence);
+# define fseek(fp, offset, whence) fseeko (fp, (off_t)(offset), whence)
# endif
#elif defined GNULIB_POSIXCHECK
-# undef ftello
-# define ftello(f) \
- (GL_LINK_WARNING ("ftello is unportable - " \
- "use gnulib module ftello for portability"), \
- ftello (f))
+# undef fseeko
+# define fseeko(f,o,w) \
+ (GL_LINK_WARNING ("fseeko is unportable - " \
+ "use gnulib module fseeko for portability"), \
+ fseeko (f, o, w))
#endif
#if @GNULIB_FTELL@ && @REPLACE_FTELL@
@@ -387,87 +259,18 @@ extern long rpl_ftell (FILE *fp);
# endif
#endif
-#if @GNULIB_FFLUSH@
-# if @REPLACE_FFLUSH@
-# define fflush rpl_fflush
- /* Flush all pending data on STREAM according to POSIX rules. Both
- output and seekable input streams are supported.
- Note! LOSS OF DATA can occur if fflush is applied on an input stream
- that is _not_seekable_ or on an update stream that is _not_seekable_
- and in which the most recent operation was input. Seekability can
- be tested with lseek(fileno(fp),0,SEEK_CUR). */
- extern int fflush (FILE *gl_stream);
-# endif
-#elif defined GNULIB_POSIXCHECK
-# undef fflush
-# define fflush(f) \
- (GL_LINK_WARNING ("fflush is not always POSIX compliant - " \
- "use gnulib module fflush for portable " \
- "POSIX compliance"), \
- fflush (f))
-#endif
-
-#if @GNULIB_FPURGE@
-# if @REPLACE_FPURGE@
-# define fpurge rpl_fpurge
-# endif
-# if @REPLACE_FPURGE@ || !@HAVE_DECL_FPURGE@
- /* Discard all pending buffered I/O data on STREAM.
- STREAM must not be wide-character oriented.
- Return 0 if successful. Upon error, return -1 and set errno. */
- extern int fpurge (FILE *gl_stream);
-# endif
-#elif defined GNULIB_POSIXCHECK
-# undef fpurge
-# define fpurge(f) \
- (GL_LINK_WARNING ("fpurge is not always present - " \
- "use gnulib module fpurge for portability"), \
- fpurge (f))
-#endif
-
-#if @GNULIB_FCLOSE@
-# if @REPLACE_FCLOSE@
-# define fclose rpl_fclose
- /* Close STREAM and its underlying file descriptor. */
-extern int fclose (FILE *stream);
+#if @GNULIB_FTELLO@
+# if @REPLACE_FTELLO@
+# define ftello rpl_ftello
+extern off_t ftello (FILE *fp);
+# define ftell(fp) ftello (fp)
# endif
#elif defined GNULIB_POSIXCHECK
-# undef fclose
-# define fclose(f) \
- (GL_LINK_WARNING ("fclose is not always POSIX compliant - " \
- "use gnulib module fclose for portable " \
- "POSIX compliance"), \
- fclose (f))
-#endif
-
-#if @GNULIB_FPUTC@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
-# undef fputc
-# define fputc rpl_fputc
-extern int fputc (int c, FILE *stream);
-#endif
-
-#if @GNULIB_PUTC@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
-# undef putc
-# define putc rpl_fputc
-extern int putc (int c, FILE *stream);
-#endif
-
-#if @GNULIB_PUTCHAR@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
-# undef putchar
-# define putchar rpl_putchar
-extern int putchar (int c);
-#endif
-
-#if @GNULIB_FPUTS@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
-# undef fputs
-# define fputs rpl_fputs
-extern int fputs (const char *string, FILE *stream);
-#endif
-
-#if @GNULIB_PUTS@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
-# undef puts
-# define puts rpl_puts
-extern int puts (const char *string);
+# undef ftello
+# define ftello(f) \
+ (GL_LINK_WARNING ("ftello is unportable - " \
+ "use gnulib module ftello for portability"), \
+ ftello (f))
#endif
#if @GNULIB_FWRITE@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
@@ -517,6 +320,26 @@ extern ssize_t getline (char **lineptr, size_t *linesize, FILE *stream);
getline (l, s, f))
#endif
+#if @GNULIB_OBSTACK_PRINTF@
+# if @REPLACE_OBSTACK_PRINTF@
+# define obstack_printf rpl_osbtack_printf
+# define obstack_vprintf rpl_obstack_vprintf
+# endif
+# if @REPLACE_OBSTACK_PRINTF@ || !@HAVE_DECL_OBSTACK_PRINTF@
+ struct obstack;
+ /* Grow an obstack with formatted output. Return the number of
+ bytes added to OBS. No trailing nul byte is added, and the
+ object should be closed with obstack_finish before use. Upon
+ memory allocation error, call obstack_alloc_failed_handler. Upon
+ other error, return -1. */
+ extern int obstack_printf (struct obstack *obs, const char *format, ...)
+ __attribute__ ((__format__ (__printf__, 2, 3)));
+ extern int obstack_vprintf (struct obstack *obs, const char *format,
+ va_list args)
+ __attribute__ ((__format__ (__printf__, 2, 0)));
+# endif
+#endif
+
#if @GNULIB_PERROR@
# if @REPLACE_PERROR@
# define perror rpl_perror
@@ -533,6 +356,213 @@ extern void perror (const char *string);
perror (s))
#endif
+#if @GNULIB_POPEN@
+# if @REPLACE_POPEN@
+# undef popen
+# define popen rpl_popen
+extern FILE *popen (const char *cmd, const char *mode);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef popen
+# define popen(c,m) \
+ (GL_LINK_WARNING ("popen is buggy on some platforms - " \
+ "use gnulib module popen or pipe for more portability"), \
+ popen (c, m))
+#endif
+
+#if @GNULIB_PRINTF_POSIX@
+# if @REPLACE_PRINTF@
+/* Don't break __attribute__((format(printf,M,N))). */
+# define printf __printf__
+extern int printf (const char *format, ...)
+ __attribute__ ((__format__ (__printf__, 1, 2)));
+# endif
+#elif @GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
+/* Don't break __attribute__((format(printf,M,N))). */
+# define printf __printf__
+extern int printf (const char *format, ...)
+ __attribute__ ((__format__ (__printf__, 1, 2)));
+#elif defined GNULIB_POSIXCHECK
+# undef printf
+# define printf \
+ (GL_LINK_WARNING ("printf is not always POSIX compliant - " \
+ "use gnulib module printf-posix for portable " \
+ "POSIX compliance"), \
+ printf)
+/* Don't break __attribute__((format(printf,M,N))). */
+# define format(kind,m,n) format (__##kind##__, m, n)
+# define __format__(kind,m,n) __format__ (__##kind##__, m, n)
+# define ____printf____ __printf__
+# define ____scanf____ __scanf__
+# define ____strftime____ __strftime__
+# define ____strfmon____ __strfmon__
+#endif
+
+#if @GNULIB_PUTC@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
+# undef putc
+# define putc rpl_fputc
+extern int putc (int c, FILE *stream);
+#endif
+
+#if @GNULIB_PUTCHAR@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
+# undef putchar
+# define putchar rpl_putchar
+extern int putchar (int c);
+#endif
+
+#if @GNULIB_PUTS@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
+# undef puts
+# define puts rpl_puts
+extern int puts (const char *string);
+#endif
+
+#if @GNULIB_RENAME@
+# if @REPLACE_RENAME@
+# undef rename
+# define rename rpl_rename
+extern int rename (const char *old, const char *new);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef rename
+# define rename(o,n) \
+ (GL_LINK_WARNING ("rename is buggy on some platforms - " \
+ "use gnulib module rename for more portability"), \
+ rename (o, n))
+#endif
+
+#if @GNULIB_SNPRINTF@
+# if @REPLACE_SNPRINTF@
+# define snprintf rpl_snprintf
+# endif
+# if @REPLACE_SNPRINTF@ || !@HAVE_DECL_SNPRINTF@
+extern int snprintf (char *str, size_t size, const char *format, ...)
+ __attribute__ ((__format__ (__printf__, 3, 4)));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef snprintf
+# define snprintf \
+ (GL_LINK_WARNING ("snprintf is unportable - " \
+ "use gnulib module snprintf for portability"), \
+ snprintf)
+#endif
+
+#if @GNULIB_SPRINTF_POSIX@
+# if @REPLACE_SPRINTF@
+# define sprintf rpl_sprintf
+extern int sprintf (char *str, const char *format, ...)
+ __attribute__ ((__format__ (__printf__, 2, 3)));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef sprintf
+# define sprintf \
+ (GL_LINK_WARNING ("sprintf is not always POSIX compliant - " \
+ "use gnulib module sprintf-posix for portable " \
+ "POSIX compliance"), \
+ sprintf)
+#endif
+
+#if @GNULIB_VASPRINTF@
+# if @REPLACE_VASPRINTF@
+# define asprintf rpl_asprintf
+# define vasprintf rpl_vasprintf
+# endif
+# if @REPLACE_VASPRINTF@ || !@HAVE_VASPRINTF@
+ /* Write formatted output to a string dynamically allocated with malloc().
+ If the memory allocation succeeds, store the address of the string in
+ *RESULT and return the number of resulting bytes, excluding the trailing
+ NUL. Upon memory allocation error, or some other error, return -1. */
+ extern int asprintf (char **result, const char *format, ...)
+ __attribute__ ((__format__ (__printf__, 2, 3)));
+ extern int vasprintf (char **result, const char *format, va_list args)
+ __attribute__ ((__format__ (__printf__, 2, 0)));
+# endif
+#endif
+
+#if @GNULIB_VDPRINTF@
+# if @REPLACE_VDPRINTF@
+# define vdprintf rpl_vdprintf
+# endif
+# if @REPLACE_VDPRINTF@ || !@HAVE_VDPRINTF@
+extern int vdprintf (int fd, const char *format, va_list args)
+ __attribute__ ((__format__ (__printf__, 2, 0)));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef vdprintf
+# define vdprintf(d,f,a) \
+ (GL_LINK_WARNING ("vdprintf is unportable - " \
+ "use gnulib module vdprintf for portability"), \
+ vdprintf (d, f, a))
+#endif
+
+#if @GNULIB_VFPRINTF_POSIX@
+# if @REPLACE_VFPRINTF@
+# define vfprintf rpl_vfprintf
+extern int vfprintf (FILE *fp, const char *format, va_list args)
+ __attribute__ ((__format__ (__printf__, 2, 0)));
+# endif
+#elif @GNULIB_VFPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
+# define vfprintf rpl_vfprintf
+extern int vfprintf (FILE *fp, const char *format, va_list args)
+ __attribute__ ((__format__ (__printf__, 2, 0)));
+#elif defined GNULIB_POSIXCHECK
+# undef vfprintf
+# define vfprintf(s,f,a) \
+ (GL_LINK_WARNING ("vfprintf is not always POSIX compliant - " \
+ "use gnulib module vfprintf-posix for portable " \
+ "POSIX compliance"), \
+ vfprintf (s, f, a))
+#endif
+
+#if @GNULIB_VPRINTF_POSIX@
+# if @REPLACE_VPRINTF@
+# define vprintf rpl_vprintf
+extern int vprintf (const char *format, va_list args)
+ __attribute__ ((__format__ (__printf__, 1, 0)));
+# endif
+#elif @GNULIB_VPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
+# define vprintf rpl_vprintf
+extern int vprintf (const char *format, va_list args)
+ __attribute__ ((__format__ (__printf__, 1, 0)));
+#elif defined GNULIB_POSIXCHECK
+# undef vprintf
+# define vprintf(f,a) \
+ (GL_LINK_WARNING ("vprintf is not always POSIX compliant - " \
+ "use gnulib module vprintf-posix for portable " \
+ "POSIX compliance"), \
+ vprintf (f, a))
+#endif
+
+#if @GNULIB_VSNPRINTF@
+# if @REPLACE_VSNPRINTF@
+# define vsnprintf rpl_vsnprintf
+# endif
+# if @REPLACE_VSNPRINTF@ || !@HAVE_DECL_VSNPRINTF@
+extern int vsnprintf (char *str, size_t size, const char *format, va_list args)
+ __attribute__ ((__format__ (__printf__, 3, 0)));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef vsnprintf
+# define vsnprintf(b,s,f,a) \
+ (GL_LINK_WARNING ("vsnprintf is unportable - " \
+ "use gnulib module vsnprintf for portability"), \
+ vsnprintf (b, s, f, a))
+#endif
+
+#if @GNULIB_VSPRINTF_POSIX@
+# if @REPLACE_VSPRINTF@
+# define vsprintf rpl_vsprintf
+extern int vsprintf (char *str, const char *format, va_list args)
+ __attribute__ ((__format__ (__printf__, 2, 0)));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef vsprintf
+# define vsprintf(b,f,a) \
+ (GL_LINK_WARNING ("vsprintf is not always POSIX compliant - " \
+ "use gnulib module vsprintf-posix for portable " \
+ "POSIX compliance"), \
+ vsprintf (b, f, a))
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/gnulib/lib/stdlib.in.h b/gnulib/lib/stdlib.in.h
index f99767f6..9ac71995 100644
--- a/gnulib/lib/stdlib.in.h
+++ b/gnulib/lib/stdlib.in.h
@@ -35,6 +35,8 @@
#ifndef _GL_STDLIB_H
#define _GL_STDLIB_H
+/* NetBSD 5.0 mis-defines NULL. */
+#include <stddef.h>
/* Solaris declares getloadavg() in <sys/loadavg.h>. */
#if @GNULIB_GETLOADAVG@ && @HAVE_SYS_LOADAVG_H@
@@ -205,6 +207,31 @@ extern char * mkdtemp (char * /*template*/);
#endif
+#if @GNULIB_MKOSTEMP@
+# if !@HAVE_MKOSTEMP@
+/* Create a unique temporary file from TEMPLATE.
+ The last six characters of TEMPLATE must be "XXXXXX";
+ they are replaced with a string that makes the file name unique.
+ The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
+ and O_TEXT, O_BINARY (defined in "binary-io.h").
+ The file is then created, with the specified flags, ensuring it didn't exist
+ before.
+ The file is created read-write (mask at least 0600 & ~umask), but it may be
+ world-readable and world-writable (mask 0666 & ~umask), depending on the
+ implementation.
+ Returns the open file descriptor if successful, otherwise -1 and errno
+ set. */
+extern int mkostemp (char * /*template*/, int /*flags*/);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef mkostemp
+# define mkostemp(t,f) \
+ (GL_LINK_WARNING ("mkostemp is unportable - " \
+ "use gnulib module mkostemp for portability"), \
+ mkostemp (t, f))
+#endif
+
+
#if @GNULIB_MKSTEMP@
# if @REPLACE_MKSTEMP@
/* Create a unique temporary file from TEMPLATE.
diff --git a/gnulib/lib/strdup.c b/gnulib/lib/strdup.c
new file mode 100644
index 00000000..bebe5c8f
--- /dev/null
+++ b/gnulib/lib/strdup.c
@@ -0,0 +1,55 @@
+/* Copyright (C) 1991, 1996, 1997, 1998, 2002, 2003, 2004, 2006, 2007 Free
+ Software Foundation, Inc.
+
+ This file is part of the GNU C Library.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+
+#ifndef _LIBC
+# include <config.h>
+#endif
+
+/* Get specification. */
+#include <string.h>
+
+#include <stdlib.h>
+
+#undef __strdup
+#ifdef _LIBC
+# undef strdup
+#endif
+
+#ifndef weak_alias
+# define __strdup strdup
+#endif
+
+/* Duplicate S, returning an identical malloc'd string. */
+char *
+__strdup (const char *s)
+{
+ size_t len = strlen (s) + 1;
+ void *new = malloc (len);
+
+ if (new == NULL)
+ return NULL;
+
+ return (char *) memcpy (new, s, len);
+}
+#ifdef libc_hidden_def
+libc_hidden_def (__strdup)
+#endif
+#ifdef weak_alias
+weak_alias (__strdup, strdup)
+#endif
diff --git a/gnulib/lib/string.in.h b/gnulib/lib/string.in.h
index 97da28fb..3d0c7d1d 100644
--- a/gnulib/lib/string.in.h
+++ b/gnulib/lib/string.in.h
@@ -28,6 +28,8 @@
#ifndef _GL_STRING_H
#define _GL_STRING_H
+/* NetBSD 5.0 mis-defines NULL. */
+#include <stddef.h>
#ifndef __attribute__
/* This feature is available in gcc versions 2.5 and later. */
@@ -201,11 +203,11 @@ extern char *strdup (char const *__s);
/* Return a newly allocated copy of at most N bytes of STRING. */
#if @GNULIB_STRNDUP@
-# if ! @HAVE_STRNDUP@
+# if @REPLACE_STRNDUP@
# undef strndup
# define strndup rpl_strndup
# endif
-# if ! @HAVE_STRNDUP@ || ! @HAVE_DECL_STRNDUP@
+# if @REPLACE_STRNDUP@ || ! @HAVE_DECL_STRNDUP@
extern char *strndup (char const *__string, size_t __n);
# endif
#elif defined GNULIB_POSIXCHECK
@@ -397,7 +399,13 @@ extern char *strcasestr (const char *haystack, const char *needle)
See also strsep(). */
#if @GNULIB_STRTOK_R@
-# if ! @HAVE_DECL_STRTOK_R@
+# if @REPLACE_STRTOK_R@
+# undef strtok_r
+# define strtok_r rpl_strtok_r
+# elif @UNDEFINE_STRTOK_R@
+# undef strtok_r
+# endif
+# if ! @HAVE_DECL_STRTOK_R@ || @REPLACE_STRTOK_R@
extern char *strtok_r (char *restrict s, char const *restrict delim,
char **restrict save_ptr);
# endif
diff --git a/gnulib/lib/sys_select.in.h b/gnulib/lib/sys_select.in.h
index e87b7d04..7d392a04 100644
--- a/gnulib/lib/sys_select.in.h
+++ b/gnulib/lib/sys_select.in.h
@@ -42,9 +42,13 @@
# include <sys/types.h>
/* On OSF/1 4.0, <sys/select.h> provides only a forward declaration
- of 'struct timeval', and no definition of this type.. */
+ of 'struct timeval', and no definition of this type. */
# include <sys/time.h>
+/* On Solaris 10, <sys/select.h> provides an FD_ZERO implementation
+ that relies on memset(), but without including <string.h>. */
+# include <string.h>
+
/* The include_next requires a split double-inclusion guard. */
# @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@
diff --git a/gnulib/lib/sys_socket.in.h b/gnulib/lib/sys_socket.in.h
index 26577dfa..16a75684 100644
--- a/gnulib/lib/sys_socket.in.h
+++ b/gnulib/lib/sys_socket.in.h
@@ -423,5 +423,32 @@ extern int rpl_shutdown (int, int);
#endif /* HAVE_SYS_SOCKET_H */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if @GNULIB_ACCEPT4@
+/* Accept a connection on a socket, with specific opening flags.
+ The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
+ and O_TEXT, O_BINARY (defined in "binary-io.h").
+ See also the Linux man page at
+ <http://www.kernel.org/doc/man-pages/online/pages/man2/accept4.2.html>. */
+# if @HAVE_ACCEPT4@
+# define accept4 rpl_accept4
+# endif
+extern int accept4 (int sockfd, struct sockaddr *addr, socklen_t *addrlen,
+ int flags);
+#elif defined GNULIB_POSIXCHECK
+# undef accept4
+# define accept4(s,a,l,f) \
+ (GL_LINK_WARNING ("accept4 is unportable - " \
+ "use gnulib module accept4 for portability"), \
+ accept4 (s, a, l, f))
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _GL_SYS_SOCKET_H */
#endif /* _GL_SYS_SOCKET_H */
diff --git a/gnulib/lib/sys_stat.in.h b/gnulib/lib/sys_stat.in.h
index 1e6294da..9d5a2f9a 100644
--- a/gnulib/lib/sys_stat.in.h
+++ b/gnulib/lib/sys_stat.in.h
@@ -303,6 +303,77 @@ extern int rpl_lstat (const char *name, struct stat *buf);
#endif
+#if @GNULIB_FCHMODAT@
+# if !@HAVE_FCHMODAT@
+extern int fchmodat (int fd, char const *file, mode_t mode, int flag);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef fchmodat
+# define fchmodat(d,n,m,f) \
+ (GL_LINK_WARNING ("fchmodat is not portable - " \
+ "use gnulib module openat for portability"), \
+ fchmodat (d, n, m, f))
+#endif
+
+
+#if @GNULIB_FSTATAT@
+# if @REPLACE_FSTATAT@
+# undef fstatat
+# define fstatat rpl_fstatat
+# endif
+# if !@HAVE_FSTATAT@ || @REPLACE_FSTATAT@
+extern int fstatat (int fd, char const *name, struct stat *st, int flags);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef fstatat
+# define fstatat(d,n,s,f) \
+ (GL_LINK_WARNING ("fstatat is not portable - " \
+ "use gnulib module openat for portability"), \
+ fstatat (d, n, s, f))
+#endif
+
+
+#if @GNULIB_MKDIRAT@
+# if !@HAVE_MKDIRAT@
+extern int mkdirat (int fd, char const *file, mode_t mode);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef mkdirat
+# define mkdirat(d,n,m) \
+ (GL_LINK_WARNING ("mkdirat is not portable - " \
+ "use gnulib module openat for portability"), \
+ mkdirat (d, n, m))
+#endif
+
+#if @GNULIB_MKFIFOAT@
+# if !@HAVE_MKFIFOAT@
+int mkfifoat (int fd, char const *file, mode_t mode);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef mkfifoat
+# define mkfifoat(d,n,m) \
+ (GL_LINK_WARNING ("mkfifoat is not portable - " \
+ "use gnulib module mkfifoat for portability"), \
+ mkfifoat (d, n, m))
+#endif
+
+#if @GNULIB_MKNODAT@
+# if !@HAVE_MKNODAT@
+int mknodat (int fd, char const *file, mode_t mode, dev_t dev);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef mknodat
+# define mknodat(f,n,m,d) \
+ (GL_LINK_WARNING ("mknodat is not portable - " \
+ "use gnulib module mkfifoat for portability"), \
+ mknodat (f, n, m, d))
+#endif
+
+#if @REPLACE_FCHDIR@
+# define fstat rpl_fstat
+extern int fstat (int fd, struct stat *buf);
+#endif
+
#if @REPLACE_MKDIR@
# undef mkdir
# define mkdir rpl_mkdir
diff --git a/gnulib/lib/tempname.c b/gnulib/lib/tempname.c
index 5a3a3260..41021344 100644
--- a/gnulib/lib/tempname.c
+++ b/gnulib/lib/tempname.c
@@ -1,7 +1,7 @@
/* tempname.c - generate the name of a temporary file.
Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2005, 2006, 2007 Free Software Foundation,
+ 2000, 2001, 2002, 2003, 2005, 2006, 2007, 2009 Free Software Foundation,
Inc.
This program is free software: you can redistribute it and/or modify
@@ -40,8 +40,7 @@
# define TMP_MAX 238328
#endif
#ifndef __GT_FILE
-# define __GT_FILE 0
-# define __GT_BIGFILE 1
+# define __GT_FILE 1
# define __GT_DIR 2
# define __GT_NOCREATE 3
#endif
@@ -59,12 +58,9 @@
#if _LIBC
# define struct_stat64 struct stat64
-# define small_open __open
-# define large_open __open64
#else
# define struct_stat64 struct stat
-# define small_open open
-# define large_open open
+# define __open open
# define __gen_tempname gen_tempname
# define __getpid getpid
# define __gettimeofday gettimeofday
@@ -192,12 +188,11 @@ static const char letters[] =
at the time of the call.
__GT_FILE: create the file using open(O_CREAT|O_EXCL)
and return a read-write fd. The file is mode 0600.
- __GT_BIGFILE: same as __GT_FILE but use open64().
__GT_DIR: create a directory, which will be mode 0700.
We use a clever algorithm to get hard-to-predict names. */
int
-__gen_tempname (char *tmpl, int kind)
+__gen_tempname (char *tmpl, int flags, int kind)
{
int len;
char *XXXXXX;
@@ -266,11 +261,9 @@ __gen_tempname (char *tmpl, int kind)
switch (kind)
{
case __GT_FILE:
- fd = small_open (tmpl, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
- break;
-
- case __GT_BIGFILE:
- fd = large_open (tmpl, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
+ fd = __open (tmpl,
+ (flags & ~0777) | O_RDWR | O_CREAT | O_EXCL,
+ S_IRUSR | S_IWUSR);
break;
case __GT_DIR:
diff --git a/gnulib/lib/tempname.h b/gnulib/lib/tempname.h
index 74da03b3..edf70743 100644
--- a/gnulib/lib/tempname.h
+++ b/gnulib/lib/tempname.h
@@ -1,6 +1,6 @@
/* Create a temporary file or directory.
- Copyright (C) 2006 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -17,8 +17,6 @@
/* header written by Eric Blake */
-/* In gnulib, always prefer large files. GT_FILE maps to
- __GT_BIGFILE, not __GT_FILE, for a reason. */
#define GT_FILE 1
#define GT_DIR 2
#define GT_NOCREATE 3
@@ -36,4 +34,4 @@
GT_DIR: create a directory, which will be mode 0700.
We use a clever algorithm to get hard-to-predict names. */
-extern int gen_tempname (char *tmpl, int kind);
+extern int gen_tempname (char *tmpl, int flags, int kind);
diff --git a/gnulib/lib/unistd.in.h b/gnulib/lib/unistd.in.h
index 09e90392..c749cbe5 100644
--- a/gnulib/lib/unistd.in.h
+++ b/gnulib/lib/unistd.in.h
@@ -29,6 +29,9 @@
#ifndef _GL_UNISTD_H
#define _GL_UNISTD_H
+/* NetBSD 5.0 mis-defines NULL. Also get size_t. */
+#include <stddef.h>
+
/* mingw doesn't define the SEEK_* or *_FILENO macros in <unistd.h>. */
#if !(defined SEEK_CUR && defined SEEK_END && defined SEEK_SET)
# include <stdio.h>
@@ -43,6 +46,11 @@
# include <sys/types.h>
#endif
+/* Get getopt(), optarg, optind, opterr, optopt. */
+#if @GNULIB_UNISTD_H_GETOPT@
+# include <getopt.h>
+#endif
+
#if @GNULIB_GETHOSTNAME@
/* Get all possible declarations of gethostname(). */
# if @UNISTD_H_HAVE_WINSOCK2_H@
@@ -98,6 +106,15 @@
# define STDERR_FILENO 2
#endif
+/* Ensure *_OK functions exist. */
+#ifndef F_OK
+# define F_OK 0
+# define X_OK 1
+# define W_OK 2
+# define R_OK 4
+#endif
+
+
/* Declare overridden functions. */
#ifdef __cplusplus
@@ -130,6 +147,72 @@ extern int chown (const char *file, uid_t uid, gid_t gid);
#endif
+#if @GNULIB_FCHOWNAT@
+# if @REPLACE_FCHOWNAT@
+# undef fchownat
+# define fchownat rpl_fchownat
+# endif
+# if !@HAVE_FCHOWNAT@ || @REPLACE_FCHOWNAT@
+extern int fchownat (int fd, char const *file, uid_t owner, gid_t group, int flag);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef fchownat
+# define fchownat(d,n,o,g,f) \
+ (GL_LINK_WARNING ("fchownat is not portable - " \
+ "use gnulib module openat for portability"), \
+ fchownat (d, n, o, g, f))
+#endif
+
+
+#if @GNULIB_UNLINKAT@
+# if !@HAVE_UNLINKAT@
+extern int unlinkat (int fd, char const *file, int flag);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef unlinkat
+# define unlinkat(d,n,f) \
+ (GL_LINK_WARNING ("unlinkat is not portable - " \
+ "use gnulib module openat for portability"), \
+ unlinkat (d, n, f))
+#endif
+
+
+#if @GNULIB_FACCESSAT@
+# if !@HAVE_FACCESSAT@
+int faccessat (int fd, char const *file, int mode, int flag);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef faccessat
+# define faccessat(d,n,m,f) \
+ (GL_LINK_WARNING ("faccessat is not portable - " \
+ "use gnulib module faccessat for portability"), \
+ faccessat (d, n, m, f))
+#endif
+
+#if @GNULIB_SYMLINKAT@
+# if !@HAVE_SYMLINKAT@
+int symlinkat (char const *contents, int fd, char const *file);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef symlinkat
+# define symlinkat(c,d,n) \
+ (GL_LINK_WARNING ("symlinkat is not portable - " \
+ "use gnulib module symlinkat for portability"), \
+ symlinkat (c, d, n))
+#endif
+
+#if @GNULIB_READLINKAT@
+# if !@HAVE_READLINKAT@
+ssize_t readlinkat (int fd, char const *file, char *buf, size_t len);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef readlinkat
+# define readlinkat(d,n,b,l) \
+ (GL_LINK_WARNING ("readlinkat is not portable - " \
+ "use gnulib module symlinkat for portability"), \
+ readlinkat (d, n, b, l))
+#endif
+
#if @GNULIB_CLOSE@
# if @REPLACE_CLOSE@
/* Automatically included by modules that need a replacement for close. */
@@ -137,7 +220,7 @@ extern int chown (const char *file, uid_t uid, gid_t gid);
# define close rpl_close
extern int close (int);
# endif
-#elif @UNISTD_H_HAVE_WINSOCK2_H@
+#elif @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
# undef close
# define close close_used_without_requesting_gnulib_module_close
#elif defined GNULIB_POSIXCHECK
@@ -170,6 +253,28 @@ extern int dup2 (int oldfd, int newfd);
#endif
+#if @GNULIB_DUP3@
+/* Copy the file descriptor OLDFD into file descriptor NEWFD, with the
+ specified flags.
+ The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
+ and O_TEXT, O_BINARY (defined in "binary-io.h").
+ Close NEWFD first if it is open.
+ Return newfd if successful, otherwise -1 and errno set.
+ See the Linux man page at
+ <http://www.kernel.org/doc/man-pages/online/pages/man2/dup3.2.html>. */
+# if @HAVE_DUP3@
+# define dup3 rpl_dup3
+# endif
+extern int dup3 (int oldfd, int newfd, int flags);
+#elif defined GNULIB_POSIXCHECK
+# undef dup3
+# define dup3(o,n,f) \
+ (GL_LINK_WARNING ("dup3 is unportable - " \
+ "use gnulib module dup3 for portability"), \
+ dup3 (o, n, f))
+#endif
+
+
#if @GNULIB_ENVIRON@
# if !@HAVE_DECL_ENVIRON@
/* Set of environment variables and values. An array of strings of the form
@@ -218,11 +323,11 @@ extern int fchdir (int /*fd*/);
# define dup rpl_dup
extern int dup (int);
-# if @REPLACE_DUP2@
-# undef dup2
-# endif
-# define dup2 rpl_dup2_fchdir
-extern int dup2 (int, int);
+/* Gnulib internal hooks needed to maintain the fchdir metadata. */
+extern int _gl_register_fd (int fd, const char *filename);
+extern void _gl_unregister_fd (int fd);
+extern int _gl_register_dup (int oldfd, int newfd);
+extern const char *_gl_directory_name (int fd);
# endif
#elif defined GNULIB_POSIXCHECK
@@ -320,7 +425,8 @@ extern int getdomainname(char *name, size_t len);
#if @GNULIB_GETDTABLESIZE@
# if !@HAVE_GETDTABLESIZE@
-/* Return the maximum number of file descriptors in the current process. */
+/* Return the maximum number of file descriptors in the current process.
+ In POSIX, this is same as sysconf (_SC_OPEN_MAX). */
extern int getdtablesize (void);
# endif
#elif defined GNULIB_POSIXCHECK
@@ -370,7 +476,6 @@ extern int gethostname(char *name, size_t len);
See <http://www.opengroup.org/susv3xsh/getlogin.html>.
*/
# if !@HAVE_DECL_GETLOGIN_R@
-# include <stddef.h>
extern int getlogin_r (char *name, size_t size);
# endif
#elif defined GNULIB_POSIXCHECK
@@ -490,11 +595,14 @@ extern int lchown (char const *file, uid_t owner, gid_t group);
#if @GNULIB_LINK@
+# if @REPLACE_LINK@
+# define link rpl_link
+# endif
/* Create a new hard link for an existing file.
Return 0 if successful, otherwise -1 and errno set.
See POSIX:2001 specification
<http://www.opengroup.org/susv3xsh/link.html>. */
-# if !@HAVE_LINK@
+# if !@HAVE_LINK@ || @REPLACE_LINK@
extern int link (const char *path1, const char *path2);
# endif
#elif defined GNULIB_POSIXCHECK
@@ -524,6 +632,28 @@ extern int link (const char *path1, const char *path2);
#endif
+#if @GNULIB_PIPE2@
+/* Create a pipe, applying the given flags when opening the read-end of the
+ pipe and the write-end of the pipe.
+ The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
+ and O_TEXT, O_BINARY (defined in "binary-io.h").
+ Store the read-end as fd[0] and the write-end as fd[1].
+ Return 0 upon success, or -1 with errno set upon failure.
+ See also the Linux man page at
+ <http://www.kernel.org/doc/man-pages/online/pages/man2/pipe2.2.html>. */
+# if @HAVE_PIPE2@
+# define pipe2 rpl_pipe2
+# endif
+extern int pipe2 (int fd[2], int flags);
+#elif defined GNULIB_POSIXCHECK
+# undef pipe2
+# define pipe2(f,o) \
+ (GL_LINK_WARNING ("pipe2 is unportable - " \
+ "use gnulib module pipe2 for portability"), \
+ pipe2 (f, o))
+#endif
+
+
#if @GNULIB_READLINK@
/* Read the contents of the symbolic link FILE and place the first BUFSIZE
bytes of it into BUF. Return the number of bytes placed into BUF if
@@ -531,7 +661,6 @@ extern int link (const char *path1, const char *path2);
See the POSIX:2001 specification
<http://www.opengroup.org/susv3xsh/readlink.html>. */
# if !@HAVE_READLINK@
-# include <stddef.h>
extern int readlink (const char *file, char *buf, size_t bufsize);
# endif
#elif defined GNULIB_POSIXCHECK
@@ -570,12 +699,6 @@ extern ssize_t write (int fd, const void *buf, size_t count);
#endif
-#ifdef FCHDIR_REPLACEMENT
-/* gnulib internal function. */
-extern void _gl_unregister_fd (int fd);
-#endif
-
-
#ifdef __cplusplus
}
#endif
diff --git a/gnulib/lib/vasnprintf.c b/gnulib/lib/vasnprintf.c
index 7ac9f436..e47e00c7 100644
--- a/gnulib/lib/vasnprintf.c
+++ b/gnulib/lib/vasnprintf.c
@@ -257,7 +257,7 @@ local_wcsnlen (const wchar_t *s, size_t maxlen)
# ifndef decimal_point_char_defined
# define decimal_point_char_defined 1
static char
-decimal_point_char ()
+decimal_point_char (void)
{
const char *point;
/* Determine it in a multithread-safe way. We know nl_langinfo is
@@ -5476,6 +5476,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
#undef TCHARS_PER_DCHAR
#undef SNPRINTF
#undef USE_SNPRINTF
+#undef DCHAR_SET
#undef DCHAR_CPY
#undef PRINTF_PARSE
#undef DIRECTIVES
diff --git a/gnulib/lib/wctype.in.h b/gnulib/lib/wctype.in.h
index f008d8ff..71df686c 100644
--- a/gnulib/lib/wctype.in.h
+++ b/gnulib/lib/wctype.in.h
@@ -1,6 +1,6 @@
/* A substitute for ISO C99 <wctype.h>, for platforms that lack it.
- Copyright (C) 2006-2008 Free Software Foundation, Inc.
+ Copyright (C) 2006-2009 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -84,6 +84,8 @@
# undef iswspace
# undef iswupper
# undef iswxdigit
+# undef towlower
+# undef towupper
/* Linux libc5 has <wctype.h> and the functions but they are broken. */
# if @REPLACE_ISWCNTRL@
@@ -99,6 +101,8 @@
# define iswspace rpl_iswspace
# define iswupper rpl_iswupper
# define iswxdigit rpl_iswxdigit
+# define towlower rpl_towlower
+# define towupper rpl_towupper
# endif
static inline int
@@ -178,7 +182,50 @@ iswxdigit (wint_t wc)
|| ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'F'));
}
+static inline wint_t
+towlower (wint_t wc)
+{
+ return (wc >= 'A' && wc <= 'Z' ? wc - 'A' + 'a' : wc);
+}
+
+static inline wint_t
+towupper (wint_t wc)
+{
+ return (wc >= 'a' && wc <= 'z' ? wc - 'a' + 'A' : wc);
+}
+
# endif /* ! HAVE_ISWCNTRL */
+# if defined __MINGW32__
+
+/* On native Windows, wchar_t is uint16_t, and wint_t is uint32_t.
+ The functions towlower and towupper are implemented in the MSVCRT library
+ to take a wchar_t argument and return a wchar_t result. mingw declares
+ these functions to take a wint_t argument and return a wint_t result.
+ This means that:
+ 1. When the user passes an argument outside the range 0x0000..0xFFFF, the
+ function will look only at the lower 16 bits. This is allowed according
+ to POSIX.
+ 2. The return value is returned in the lower 16 bits of the result register.
+ The upper 16 bits are random: whatever happened to be in that part of the
+ result register. We need to fix this by adding a zero-extend from
+ wchar_t to wint_t after the call. */
+
+static inline wint_t
+rpl_towlower (wint_t wc)
+{
+ return (wint_t) (wchar_t) towlower (wc);
+}
+# define towlower rpl_towlower
+
+static inline wint_t
+rpl_towupper (wint_t wc)
+{
+ return (wint_t) (wchar_t) towupper (wc);
+}
+# define towupper rpl_towupper
+
+# endif
+
#endif /* _GL_WCTYPE_H */
#endif /* _GL_WCTYPE_H */