diff options
author | Simon Josefsson <simon@josefsson.org> | 2009-08-28 17:55:23 +0200 |
---|---|---|
committer | Simon Josefsson <simon@josefsson.org> | 2009-08-28 17:55:23 +0200 |
commit | 2b261fe6eab61b0b312836c08c6aa084afe9d0ec (patch) | |
tree | 2f204db6d4a5e3725e6154baf8ae63b3e4d20da1 /gl | |
parent | eff570b8fdba308c2d4dc2ea397f397d2968edbe (diff) | |
download | gnutls-2b261fe6eab61b0b312836c08c6aa084afe9d0ec.tar.gz |
Update gnulib files.
Diffstat (limited to 'gl')
-rw-r--r-- | gl/Makefile.am | 94 | ||||
-rw-r--r-- | gl/m4/gnulib-comp.m4 | 1 | ||||
-rw-r--r-- | gl/m4/stdlib_h.m4 | 4 | ||||
-rw-r--r-- | gl/m4/sys_socket_h.m4 | 4 | ||||
-rw-r--r-- | gl/m4/unistd_h.m4 | 6 | ||||
-rw-r--r-- | gl/progname.c | 8 | ||||
-rw-r--r-- | gl/stdlib.in.h | 25 | ||||
-rw-r--r-- | gl/sys_socket.in.h | 27 | ||||
-rw-r--r-- | gl/tests/Makefile.am | 6 | ||||
-rw-r--r-- | gl/unistd.in.h | 47 | ||||
-rw-r--r-- | gl/vasnprintf.c | 2 |
11 files changed, 174 insertions, 50 deletions
diff --git a/gl/Makefile.am b/gl/Makefile.am index 10f61377f9..01cf02beae 100644 --- a/gl/Makefile.am +++ b/gl/Makefile.am @@ -73,9 +73,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 @@ -90,8 +91,8 @@ BUILT_SOURCES += $(ARPA_INET_H) # We need the following in order to create <arpa/inet.h> when the system # doesn't have one. arpa/inet.h: arpa_inet.in.h - @MKDIR_P@ arpa - rm -f $@-t $@ + $(AM_V_at)@MKDIR_P@ arpa + $(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' \ @@ -103,7 +104,7 @@ arpa/inet.h: arpa_inet.in.h -e 's|@''HAVE_DECL_INET_PTON''@|$(HAVE_DECL_INET_PTON)|g' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ < $(srcdir)/arpa_inet.in.h; \ - } > $@-t + } > $@-t && \ mv $@-t $@ MOSTLYCLEANFILES += arpa/inet.h arpa/inet.h-t MOSTLYCLEANDIRS += arpa @@ -160,7 +161,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' \ @@ -172,7 +173,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 @@ -205,13 +206,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 @@ -389,7 +390,7 @@ BUILT_SOURCES += $(NETDB_H) # We need the following in order to create <netdb.h> when the system # doesn't have one that works with the given compiler. netdb.h: netdb.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' \ @@ -402,7 +403,7 @@ netdb.h: netdb.in.h -e 's|@''HAVE_DECL_GETADDRINFO''@|$(HAVE_DECL_GETADDRINFO)|g' \ -e 's|@''HAVE_DECL_GETNAMEINFO''@|$(HAVE_DECL_GETNAMEINFO)|g' \ < $(srcdir)/netdb.in.h; \ - } > $@-t + } > $@-t && \ mv $@-t $@ MOSTLYCLEANFILES += netdb.h netdb.h-t @@ -417,15 +418,15 @@ BUILT_SOURCES += $(NETINET_IN_H) # We need the following in order to create <netinet/in.h> when the system # doesn't have one. netinet/in.h: netinet_in.in.h - @MKDIR_P@ netinet - rm -f $@-t $@ + $(AM_V_at)@MKDIR_P@ netinet + $(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_NETINET_IN_H''@|$(NEXT_NETINET_IN_H)|g' \ -e 's|@''HAVE_NETINET_IN_H''@|$(HAVE_NETINET_IN_H)|g' \ < $(srcdir)/netinet_in.in.h; \ - } > $@-t + } > $@-t && \ mv $@-t $@ MOSTLYCLEANFILES += netinet/in.h netinet/in.h-t MOSTLYCLEANDIRS += netinet @@ -567,13 +568,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 @@ -588,10 +589,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 @@ -606,7 +607,7 @@ 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 - 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' \ @@ -614,7 +615,7 @@ stddef.h: stddef.in.h -e 's|@''HAVE_WCHAR_T''@|$(HAVE_WCHAR_T)|g' \ -e 's|@''REPLACE_NULL''@|$(REPLACE_NULL)|g' \ < $(srcdir)/stddef.in.h; \ - } > $@-t + } > $@-t && \ mv $@-t $@ MOSTLYCLEANFILES += stddef.h stddef.h-t @@ -629,7 +630,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' \ @@ -656,7 +657,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 @@ -671,7 +672,7 @@ 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' \ @@ -749,7 +750,7 @@ stdio.h: stdio.in.h -e 's|@''REPLACE_PERROR''@|$(REPLACE_PERROR)|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 @@ -766,7 +767,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' \ @@ -779,6 +780,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' \ @@ -793,6 +795,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' \ @@ -810,7 +813,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 @@ -834,7 +837,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' \ @@ -899,7 +902,7 @@ string.h: string.in.h -e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|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 @@ -914,8 +917,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' \ @@ -926,7 +929,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 @@ -942,7 +945,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' \ @@ -963,13 +967,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 @@ -985,8 +991,8 @@ 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' \ @@ -999,7 +1005,7 @@ sys/stat.h: sys_stat.in.h -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 @@ -1015,8 +1021,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' \ @@ -1025,7 +1031,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 @@ -1040,7 +1046,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' \ @@ -1049,6 +1055,7 @@ 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_FCHDIR''@|$(GNULIB_FCHDIR)|g' \ @@ -1064,12 +1071,14 @@ 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_SLEEP''@|$(GNULIB_SLEEP)|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_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_FSYNC''@|$(HAVE_FSYNC)|g' \ -e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \ @@ -1079,6 +1088,7 @@ 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_SLEEP''@|$(HAVE_SLEEP)|g' \ -e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \ @@ -1098,7 +1108,7 @@ unistd.h: unistd.in.h -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 @@ -1148,7 +1158,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' \ @@ -1191,7 +1201,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 diff --git a/gl/m4/gnulib-comp.m4 b/gl/m4/gnulib-comp.m4 index e471c1cae8..fb65350e03 100644 --- a/gl/m4/gnulib-comp.m4 +++ b/gl/m4/gnulib-comp.m4 @@ -125,6 +125,7 @@ AC_SUBST([LTALLOCA]) gl_FUNC_PERROR gl_STRING_MODULE_INDICATOR([perror]) gl_PMCCABE2HTML + AC_CHECK_DECLS([program_invocation_name], [], [], [#include <errno.h>]) gl_FUNC_READ_FILE gl_FUNC_READLINE gl_FUNC_REALLOC_POSIX diff --git a/gl/m4/stdlib_h.m4 b/gl/m4/stdlib_h.m4 index b295f16b27..89ac97fb92 100644 --- a/gl/m4/stdlib_h.m4 +++ b/gl/m4/stdlib_h.m4 @@ -1,4 +1,4 @@ -# stdlib_h.m4 serial 15 +# stdlib_h.m4 serial 16 dnl Copyright (C) 2007-2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -40,6 +40,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS], GNULIB_GETLOADAVG=0; AC_SUBST([GNULIB_GETLOADAVG]) GNULIB_GETSUBOPT=0; AC_SUBST([GNULIB_GETSUBOPT]) GNULIB_MKDTEMP=0; AC_SUBST([GNULIB_MKDTEMP]) + GNULIB_MKOSTEMP=0; AC_SUBST([GNULIB_MKOSTEMP]) GNULIB_MKSTEMP=0; AC_SUBST([GNULIB_MKSTEMP]) GNULIB_PUTENV=0; AC_SUBST([GNULIB_PUTENV]) GNULIB_RANDOM_R=0; AC_SUBST([GNULIB_RANDOM_R]) @@ -55,6 +56,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS], HAVE_GETSUBOPT=1; AC_SUBST([HAVE_GETSUBOPT]) HAVE_MALLOC_POSIX=1; AC_SUBST([HAVE_MALLOC_POSIX]) HAVE_MKDTEMP=1; AC_SUBST([HAVE_MKDTEMP]) + HAVE_MKOSTEMP=1; AC_SUBST([HAVE_MKOSTEMP]) HAVE_REALLOC_POSIX=1; AC_SUBST([HAVE_REALLOC_POSIX]) HAVE_RANDOM_R=1; AC_SUBST([HAVE_RANDOM_R]) HAVE_RPMATCH=1; AC_SUBST([HAVE_RPMATCH]) diff --git a/gl/m4/sys_socket_h.m4 b/gl/m4/sys_socket_h.m4 index d4873fa810..e864b2c7e2 100644 --- a/gl/m4/sys_socket_h.m4 +++ b/gl/m4/sys_socket_h.m4 @@ -1,4 +1,4 @@ -# sys_socket_h.m4 serial 12 +# sys_socket_h.m4 serial 13 dnl Copyright (C) 2005-2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -140,6 +140,8 @@ AC_DEFUN([gl_SYS_SOCKET_H_DEFAULTS], GNULIB_SENDTO=0; AC_SUBST([GNULIB_SENDTO]) GNULIB_SETSOCKOPT=0; AC_SUBST([GNULIB_SETSOCKOPT]) GNULIB_SHUTDOWN=0; AC_SUBST([GNULIB_SHUTDOWN]) + GNULIB_ACCEPT4=0; AC_SUBST([GNULIB_ACCEPT4]) HAVE_STRUCT_SOCKADDR_STORAGE=1; AC_SUBST([HAVE_STRUCT_SOCKADDR_STORAGE]) HAVE_SA_FAMILY_T=1; AC_SUBST([HAVE_SA_FAMILY_T]) + HAVE_ACCEPT4=1; AC_SUBST([HAVE_ACCEPT4]) ]) diff --git a/gl/m4/unistd_h.m4 b/gl/m4/unistd_h.m4 index d7a89e1302..53fc330bef 100644 --- a/gl/m4/unistd_h.m4 +++ b/gl/m4/unistd_h.m4 @@ -1,4 +1,4 @@ -# unistd_h.m4 serial 19 +# unistd_h.m4 serial 21 dnl Copyright (C) 2006-2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -35,6 +35,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], GNULIB_CHOWN=0; AC_SUBST([GNULIB_CHOWN]) GNULIB_CLOSE=0; AC_SUBST([GNULIB_CLOSE]) GNULIB_DUP2=0; AC_SUBST([GNULIB_DUP2]) + GNULIB_DUP3=0; AC_SUBST([GNULIB_DUP3]) GNULIB_ENVIRON=0; AC_SUBST([GNULIB_ENVIRON]) GNULIB_EUIDACCESS=0; AC_SUBST([GNULIB_EUIDACCESS]) GNULIB_FCHDIR=0; AC_SUBST([GNULIB_FCHDIR]) @@ -50,6 +51,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], GNULIB_LCHOWN=0; AC_SUBST([GNULIB_LCHOWN]) GNULIB_LINK=0; AC_SUBST([GNULIB_LINK]) GNULIB_LSEEK=0; AC_SUBST([GNULIB_LSEEK]) + GNULIB_PIPE2=0; AC_SUBST([GNULIB_PIPE2]) GNULIB_READLINK=0; AC_SUBST([GNULIB_READLINK]) GNULIB_SLEEP=0; AC_SUBST([GNULIB_SLEEP]) GNULIB_UNISTD_H_GETOPT=0; AC_SUBST([GNULIB_UNISTD_H_GETOPT]) @@ -57,6 +59,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], GNULIB_WRITE=0; AC_SUBST([GNULIB_WRITE]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_DUP2=1; AC_SUBST([HAVE_DUP2]) + HAVE_DUP3=1; AC_SUBST([HAVE_DUP3]) HAVE_EUIDACCESS=1; AC_SUBST([HAVE_EUIDACCESS]) HAVE_FSYNC=1; AC_SUBST([HAVE_FSYNC]) HAVE_FTRUNCATE=1; AC_SUBST([HAVE_FTRUNCATE]) @@ -66,6 +69,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], HAVE_GETPAGESIZE=1; AC_SUBST([HAVE_GETPAGESIZE]) HAVE_GETUSERSHELL=1; AC_SUBST([HAVE_GETUSERSHELL]) HAVE_LINK=1; AC_SUBST([HAVE_LINK]) + HAVE_PIPE2=1; AC_SUBST([HAVE_PIPE2]) HAVE_READLINK=1; AC_SUBST([HAVE_READLINK]) HAVE_SLEEP=1; AC_SUBST([HAVE_SLEEP]) HAVE_DECL_ENVIRON=1; AC_SUBST([HAVE_DECL_ENVIRON]) diff --git a/gl/progname.c b/gl/progname.c index 9854b5e7cc..19df10ad71 100644 --- a/gl/progname.c +++ b/gl/progname.c @@ -22,6 +22,7 @@ #undef ENABLE_RELOCATABLE /* avoid defining set_program_name as a macro */ #include "progname.h" +#include <errno.h> /* get program_invocation_name declaration */ #include <string.h> @@ -60,4 +61,11 @@ set_program_name (const char *argv0) */ program_name = argv0; + + /* On glibc systems, when the gnulib module 'error' is not used, the error() + function comes from libc and uses the variable program_invocation_name, + not program_name. So set this variable as well. */ +#if HAVE_DECL_PROGRAM_INVOCATION_NAME + program_invocation_name = (char *) argv0; +#endif } diff --git a/gl/stdlib.in.h b/gl/stdlib.in.h index c7c8e8fb7f..9ac7199568 100644 --- a/gl/stdlib.in.h +++ b/gl/stdlib.in.h @@ -207,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/gl/sys_socket.in.h b/gl/sys_socket.in.h index 26577dfaa0..16a7568453 100644 --- a/gl/sys_socket.in.h +++ b/gl/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/gl/tests/Makefile.am b/gl/tests/Makefile.am index 375c8bf7c6..cf3647f9f4 100644 --- a/gl/tests/Makefile.am +++ b/gl/tests/Makefile.am @@ -304,8 +304,8 @@ BUILT_SOURCES += $(SYS_IOCTL_H) # We need the following in order to create <sys/ioctl.h> when the system # does not have a complete one. sys/ioctl.h: sys_ioctl.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_IOCTL_H''@|$(HAVE_SYS_IOCTL_H)|g' \ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ @@ -316,7 +316,7 @@ sys/ioctl.h: sys_ioctl.in.h -e 's|@''SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS''@|$(SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS)|g' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ < $(srcdir)/sys_ioctl.in.h; \ - } > $@-t + } > $@-t && \ mv $@-t $@ MOSTLYCLEANFILES += sys/ioctl.h sys/ioctl.h-t MOSTLYCLEANDIRS += sys diff --git a/gl/unistd.in.h b/gl/unistd.in.h index aada3643ef..f61dc65f14 100644 --- a/gl/unistd.in.h +++ b/gl/unistd.in.h @@ -178,6 +178,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 @@ -328,7 +350,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 @@ -531,6 +554,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 diff --git a/gl/vasnprintf.c b/gl/vasnprintf.c index 82b4b2c0e8..e47e00c748 100644 --- a/gl/vasnprintf.c +++ b/gl/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 |