prelude-lml/master: Update GnuLib code

[email protected] Fri, 29 Jan 2010 18:01:13 +0100 (CET)
Newsgroups gmane.comp.security.ids.prelude.cvs
Message-ID <[email protected]>
commit a7075bcfaa4ad2515274b7294df4ed6f288e128a
Author: Yoann Vandoorselaere <[email protected]>
Date:   Fri Jan 29 17:38:54 2010 +0100

    Update GnuLib code


========================================

 arg-nonnull.h                         |    2 +-
 config.rpath                          |    2 +-
 libmissing/Makefile.am                |  121 +++++-----
 libmissing/alignof.h                  |    2 +-
 libmissing/alloca.in.h                |    2 +-
 libmissing/arpa_inet.in.h             |   22 +-
 libmissing/asnprintf.c                |    2 +-
 libmissing/bind.c                     |    2 +-
 libmissing/close-hook.c               |    2 +-
 libmissing/close-hook.h               |    2 +-
 libmissing/close.c                    |    2 +-
 libmissing/config.charset             |    2 +-
 libmissing/dirent.in.h                |   38 ++--
 libmissing/dirfd.c                    |    2 +-
 libmissing/errno.in.h                 |    2 +-
 libmissing/fclose.c                   |    2 +-
 libmissing/float+.h                   |    2 +-
 libmissing/float.in.h                 |    2 +-
 libmissing/fnmatch.c                  |    4 +-
 libmissing/fnmatch.in.h               |    2 +-
 libmissing/fnmatch_loop.c             |   13 +-
 libmissing/gai_strerror.c             |    3 +-
 libmissing/getaddrinfo.c              |    2 +-
 libmissing/getlogin_r.c               |   47 +++-
 libmissing/getpeername.c              |    2 +-
 libmissing/gettext.h                  |    3 +-
 libmissing/glob-libc.h                |    3 +-
 libmissing/glob.c                     |    3 +-
 libmissing/glob.in.h                  |   11 +-
 libmissing/inet_ntop.c                |    2 +-
 libmissing/langinfo.in.h              |   12 +-
 libmissing/localcharset.c             |    2 +-
 libmissing/localcharset.h             |    2 +-
 libmissing/m4/00gnulib.m4             |    2 +-
 libmissing/m4/alloca.m4               |    3 +-
 libmissing/m4/arpa_inet_h.m4          |   23 ++-
 libmissing/m4/close.m4                |    2 +-
 libmissing/m4/codeset.m4              |    2 +-
 libmissing/m4/d-type.m4               |    2 +-
 libmissing/m4/dirent_h.m4             |   17 +-
 libmissing/m4/dirfd.m4                |    2 +-
 libmissing/m4/errno_h.m4              |    2 +-
 libmissing/m4/extensions.m4           |    2 +-
 libmissing/m4/fclose.m4               |    2 +-
 libmissing/m4/fcntl-o.m4              |    2 +-
 libmissing/m4/float_h.m4              |    2 +-
 libmissing/m4/fnmatch.m4              |    2 +-
 libmissing/m4/getaddrinfo.m4          |    2 +-
 libmissing/m4/getlogin_r.m4           |   14 +-
 libmissing/m4/glibc21.m4              |    2 +-
 libmissing/m4/glob.m4                 |    2 +-
 libmissing/m4/gnulib-cache.m4         |    2 +-
 libmissing/m4/gnulib-common.m4        |   12 +-
 libmissing/m4/gnulib-comp.m4          |    6 +-
 libmissing/m4/gnulib-tool.m4          |    2 +-
 libmissing/m4/hostent.m4              |    2 +-
 libmissing/m4/iconv.m4                |   25 ++-
 libmissing/m4/include_next.m4         |    2 +-
 libmissing/m4/inet_ntop.m4            |    2 +-
 libmissing/m4/intmax_t.m4             |    3 +-
 libmissing/m4/inttypes_h.m4           |    2 +-
 libmissing/m4/langinfo_h.m4           |   14 +-
 libmissing/m4/lib-ld.m4               |    2 +-
 libmissing/m4/lib-link.m4             |    2 +-
 libmissing/m4/lib-prefix.m4           |    2 +-
 libmissing/m4/localcharset.m4         |    2 +-
 libmissing/m4/locale-fr.m4            |    2 +-
 libmissing/m4/locale-ja.m4            |    2 +-
 libmissing/m4/locale-tr.m4            |    2 +-
 libmissing/m4/locale-zh.m4            |    2 +-
 libmissing/m4/longlong.m4             |    2 +-
 libmissing/m4/malloc.m4               |    2 +-
 libmissing/m4/mbrtowc.m4              |    3 +-
 libmissing/m4/mbsinit.m4              |    2 +-
 libmissing/m4/mbsrtowcs.m4            |    2 +-
 libmissing/m4/mbstate_t.m4            |    2 +-
 libmissing/m4/memchr.m4               |    2 +-
 libmissing/m4/mempcpy.m4              |    3 +-
 libmissing/m4/mktime.m4               |    3 +-
 libmissing/m4/mmap-anon.m4            |    2 +-
 libmissing/m4/multiarch.m4            |    2 +-
 libmissing/m4/netdb_h.m4              |    5 +-
 libmissing/m4/netinet_in_h.m4         |    2 +-
 libmissing/m4/nl_langinfo.m4          |   10 +-
 libmissing/m4/onceonly.m4             |    2 +-
 libmissing/m4/pathmax.m4              |    3 +-
 libmissing/m4/printf.m4               |    2 +-
 libmissing/m4/servent.m4              |    2 +-
 libmissing/m4/sigaction.m4            |    2 +-
 libmissing/m4/signal_h.m4             |   11 +-
 libmissing/m4/signalblocking.m4       |    2 +-
 libmissing/m4/size_max.m4             |    2 +-
 libmissing/m4/sleep.m4                |    2 +-
 libmissing/m4/snprintf.m4             |    2 +-
 libmissing/m4/sockets.m4              |    2 +-
 libmissing/m4/socklen.m4              |    2 +-
 libmissing/m4/sockpfaf.m4             |    2 +-
 libmissing/m4/stdbool.m4              |    2 +-
 libmissing/m4/stddef_h.m4             |    2 +-
 libmissing/m4/stdint.m4               |    2 +-
 libmissing/m4/stdint_h.m4             |    2 +-
 libmissing/m4/stdio_h.m4              |   12 +-
 libmissing/m4/stdlib_h.m4             |   18 ++-
 libmissing/m4/strcase.m4              |    2 +-
 libmissing/m4/strerror.m4             |    2 +-
 libmissing/m4/string_h.m4             |   14 +-
 libmissing/m4/strings_h.m4            |    8 +-
 libmissing/m4/strptime.m4             |    2 +-
 libmissing/m4/strsep.m4               |    3 +-
 libmissing/m4/sys_select_h.m4         |   34 ++-
 libmissing/m4/sys_socket_h.m4         |   16 ++-
 libmissing/m4/sys_stat_h.m4           |    9 +-
 libmissing/m4/sys_time_h.m4           |    4 +-
 libmissing/m4/time_h.m4               |    2 +-
 libmissing/m4/time_r.m4               |    3 +-
 libmissing/m4/tm_gmtoff.m4            |    2 +-
 libmissing/m4/unistd_h.m4             |   25 ++-
 libmissing/m4/vasnprintf.m4           |    2 +-
 libmissing/m4/warn-on-use.m4          |   45 ++++
 libmissing/m4/wchar.m4                |   58 +++---
 libmissing/m4/wchar_t.m4              |    2 +-
 libmissing/m4/wctob.m4                |    2 +-
 libmissing/m4/wctype.m4               |    2 +-
 libmissing/m4/wint_t.m4               |    2 +-
 libmissing/m4/xsize.m4                |    2 +-
 libmissing/malloc.c                   |    2 +-
 libmissing/mbrtowc.c                  |    2 +-
 libmissing/mbsinit.c                  |    2 +-
 libmissing/mbsrtowcs-state.c          |    2 +-
 libmissing/mbsrtowcs.c                |    2 +-
 libmissing/memchr.c                   |    2 +-
 libmissing/mempcpy.c                  |    2 +-
 libmissing/mktime.c                   |    2 +-
 libmissing/netdb.in.h                 |    2 +-
 libmissing/netinet_in.in.h            |    2 +-
 libmissing/nl_langinfo.c              |    2 +-
 libmissing/pathmax.h                  |    4 +-
 libmissing/printf-args.c              |    2 +-
 libmissing/printf-args.h              |    4 +-
 libmissing/printf-parse.c             |    2 +-
 libmissing/printf-parse.h             |    4 +-
 libmissing/recvfrom.c                 |    2 +-
 libmissing/ref-add.sin                |    2 +-
 libmissing/ref-del.sin                |    2 +-
 libmissing/sig-handler.h              |    2 +-
 libmissing/sigaction.c                |    2 +-
 libmissing/signal.in.h                |  111 +++++++---
 libmissing/sigprocmask.c              |    2 +-
 libmissing/size_max.h                 |    2 +-
 libmissing/sleep.c                    |    2 +-
 libmissing/snprintf.c                 |    2 +-
 libmissing/socket.c                   |    2 +-
 libmissing/sockets.c                  |    2 +-
 libmissing/sockets.h                  |    2 +-
 libmissing/stdbool.in.h               |    2 +-
 libmissing/stddef.in.h                |    2 +-
 libmissing/stdint.in.h                |    2 +-
 libmissing/stdio-write.c              |    2 +-
 libmissing/stdio.in.h                 |  388 ++++++++++++++++++---------------
 libmissing/stdlib.in.h                |  187 ++++++++--------
 libmissing/strcasecmp.c               |    2 +-
 libmissing/streq.h                    |    2 +-
 libmissing/string.in.h                |  243 ++++++++++-----------
 libmissing/strings.in.h               |   37 ++--
 libmissing/strncasecmp.c              |    2 +-
 libmissing/strnlen1.c                 |    2 +-
 libmissing/strnlen1.h                 |    2 +-
 libmissing/strptime.c                 |    3 +-
 libmissing/strsep.c                   |    2 +-
 libmissing/sys_select.in.h            |   12 +-
 libmissing/sys_socket.in.h            |  124 ++++++------
 libmissing/sys_stat.in.h              |  102 +++++-----
 libmissing/sys_time.in.h              |    2 +-
 libmissing/tests/Makefile.am          |   63 +++---
 libmissing/tests/c-ctype.c            |    2 +-
 libmissing/tests/c-ctype.h            |    2 +-
 libmissing/tests/c-strcase.h          |    4 +-
 libmissing/tests/c-strcasecmp.c       |    2 +-
 libmissing/tests/c-strncasecmp.c      |    2 +-
 libmissing/tests/intprops.h           |    2 +-
 libmissing/tests/macros.h             |    2 +-
 libmissing/tests/signature.h          |    2 +-
 libmissing/tests/strerror.c           |    2 +-
 libmissing/tests/test-alignof.c       |    2 +-
 libmissing/tests/test-alloca-opt.c    |    2 +-
 libmissing/tests/test-arpa_inet.c     |    2 +-
 libmissing/tests/test-c-ctype.c       |    2 +-
 libmissing/tests/test-c-strcasecmp.c  |    2 +-
 libmissing/tests/test-c-strncasecmp.c |    2 +-
 libmissing/tests/test-dirent.c        |    2 +-
 libmissing/tests/test-errno.c         |    2 +-
 libmissing/tests/test-fnmatch.c       |    2 +-
 libmissing/tests/test-getaddrinfo.c   |    2 +-
 libmissing/tests/test-getlogin_r.c    |   88 ++++++++
 libmissing/tests/test-glob.c          |    2 +-
 libmissing/tests/test-iconv.c         |    2 +-
 libmissing/tests/test-inet_ntop.c     |    2 +-
 libmissing/tests/test-langinfo.c      |    2 +-
 libmissing/tests/test-mbrtowc.c       |    2 +-
 libmissing/tests/test-mbsinit.c       |    2 +-
 libmissing/tests/test-mbsrtowcs.c     |    2 +-
 libmissing/tests/test-memchr.c        |    2 +-
 libmissing/tests/test-netdb.c         |    2 +-
 libmissing/tests/test-netinet_in.c    |    2 +-
 libmissing/tests/test-nl_langinfo.c   |    2 +-
 libmissing/tests/test-sigaction.c     |    2 +-
 libmissing/tests/test-signal.c        |  102 +++++++++-
 libmissing/tests/test-sleep.c         |    2 +-
 libmissing/tests/test-snprintf.c      |    2 +-
 libmissing/tests/test-sockets.c       |    2 +-
 libmissing/tests/test-stdbool.c       |    2 +-
 libmissing/tests/test-stddef.c        |    2 +-
 libmissing/tests/test-stdint.c        |    2 +-
 libmissing/tests/test-stdio.c         |    9 +-
 libmissing/tests/test-stdlib.c        |    2 +-
 libmissing/tests/test-strerror.c      |    2 +-
 libmissing/tests/test-string.c        |    2 +-
 libmissing/tests/test-strings.c       |    2 +-
 libmissing/tests/test-sys_select.c    |    2 +-
 libmissing/tests/test-sys_socket.c    |    2 +-
 libmissing/tests/test-sys_stat.c      |    2 +-
 libmissing/tests/test-sys_time.c      |    2 +-
 libmissing/tests/test-time.c          |    2 +-
 libmissing/tests/test-unistd.c        |    2 +-
 libmissing/tests/test-vasnprintf.c    |    2 +-
 libmissing/tests/test-wchar.c         |    2 +-
 libmissing/tests/test-wctype.c        |    2 +-
 libmissing/tests/wctob.c              |    2 +-
 libmissing/tests/zerosize-ptr.h       |    2 +-
 libmissing/time.in.h                  |    2 +-
 libmissing/time_r.c                   |    2 +-
 libmissing/unistd.in.h                |  337 ++++++++++++++++-------------
 libmissing/vasnprintf.c               |   22 +-
 libmissing/vasnprintf.h               |   17 +-
 libmissing/verify.h                   |    2 +-
 libmissing/w32sock.h                  |    2 +-
 libmissing/wchar.in.h                 |  109 +++++-----
 libmissing/wctype.in.h                |   80 ++++---
 libmissing/xsize.h                    |    2 +-
 src/Makefile.am                       |    2 +-
 warn-on-use.h                         |   75 +++++++
 241 files changed, 1878 insertions(+), 1285 deletions(-)

========================================

diff --git a/arg-nonnull.h b/arg-nonnull.h
index 24ad6b5..7e3e2db 100644
--- a/arg-nonnull.h
+++ b/arg-nonnull.h
@@ -1,5 +1,5 @@
 /* A C macro for declaring that specific arguments must not be NULL.
-   Copyright (C) 2009 Free Software Foundation, Inc.
+   Copyright (C) 2009, 2010 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
diff --git a/config.rpath b/config.rpath
index 20778aa..17298f2 100755
--- a/config.rpath
+++ b/config.rpath
@@ -2,7 +2,7 @@
 # Output a system dependent set of variables, describing how to set the
 # run time search path of shared libraries in an executable.
 #
-#   Copyright 1996-2009 Free Software Foundation, Inc.
+#   Copyright 1996-2010 Free Software Foundation, Inc.
 #   Taken from GNU libtool, 2001
 #   Originally by Gordon Matzigkeit <[email protected]>, 1996
 #
diff --git a/libmissing/Makefile.am b/libmissing/Makefile.am
index ad5117b..f34c8d6 100644
--- a/libmissing/Makefile.am
+++ b/libmissing/Makefile.am
@@ -1,6 +1,6 @@
 ## DO NOT EDIT! GENERATED AUTOMATICALLY!
 ## Process this file with automake to produce Makefile.in.
-# Copyright (C) 2002-2009 Free Software Foundation, Inc.
+# Copyright (C) 2002-2010 Free Software Foundation, Inc.
 #
 # This file is free software, distributed under the terms of the GNU
 # General Public License.  As a special exception to the GNU General
@@ -101,11 +101,11 @@ EXTRA_DIST += $(top_srcdir)/./arg-nonnull.h
 
 ## begin gnulib module arpa_inet
 
-BUILT_SOURCES += $(ARPA_INET_H)
+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 $(LINK_WARNING_H) $(ARG_NONNULL_H)
+arpa/inet.h: arpa_inet.in.h $(WARN_ON_USE_H) $(ARG_NONNULL_H)
 	$(AM_V_at)$(MKDIR_P) arpa
 	$(AM_V_GEN)rm -f $@-t $@ && \
 	{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
@@ -117,8 +117,8 @@ arpa/inet.h: arpa_inet.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
 	      -e 's|@''GNULIB_INET_PTON''@|$(GNULIB_INET_PTON)|g' \
 	      -e 's|@''HAVE_DECL_INET_NTOP''@|$(HAVE_DECL_INET_NTOP)|g' \
 	      -e 's|@''HAVE_DECL_INET_PTON''@|$(HAVE_DECL_INET_PTON)|g' \
-	      -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
 	      -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+	      -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
 	      < $(srcdir)/arpa_inet.in.h; \
 	} > $@-t && \
 	mv $@-t $@
@@ -218,11 +218,11 @@ CLEANFILES += configmake.h configmake.h-t
 
 ## begin gnulib module dirent
 
-BUILT_SOURCES += $(DIRENT_H)
+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 $(LINK_WARNING_H) $(ARG_NONNULL_H)
+dirent.h: dirent.in.h $(WARN_ON_USE_H) $(ARG_NONNULL_H)
 	$(AM_V_GEN)rm -f $@-t $@ && \
 	{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
 	  sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@@ -239,8 +239,8 @@ dirent.h: dirent.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
 	      -e 's|@''REPLACE_CLOSEDIR''@|$(REPLACE_CLOSEDIR)|g' \
 	      -e 's|@''REPLACE_FDOPENDIR''@|$(REPLACE_FDOPENDIR)|g' \
 	      -e 's|@''REPLACE_OPENDIR''@|$(REPLACE_OPENDIR)|g' \
-	      -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
 	      -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+	      -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
 	      < $(srcdir)/dirent.in.h; \
 	} > $@-t && \
 	mv $@-t $@
@@ -410,11 +410,11 @@ EXTRA_libmissing_la_SOURCES += inet_ntop.c
 
 ## begin gnulib module langinfo
 
-BUILT_SOURCES += $(LANGINFO_H)
+BUILT_SOURCES += langinfo.h
 
 # We need the following in order to create an empty placeholder for
 # <langinfo.h> when the system doesn't have one.
-langinfo.h: langinfo.in.h $(LINK_WARNING_H)
+langinfo.h: langinfo.in.h $(WARN_ON_USE_H)
 	$(AM_V_GEN)rm -f $@-t $@ && \
 	{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
 	  sed -e 's|@''HAVE_LANGINFO_H''@|$(HAVE_LANGINFO_H)|g' \
@@ -426,7 +426,7 @@ langinfo.h: langinfo.in.h $(LINK_WARNING_H)
 	      -e 's|@''HAVE_LANGINFO_ERA''@|$(HAVE_LANGINFO_ERA)|g' \
 	      -e 's|@''HAVE_NL_LANGINFO''@|$(HAVE_NL_LANGINFO)|g' \
 	      -e 's|@''REPLACE_NL_LANGINFO''@|$(REPLACE_NL_LANGINFO)|g' \
-	      -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
+	      -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
 	      < $(srcdir)/langinfo.in.h; \
 	} > $@-t && \
 	mv $@-t $@
@@ -436,30 +436,6 @@ EXTRA_DIST += langinfo.in.h
 
 ## end   gnulib module langinfo
 
-## begin gnulib module link-warning
-
-# The BUILT_SOURCES created by this Makefile snippet are not used via #include
-# statements but through direct file reference. Therefore this snippet must be
-# present in all Makefile.am that need it. This is ensured by the applicability
-# 'all' defined above.
-
-BUILT_SOURCES += link-warning.h
-# The link-warning.h that gets inserted into generated .h files is the same as
-# build-aux/link-warning.h, except that it has the copyright header cut off.
-link-warning.h: $(top_srcdir)/./link-warning.h
-	$(AM_V_GEN)rm -f $@-t $@ && \
-	sed -n -e '/GL_LINK_WARNING/,$$p' \
-	  < $(top_srcdir)/./link-warning.h \
-	  > $@-t && \
-	mv $@-t $@
-MOSTLYCLEANFILES += link-warning.h link-warning.h-t
-
-LINK_WARNING_H=link-warning.h
-
-EXTRA_DIST += $(top_srcdir)/./link-warning.h
-
-## end   gnulib module link-warning
-
 ## begin gnulib module localcharset
 
 libmissing_la_SOURCES += localcharset.h localcharset.c
@@ -690,7 +666,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 $(LINK_WARNING_H) $(ARG_NONNULL_H)
+signal.h: signal.in.h $(WARN_ON_USE_H) $(ARG_NONNULL_H)
 	$(AM_V_GEN)rm -f $@-t $@ && \
 	{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
 	  sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@@ -705,8 +681,8 @@ signal.h: signal.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
 	      -e 's|@''HAVE_SIGACTION''@|$(HAVE_SIGACTION)|g' \
 	      -e 's|@''HAVE_STRUCT_SIGACTION_SA_SIGACTION''@|$(HAVE_STRUCT_SIGACTION_SA_SIGACTION)|g' \
 	      -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)' \
 	      -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+	      -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
 	      < $(srcdir)/signal.in.h; \
 	} > $@-t && \
 	mv $@-t $@
@@ -855,7 +831,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 $(LINK_WARNING_H) $(ARG_NONNULL_H)
+stdio.h: stdio.in.h $(WARN_ON_USE_H) $(ARG_NONNULL_H)
 	$(AM_V_GEN)rm -f $@-t $@ && \
 	{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
 	  sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@@ -901,7 +877,8 @@ stdio.h: stdio.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
 	      -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' \
+	      < $(srcdir)/stdio.in.h | \
+	  sed -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' \
@@ -939,9 +916,8 @@ stdio.h: stdio.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
 	      -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)' \
 	      -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-	      < $(srcdir)/stdio.in.h; \
+	      -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
 	} > $@-t && \
 	mv $@-t $@
 MOSTLYCLEANFILES += stdio.h stdio.h-t
@@ -958,7 +934,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 $(LINK_WARNING_H) $(ARG_NONNULL_H)
+stdlib.h: stdlib.in.h $(WARN_ON_USE_H) $(ARG_NONNULL_H)
 	$(AM_V_GEN)rm -f $@-t $@ && \
 	{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
 	  sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@@ -1014,8 +990,8 @@ stdlib.h: stdlib.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
 	      -e 's|@''REPLACE_SETENV''@|$(REPLACE_SETENV)|g' \
 	      -e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|g' \
 	      -e 's|@''REPLACE_UNSETENV''@|$(REPLACE_UNSETENV)|g' \
-	      -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
 	      -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+	      -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
 	      < $(srcdir)/stdlib.in.h; \
 	} > $@-t && \
 	mv $@-t $@
@@ -1047,7 +1023,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 $(LINK_WARNING_H) $(ARG_NONNULL_H)
+string.h: string.in.h $(WARN_ON_USE_H) $(ARG_NONNULL_H)
 	$(AM_V_GEN)rm -f $@-t $@ && \
 	{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
 	  sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@@ -1086,6 +1062,8 @@ string.h: string.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
 	      -e 's|@''GNULIB_STRERROR''@|$(GNULIB_STRERROR)|g' \
 	      -e 's|@''GNULIB_STRSIGNAL''@|$(GNULIB_STRSIGNAL)|g' \
 	      -e 's|@''GNULIB_STRVERSCMP''@|$(GNULIB_STRVERSCMP)|g' \
+	      < $(srcdir)/string.in.h | \
+	  sed -e 's|@''HAVE_MBSLEN''@|$(HAVE_MBSLEN)|g' \
 	      -e 's|@''HAVE_DECL_MEMMEM''@|$(HAVE_DECL_MEMMEM)|g' \
 	      -e 's|@''HAVE_MEMPCPY''@|$(HAVE_MEMPCPY)|g' \
 	      -e 's|@''HAVE_DECL_MEMRCHR''@|$(HAVE_DECL_MEMRCHR)|g' \
@@ -1113,8 +1091,8 @@ string.h: string.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
 	      -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)' \
 	      -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+	      -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
 	      < $(srcdir)/string.in.h; \
 	} > $@-t && \
 	mv $@-t $@
@@ -1130,7 +1108,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 $(LINK_WARNING_H) $(ARG_NONNULL_H)
+strings.h: strings.in.h $(WARN_ON_USE_H) $(ARG_NONNULL_H)
 	$(AM_V_GEN)rm -f $@-t $@ && \
 	{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
 	  sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@@ -1138,8 +1116,8 @@ strings.h: strings.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
 	      -e 's|@''NEXT_STRINGS_H''@|$(NEXT_STRINGS_H)|g' \
 	      -e 's|@''HAVE_STRCASECMP''@|$(HAVE_STRCASECMP)|g' \
 	      -e 's|@''HAVE_DECL_STRNCASECMP''@|$(HAVE_DECL_STRNCASECMP)|g' \
-	      -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
 	      -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+	      -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
 	      < $(srcdir)/strings.in.h; \
 	} > $@-t && \
 	mv $@-t $@
@@ -1175,11 +1153,11 @@ EXTRA_libmissing_la_SOURCES += strsep.c
 
 ## begin gnulib module sys_select
 
-BUILT_SOURCES += $(SYS_SELECT_H)
+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 $(LINK_WARNING_H)
+sys/select.h: sys_select.in.h $(WARN_ON_USE_H)
 	$(AM_V_at)$(MKDIR_P) sys
 	$(AM_V_GEN)rm -f $@-t $@ && \
 	{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
@@ -1190,7 +1168,7 @@ sys/select.h: sys_select.in.h $(LINK_WARNING_H)
 	      -e 's|@''GNULIB_SELECT''@|$(GNULIB_SELECT)|g' \
 	      -e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \
 	      -e 's|@''REPLACE_SELECT''@|$(REPLACE_SELECT)|g' \
-	      -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
+	      -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
 	      < $(srcdir)/sys_select.in.h; \
 	} > $@-t && \
 	mv $@-t $@
@@ -1203,11 +1181,11 @@ EXTRA_DIST += sys_select.in.h
 
 ## begin gnulib module sys_socket
 
-BUILT_SOURCES += $(SYS_SOCKET_H)
+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 $(LINK_WARNING_H) $(ARG_NONNULL_H)
+sys/socket.h: sys_socket.in.h $(WARN_ON_USE_H) $(ARG_NONNULL_H)
 	$(AM_V_at)$(MKDIR_P) sys
 	$(AM_V_GEN)rm -f $@-t $@ && \
 	{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
@@ -1236,8 +1214,8 @@ sys/socket.h: sys_socket.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
 	      -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)' \
 	      -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+	      -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
 	      < $(srcdir)/sys_socket.in.h; \
 	} > $@-t && \
 	mv -f $@-t $@
@@ -1254,7 +1232,7 @@ 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 $(LINK_WARNING_H) $(ARG_NONNULL_H)
+sys/stat.h: sys_stat.in.h $(WARN_ON_USE_H) $(ARG_NONNULL_H)
 	$(AM_V_at)$(MKDIR_P) sys
 	$(AM_V_GEN)rm -f $@-t $@ && \
 	{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
@@ -1293,8 +1271,8 @@ sys/stat.h: sys_stat.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
 	      -e 's|@''REPLACE_MKNOD''@|$(REPLACE_MKNOD)|g' \
 	      -e 's|@''REPLACE_STAT''@|$(REPLACE_STAT)|g' \
 	      -e 's|@''REPLACE_UTIMENSAT''@|$(REPLACE_UTIMENSAT)|g' \
-	      -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
 	      -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+	      -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
 	      < $(srcdir)/sys_stat.in.h; \
 	} > $@-t && \
 	mv $@-t $@
@@ -1375,7 +1353,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 $(LINK_WARNING_H) $(ARG_NONNULL_H)
+unistd.h: unistd.in.h $(WARN_ON_USE_H) $(ARG_NONNULL_H)
 	$(AM_V_GEN)rm -f $@-t $@ && \
 	{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
 	  sed -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \
@@ -1398,6 +1376,7 @@ unistd.h: unistd.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
 	      -e 's|@''GNULIB_GETDTABLESIZE''@|$(GNULIB_GETDTABLESIZE)|g' \
 	      -e 's|@''GNULIB_GETGROUPS''@|$(GNULIB_GETGROUPS)|g' \
 	      -e 's|@''GNULIB_GETHOSTNAME''@|$(GNULIB_GETHOSTNAME)|g' \
+	      -e 's|@''GNULIB_GETLOGIN''@|$(GNULIB_GETLOGIN)|g' \
 	      -e 's|@''GNULIB_GETLOGIN_R''@|$(GNULIB_GETLOGIN_R)|g' \
 	      -e 's|@''GNULIB_GETPAGESIZE''@|$(GNULIB_GETPAGESIZE)|g' \
 	      -e 's|@''GNULIB_GETUSERSHELL''@|$(GNULIB_GETUSERSHELL)|g' \
@@ -1419,7 +1398,8 @@ unistd.h: unistd.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
 	      -e 's|@''GNULIB_UNLINKAT''@|$(GNULIB_UNLINKAT)|g' \
 	      -e 's|@''GNULIB_USLEEP''@|$(GNULIB_USLEEP)|g' \
 	      -e 's|@''GNULIB_WRITE''@|$(GNULIB_WRITE)|g' \
-	      -e 's|@''HAVE_CHOWN''@|$(HAVE_CHOWN)|g' \
+	      < $(srcdir)/unistd.in.h | \
+	  sed -e 's|@''HAVE_CHOWN''@|$(HAVE_CHOWN)|g' \
 	      -e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \
 	      -e 's|@''HAVE_DUP3''@|$(HAVE_DUP3)|g' \
 	      -e 's|@''HAVE_EUIDACCESS''@|$(HAVE_EUIDACCESS)|g' \
@@ -1431,6 +1411,7 @@ unistd.h: unistd.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
 	      -e 's|@''HAVE_GETDTABLESIZE''@|$(HAVE_GETDTABLESIZE)|g' \
 	      -e 's|@''HAVE_GETGROUPS''@|$(HAVE_GETGROUPS)|g' \
 	      -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \
+	      -e 's|@''HAVE_GETLOGIN''@|$(HAVE_GETLOGIN)|g' \
 	      -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \
 	      -e 's|@''HAVE_GETUSERSHELL''@|$(HAVE_GETUSERSHELL)|g' \
 	      -e 's|@''HAVE_LCHOWN''@|$(HAVE_LCHOWN)|g' \
@@ -1473,9 +1454,8 @@ unistd.h: unistd.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
 	      -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)' \
 	      -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-	      < $(srcdir)/unistd.in.h; \
+	      -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
 	} > $@-t && \
 	mv $@-t $@
 MOSTLYCLEANFILES += unistd.h unistd.h-t
@@ -1499,13 +1479,32 @@ libmissing_la_SOURCES += verify.h
 
 ## end   gnulib module verify
 
+## begin gnulib module warn-on-use
+
+BUILT_SOURCES += warn-on-use.h
+# The warn-on-use.h that gets inserted into generated .h files is the same as
+# build-aux/warn-on-use.h, except that it has the copyright header cut off.
+warn-on-use.h: $(top_srcdir)/./warn-on-use.h
+	$(AM_V_GEN)rm -f $@-t $@ && \
+	sed -n -e '/^.ifndef/,$$p' \
+	  < $(top_srcdir)/./warn-on-use.h \
+	  > $@-t && \
+	mv $@-t $@
+MOSTLYCLEANFILES += warn-on-use.h warn-on-use.h-t
+
+WARN_ON_USE_H=warn-on-use.h
+
+EXTRA_DIST += $(top_srcdir)/./warn-on-use.h
+
+## end   gnulib module warn-on-use
+
 ## begin gnulib module wchar
 
-BUILT_SOURCES += $(WCHAR_H)
+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 $(LINK_WARNING_H) $(ARG_NONNULL_H)
+wchar.h: wchar.in.h $(WARN_ON_USE_H) $(ARG_NONNULL_H)
 	$(AM_V_GEN)rm -f $@-t $@ && \
 	{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
 	  sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@@ -1547,8 +1546,8 @@ wchar.h: wchar.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
 	      -e 's|@''REPLACE_WCSRTOMBS''@|$(REPLACE_WCSRTOMBS)|g' \
 	      -e 's|@''REPLACE_WCSNRTOMBS''@|$(REPLACE_WCSNRTOMBS)|g' \
 	      -e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \
-	      -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
 	      -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+	      -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
 	    < $(srcdir)/wchar.in.h; \
 	} > $@-t && \
 	mv $@-t $@
diff --git a/libmissing/alignof.h b/libmissing/alignof.h
index 28ce79c..13687ab 100644
--- a/libmissing/alignof.h
+++ b/libmissing/alignof.h
@@ -1,5 +1,5 @@
 /* Determine alignment of types.
-   Copyright (C) 2003-2004, 2006, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2003-2004, 2006, 2009-2010 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
diff --git a/libmissing/alloca.in.h b/libmissing/alloca.in.h
index eeca595..ee7aa9a 100644
--- a/libmissing/alloca.in.h
+++ b/libmissing/alloca.in.h
@@ -1,6 +1,6 @@
 /* Memory allocation on the stack.
 
-   Copyright (C) 1995, 1999, 2001-2004, 2006-2009 Free Software Foundation,
+   Copyright (C) 1995, 1999, 2001-2004, 2006-2010 Free Software Foundation,
    Inc.
 
    This program is free software; you can redistribute it and/or modify it
diff --git a/libmissing/arpa_inet.in.h b/libmissing/arpa_inet.in.h
index d4dee01..8e6c6c5 100644
--- a/libmissing/arpa_inet.in.h
+++ b/libmissing/arpa_inet.in.h
@@ -1,6 +1,6 @@
 /* A GNU-like <arpa/inet.h>.
 
-   Copyright (C) 2005-2006, 2008-2009 Free Software Foundation, Inc.
+   Copyright (C) 2005-2006, 2008-2010 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
@@ -39,10 +39,10 @@
 #ifndef _GL_ARPA_INET_H
 #define _GL_ARPA_INET_H
 
-/* The definition of GL_LINK_WARNING is copied here.  */
-
 /* The definition of _GL_ARG_NONNULL is copied here.  */
 
+/* The definition of _GL_WARN_ON_USE is copied here.  */
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -70,10 +70,10 @@ extern const char *inet_ntop (int af, const void *restrict src,
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef inet_ntop
-# define inet_ntop(af,src,dst,cnt) \
-    (GL_LINK_WARNING ("inet_ntop is unportable - " \
-                      "use gnulib module inet_ntop for portability"), \
-     inet_ntop (af, src, dst, cnt))
+# if HAVE_RAW_DECL_INET_NTOP
+_GL_WARN_ON_USE (inet_ntop, "inet_ntop is unportable - "
+                 "use gnulib module inet_ntop for portability");
+# endif
 #endif
 
 #if @GNULIB_INET_PTON@
@@ -83,10 +83,10 @@ extern int inet_pton (int af, const char *restrict src, void *restrict dst)
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef inet_pton
-# define inet_pton(af,src,dst) \
-  (GL_LINK_WARNING ("inet_pton is unportable - " \
-                    "use gnulib module inet_pton for portability"), \
-   inet_pton (af, src, dst))
+# if HAVE_RAW_DECL_INET_PTON
+_GL_WARN_ON_USE (inet_pton, "inet_pton is unportable - "
+                 "use gnulib module inet_pton for portability");
+# endif
 #endif
 
 #ifdef __cplusplus
diff --git a/libmissing/asnprintf.c b/libmissing/asnprintf.c
index ba4d1f4..bc5a8af 100644
--- a/libmissing/asnprintf.c
+++ b/libmissing/asnprintf.c
@@ -1,5 +1,5 @@
 /* Formatted output to strings.
-   Copyright (C) 1999, 2002, 2006, 2009 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002, 2006, 2009, 2010 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
diff --git a/libmissing/bind.c b/libmissing/bind.c
index 84f3916..f525466 100644
--- a/libmissing/bind.c
+++ b/libmissing/bind.c
@@ -1,6 +1,6 @@
 /* bind.c --- wrappers for Windows bind function
 
-   Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
diff --git a/libmissing/close-hook.c b/libmissing/close-hook.c
index 427629a..15d67fb 100644
--- a/libmissing/close-hook.c
+++ b/libmissing/close-hook.c
@@ -1,5 +1,5 @@
 /* Hook for making the close() function extensible.
-   Copyright (C) 2009 Free Software Foundation, Inc.
+   Copyright (C) 2009, 2010 Free Software Foundation, Inc.
    Written by Bruno Haible <[email protected]>, 2009.
 
    This program is free software: you can redistribute it and/or modify it
diff --git a/libmissing/close-hook.h b/libmissing/close-hook.h
index 7369be1..aff5757 100644
--- a/libmissing/close-hook.h
+++ b/libmissing/close-hook.h
@@ -1,5 +1,5 @@
 /* Hook for making the close() function extensible.
-   Copyright (C) 2009 Free Software Foundation, Inc.
+   Copyright (C) 2009, 2010 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify it
    under the terms of the GNU Lesser General Public License as published
diff --git a/libmissing/close.c b/libmissing/close.c
index 5266d41..7de059a 100644
--- a/libmissing/close.c
+++ b/libmissing/close.c
@@ -1,5 +1,5 @@
 /* close replacement.
-   Copyright (C) 2008-2009 Free Software Foundation, Inc.
+   Copyright (C) 2008-2010 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
diff --git a/libmissing/config.charset b/libmissing/config.charset
index 217bef1..ae2efc4 100644
--- a/libmissing/config.charset
+++ b/libmissing/config.charset
@@ -1,7 +1,7 @@
 #! /bin/sh
 # Output a system dependent table of character encoding aliases.
 #
-#   Copyright (C) 2000-2004, 2006-2009 Free Software Foundation, Inc.
+#   Copyright (C) 2000-2004, 2006-2010 Free Software Foundation, Inc.
 #
 #   This program is free software; you can redistribute it and/or modify
 #   it under the terms of the GNU Lesser General Public License as published by
diff --git a/libmissing/dirent.in.h b/libmissing/dirent.in.h
index 2628eab..46d16ae 100644
--- a/libmissing/dirent.in.h
+++ b/libmissing/dirent.in.h
@@ -1,5 +1,5 @@
 /* A GNU-like <dirent.h>.
-   Copyright (C) 2006-2009 Free Software Foundation, Inc.
+   Copyright (C) 2006-2010 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
@@ -26,10 +26,12 @@
 #ifndef _GL_DIRENT_H
 #define _GL_DIRENT_H
 
-/* The definition of GL_LINK_WARNING is copied here.  */
+/* Get ino_t.  Needed on some systems, including glibc 2.8.  */
+#include <sys/types.h>
 
 /* The definition of _GL_ARG_NONNULL is copied here.  */
 
+/* The definition of _GL_WARN_ON_USE is copied here.  */
 
 #ifdef __cplusplus
 extern "C" {
@@ -50,10 +52,10 @@ extern int dirfd (DIR *dir) _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef dirfd
-# define dirfd(d) \
-    (GL_LINK_WARNING ("dirfd is unportable - " \
-                      "use gnulib module dirfd for portability"), \
-     dirfd (d))
+# if HAVE_RAW_DECL_DIRFD
+_GL_WARN_ON_USE (dirfd, "dirfd is unportable - "
+                 "use gnulib module dirfd for portability");
+# endif
 #endif
 
 #if @GNULIB_FDOPENDIR@
@@ -71,10 +73,10 @@ 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))
+# if HAVE_RAW_DECL_FDOPENDIR
+_GL_WARN_ON_USE (fdopendir, "fdopendir is unportable - "
+                 "use gnulib module fdopendir for portability");
+# endif
 #endif
 
 #if @REPLACE_OPENDIR@
@@ -95,10 +97,10 @@ extern int scandir (const char *dir, struct dirent ***namelist,
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef scandir
-# define scandir(d,n,f,c) \
-    (GL_LINK_WARNING ("scandir is unportable - " \
-                      "use gnulib module scandir for portability"), \
-     scandir (d, n, f, c))
+# if HAVE_RAW_DECL_SCANDIR
+_GL_WARN_ON_USE (scandir, "scandir is unportable - "
+                 "use gnulib module scandir for portability");
+# endif
 #endif
 
 #if @GNULIB_ALPHASORT@
@@ -109,10 +111,10 @@ extern int alphasort (const struct dirent **, const struct dirent **)
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef alphasort
-# define alphasort(a,b) \
-    (GL_LINK_WARNING ("alphasort is unportable - " \
-                      "use gnulib module alphasort for portability"), \
-     alphasort (a, b))
+# if HAVE_RAW_DECL_ALPHASORT
+_GL_WARN_ON_USE (alphasort, "alphasort is unportable - "
+                 "use gnulib module alphasort for portability");
+# endif
 #endif
 
 #ifdef __cplusplus
diff --git a/libmissing/dirfd.c b/libmissing/dirfd.c
index 73d03af..4ee1ee6 100644
--- a/libmissing/dirfd.c
+++ b/libmissing/dirfd.c
@@ -1,6 +1,6 @@
 /* dirfd.c -- return the file descriptor associated with an open DIR*
 
-   Copyright (C) 2001, 2006, 2008-2009 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2006, 2008-2010 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
diff --git a/libmissing/errno.in.h b/libmissing/errno.in.h
index a9b81d5..0e6fb7f 100644
--- a/libmissing/errno.in.h
+++ b/libmissing/errno.in.h
@@ -1,6 +1,6 @@
 /* A POSIX-like <errno.h>.
 
-   Copyright (C) 2008-2009 Free Software Foundation, Inc.
+   Copyright (C) 2008-2010 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
diff --git a/libmissing/fclose.c b/libmissing/fclose.c
index e305c0c..712af49 100644
--- a/libmissing/fclose.c
+++ b/libmissing/fclose.c
@@ -1,5 +1,5 @@
 /* fclose replacement.
-   Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
diff --git a/libmissing/float+.h b/libmissing/float+.h
index 9317ab7..956eb28 100644
--- a/libmissing/float+.h
+++ b/libmissing/float+.h
@@ -1,5 +1,5 @@
 /* Supplemental information about the floating-point formats.
-   Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
    Written by Bruno Haible <[email protected]>, 2007.
 
    This program is free software; you can redistribute it and/or modify
diff --git a/libmissing/float.in.h b/libmissing/float.in.h
index df36639..ad99af3 100644
--- a/libmissing/float.in.h
+++ b/libmissing/float.in.h
@@ -1,6 +1,6 @@
 /* A correct <float.h>.
 
-   Copyright (C) 2007-2009 Free Software Foundation, Inc.
+   Copyright (C) 2007-2010 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
diff --git a/libmissing/fnmatch.c b/libmissing/fnmatch.c
index 06a97a2..4475bc9 100644
--- a/libmissing/fnmatch.c
+++ b/libmissing/fnmatch.c
@@ -1,5 +1,5 @@
-/* Copyright (C) 1991,1992,1993,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2009
-        Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1993, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+   2003, 2004, 2005, 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
diff --git a/libmissing/fnmatch.in.h b/libmissing/fnmatch.in.h
index 5436004..28983b8 100644
--- a/libmissing/fnmatch.in.h
+++ b/libmissing/fnmatch.in.h
@@ -1,5 +1,5 @@
 /* Copyright (C) 1991, 1992, 1993, 1996, 1997, 1998, 1999, 2001, 2002, 2003,
-   2005, 2007, 2009 Free Software Foundation, Inc.
+   2005, 2007, 2009, 2010 Free Software Foundation, Inc.
 
    This file is part of the GNU C Library.
 
diff --git a/libmissing/fnmatch_loop.c b/libmissing/fnmatch_loop.c
index 33b8159..7080177 100644
--- a/libmissing/fnmatch_loop.c
+++ b/libmissing/fnmatch_loop.c
@@ -1,5 +1,5 @@
-/* Copyright (C) 1991,1992,1993,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2009
-   Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1993, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+   2003, 2004, 2005, 2006, 2009, 2010 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
@@ -382,15 +382,20 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
                             /* We found a table entry.  Now see whether the
                                character we are currently at has the same
                                equivalance class value.  */
-                            int len = weights[idx];
+                            int len = weights[idx & 0xffffff];
                             int32_t idx2;
                             const UCHAR *np = (const UCHAR *) n;
 
                             idx2 = findidx (&np);
-                            if (idx2 != 0 && len == weights[idx2])
+                            if (idx2 != 0
+                                && (idx >> 24) == (idx2 >> 24)
+                                && len == weights[idx2 & 0xffffff])
                               {
                                 int cnt = 0;
 
+                                idx &= 0xffffff;
+                                idx2 &= 0xffffff;
+
                                 while (cnt < len
                                        && (weights[idx + 1 + cnt]
                                            == weights[idx2 + 1 + cnt]))
diff --git a/libmissing/gai_strerror.c b/libmissing/gai_strerror.c
index ab81d08..21e8076 100644
--- a/libmissing/gai_strerror.c
+++ b/libmissing/gai_strerror.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 1997, 2001, 2002, 2004, 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 2001, 2002, 2004, 2005, 2006, 2008, 2009, 2010 Free
+   Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Philip Blundell <[email protected]>, 1997.
 
diff --git a/libmissing/getaddrinfo.c b/libmissing/getaddrinfo.c
index cb75181..475eaa0 100644
--- a/libmissing/getaddrinfo.c
+++ b/libmissing/getaddrinfo.c
@@ -1,5 +1,5 @@
 /* Get address information (partial implementation).
-   Copyright (C) 1997, 2001-2002, 2004-2009 Free Software Foundation, Inc.
+   Copyright (C) 1997, 2001-2002, 2004-2010 Free Software Foundation, Inc.
    Contributed by Simon Josefsson <[email protected]>.
 
    This program is free software; you can redistribute it and/or modify
diff --git a/libmissing/getlogin_r.c b/libmissing/getlogin_r.c
index 17b5a63..6d4ad17 100644
--- a/libmissing/getlogin_r.c
+++ b/libmissing/getlogin_r.c
@@ -1,6 +1,6 @@
 /* Provide a working getlogin_r for systems which lack it.
 
-   Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2005-2007, 2009-2010 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
@@ -16,7 +16,7 @@
    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 Paul Eggert and Derek Price */
+/* Written by Paul Eggert, Derek Price, and Bruno Haible.  */
 
 #include <config.h>
 
@@ -26,31 +26,54 @@
 #include <errno.h>
 #include <string.h>
 
-#if !HAVE_DECL_GETLOGIN
-char *getlogin (void);
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+#else
+# if !HAVE_DECL_GETLOGIN
+extern char *getlogin (void);
+# endif
 #endif
 
 /* See unistd.in.h for documentation.  */
 int
 getlogin_r (char *name, size_t size)
 {
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+  /* Native Windows platform.  */
+  DWORD sz;
+
+  /* When size > 0x7fff, the doc says that GetUserName will fail.
+     Actually, on Windows XP SP3, it succeeds.  But let's be safe,
+     for the sake of older Windows versions.  */
+  if (size > 0x7fff)
+    size = 0x7fff;
+  sz = size;
+  if (!GetUserName (name, &sz))
+    {
+      if (GetLastError () == ERROR_INSUFFICIENT_BUFFER)
+        /* In this case, the doc says that sz contains the required size, but
+           actually, on Windows XP SP3, it contains 2 * the required size.  */
+        return ERANGE;
+      else
+        return ENOENT;
+    }
+  return 0;
+#else
+  /* Platform with a getlogin() function.  */
   char *n;
   size_t nlen;
 
   errno = 0;
   n = getlogin ();
-
-  /* A system function like getlogin_r is never supposed to set errno
-     to zero, so make sure errno is nonzero here.  ENOENT is a
-     reasonable errno value if getlogin returns NULL.  */
-  if (!errno)
-    errno = ENOENT;
-
   if (!n)
-    return errno;
+    /* ENOENT is a reasonable errno value if getlogin returns NULL.  */
+    return (errno != 0 ? errno : ENOENT);
+
   nlen = strlen (n);
   if (size <= nlen)
     return ERANGE;
   memcpy (name, n, nlen + 1);
   return 0;
+#endif
 }
diff --git a/libmissing/getpeername.c b/libmissing/getpeername.c
index efb78a0..f428c05 100644
--- a/libmissing/getpeername.c
+++ b/libmissing/getpeername.c
@@ -1,6 +1,6 @@
 /* getpeername.c --- wrappers for Windows getpeername function
 
-   Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
diff --git a/libmissing/gettext.h b/libmissing/gettext.h
index 3d7d08c..987009f 100644
--- a/libmissing/gettext.h
+++ b/libmissing/gettext.h
@@ -1,5 +1,6 @@
 /* Convenience header for conditional use of GNU <libintl.h>.
-   Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009 Free Software Foundation, Inc.
+   Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2010 Free Software
+   Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
diff --git a/libmissing/glob-libc.h b/libmissing/glob-libc.h
index 377df01..a36887e 100644
--- a/libmissing/glob-libc.h
+++ b/libmissing/glob-libc.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 1991,92,95-98,2000,2001,2004-2007, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 1991-1992, 1995-1998, 2000-2001, 2004-2007, 2009-2010 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
diff --git a/libmissing/glob.c b/libmissing/glob.c
index f5c3d67..fa6e94b 100644
--- a/libmissing/glob.c
+++ b/libmissing/glob.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1991-2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
-   Free Software Foundation, Inc.
+/* Copyright (C) 1991-2010 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
diff --git a/libmissing/glob.in.h b/libmissing/glob.in.h
index 7e16a82..3cae205 100644
--- a/libmissing/glob.in.h
+++ b/libmissing/glob.in.h
@@ -1,6 +1,6 @@
 /* glob.h -- Find a path matching a pattern.
 
-   Copyright (C) 2005-2007, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2005-2007, 2009-2010 Free Software Foundation, Inc.
 
    Written by Derek Price <[email protected]> & Paul Eggert <[email protected]>
 
@@ -33,8 +33,13 @@
 #include <sys/stat.h>
 
 #ifndef __BEGIN_DECLS
-# define __BEGIN_DECLS
-# define __END_DECLS
+# ifdef __cplusplus
+#  define __BEGIN_DECLS  extern "C" {
+#  define __END_DECLS    }
+# else
+#  define __BEGIN_DECLS
+#  define __END_DECLS
+# endif
 #endif
 #ifndef __THROW
 # define __THROW
diff --git a/libmissing/inet_ntop.c b/libmissing/inet_ntop.c
index 08ac7d4..cd5dbf1 100644
--- a/libmissing/inet_ntop.c
+++ b/libmissing/inet_ntop.c
@@ -1,6 +1,6 @@
 /* inet_ntop.c -- convert IPv4 and IPv6 addresses from binary to text form
 
-   Copyright (C) 2005, 2006, 2008, 2009  Free Software Foundation, Inc.
+   Copyright (C) 2005-2006, 2008-2010 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
diff --git a/libmissing/langinfo.in.h b/libmissing/langinfo.in.h
index e76bffa..6d15f2f 100644
--- a/libmissing/langinfo.in.h
+++ b/libmissing/langinfo.in.h
@@ -1,5 +1,5 @@
 /* Substitute for and wrapper around <langinfo.h>.
-   Copyright (C) 2009 Free Software Foundation, Inc.
+   Copyright (C) 2009, 2010 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
@@ -123,7 +123,7 @@ typedef int nl_item;
 
 #endif
 
-/* The definition of GL_LINK_WARNING is copied here.  */
+/* The definition of _GL_WARN_ON_USE is copied here.  */
 
 /* Declare overridden functions.  */
 
@@ -146,10 +146,10 @@ extern char *nl_langinfo (nl_item item);
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef nl_langinfo
-# define nl_langinfo(i)                      \
-    (GL_LINK_WARNING ("nl_langinfo is not portable - " \
-                      "use gnulib module nl_langinfo for portability"), \
-     nl_langinfo (i))
+# if HAVE_RAW_DECL_NL_LANGINFO
+_GL_WARN_ON_USE (nl_langinfo, "nl_langinfo is not portable - "
+                 "use gnulib module nl_langinfo for portability");
+# endif
 #endif
 
 
diff --git a/libmissing/localcharset.c b/libmissing/localcharset.c
index 14359fc..29de23d 100644
--- a/libmissing/localcharset.c
+++ b/libmissing/localcharset.c
@@ -1,6 +1,6 @@
 /* Determine a canonical name for the current locale's character encoding.
 
-   Copyright (C) 2000-2006, 2008-2009 Free Software Foundation, Inc.
+   Copyright (C) 2000-2006, 2008-2010 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
diff --git a/libmissing/localcharset.h b/libmissing/localcharset.h
index 941b658..c18f492 100644
--- a/libmissing/localcharset.h
+++ b/libmissing/localcharset.h
@@ -1,5 +1,5 @@
 /* Determine a canonical name for the current locale's character encoding.
-   Copyright (C) 2000-2003, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2000-2003, 2009-2010 Free Software Foundation, Inc.
    This file is part of the GNU CHARSET Library.
 
    This program is free software; you can redistribute it and/or modify
diff --git a/libmissing/m4/00gnulib.m4 b/libmissing/m4/00gnulib.m4
index d4d04d1..301469b 100644
--- a/libmissing/m4/00gnulib.m4
+++ b/libmissing/m4/00gnulib.m4
@@ -1,5 +1,5 @@
 # 00gnulib.m4 serial 2
-dnl Copyright (C) 2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/alloca.m4 b/libmissing/m4/alloca.m4
index 4b978e1..f3ee343 100644
--- a/libmissing/m4/alloca.m4
+++ b/libmissing/m4/alloca.m4
@@ -1,5 +1,6 @@
 # alloca.m4 serial 9
-dnl Copyright (C) 2002-2004, 2006, 2007, 2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2004, 2006-2007, 2009-2010 Free Software Foundation,
+dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/arpa_inet_h.m4 b/libmissing/m4/arpa_inet_h.m4
index c97b1a8..4360dd8 100644
--- a/libmissing/m4/arpa_inet_h.m4
+++ b/libmissing/m4/arpa_inet_h.m4
@@ -1,5 +1,5 @@
-# arpa_inet_h.m4 serial 5
-dnl Copyright (C) 2006, 2008, 2009 Free Software Foundation, Inc.
+# arpa_inet_h.m4 serial 7
+dnl Copyright (C) 2006, 2008, 2009, 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -16,20 +16,28 @@ AC_DEFUN([gl_HEADER_ARPA_INET],
   if test $ac_cv_header_arpa_inet_h = yes; then
     HAVE_ARPA_INET_H=1
   else
-    ARPA_INET_H='arpa/inet.h'
     HAVE_ARPA_INET_H=0
   fi
   AC_SUBST([HAVE_ARPA_INET_H])
-  dnl Execute this unconditionally, because ARPA_INET_H may be set by other
-  dnl modules, after this code is executed.
+  dnl <arpa/inet.h> is always overridden, because of GNULIB_POSIXCHECK.
   gl_CHECK_NEXT_HEADERS([arpa/inet.h])
+
+  dnl Check for declarations of anything we want to poison if the
+  dnl corresponding gnulib module is not in use.
+  gl_WARN_ON_USE_PREPARE([[
+/* On some systems, this header is not self-consistent.  */
+#ifndef __GLIBC__
+# include <sys/socket.h>
+#endif
+#include <arpa/inet.h>
+    ]], [inet_ntop inet_pton])
 ])
 
 dnl Unconditionally enables the replacement of <arpa/inet.h>.
 AC_DEFUN([gl_REPLACE_ARPA_INET_H],
 [
-  AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS])
-  ARPA_INET_H='arpa/inet.h'
+  dnl This is a no-op, because <arpa/inet.h> is always overridden.
+  :
 ])
 
 AC_DEFUN([gl_ARPA_INET_MODULE_INDICATOR],
@@ -46,5 +54,4 @@ AC_DEFUN([gl_ARPA_INET_H_DEFAULTS],
   dnl Assume proper GNU behavior unless another module says otherwise.
   HAVE_DECL_INET_NTOP=1;  AC_SUBST([HAVE_DECL_INET_NTOP])
   HAVE_DECL_INET_PTON=1;  AC_SUBST([HAVE_DECL_INET_PTON])
-  ARPA_INET_H='';         AC_SUBST([ARPA_INET_H])
 ])
diff --git a/libmissing/m4/close.m4 b/libmissing/m4/close.m4
index fdcc96b..1ee3add 100644
--- a/libmissing/m4/close.m4
+++ b/libmissing/m4/close.m4
@@ -1,5 +1,5 @@
 # close.m4 serial 5
-dnl Copyright (C) 2008-2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/codeset.m4 b/libmissing/m4/codeset.m4
index 413217b..a53c042 100644
--- a/libmissing/m4/codeset.m4
+++ b/libmissing/m4/codeset.m4
@@ -1,5 +1,5 @@
 # codeset.m4 serial 4 (gettext-0.18)
-dnl Copyright (C) 2000-2002, 2006, 2008, 2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2000-2002, 2006, 2008-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/d-type.m4 b/libmissing/m4/d-type.m4
index bceeb95..615b926 100644
--- a/libmissing/m4/d-type.m4
+++ b/libmissing/m4/d-type.m4
@@ -5,7 +5,7 @@ dnl
 dnl Check whether struct dirent has a member named d_type.
 dnl
 
-# Copyright (C) 1997, 1999-2004, 2006, 2009 Free Software Foundation, Inc.
+# Copyright (C) 1997, 1999-2004, 2006, 2009-2010 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
diff --git a/libmissing/m4/dirent_h.m4 b/libmissing/m4/dirent_h.m4
index 481212b..1328ee3 100644
--- a/libmissing/m4/dirent_h.m4
+++ b/libmissing/m4/dirent_h.m4
@@ -1,5 +1,5 @@
-# dirent_h.m4 serial 7
-dnl Copyright (C) 2008-2009 Free Software Foundation, Inc.
+# dirent_h.m4 serial 9
+dnl Copyright (C) 2008-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -12,16 +12,20 @@ AC_DEFUN([gl_DIRENT_H],
   dnl once only, before all statements that occur in other macros.
   AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
 
-  dnl Execute this unconditionally, because DIRENT_H may be set by other
-  dnl modules, after this code is executed.
+  dnl <dirent.h> is always overridden, because of GNULIB_POSIXCHECK.
   gl_CHECK_NEXT_HEADERS([dirent.h])
+
+  dnl Check for declarations of anything we want to poison if the
+  dnl corresponding gnulib module is not in use.
+  gl_WARN_ON_USE_PREPARE([[#include <dirent.h>
+    ]], [alphasort dirfd fdopendir scandir])
 ])
 
 dnl Unconditionally enables the replacement of <dirent.h>.
 AC_DEFUN([gl_REPLACE_DIRENT_H],
 [
-  AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
-  DIRENT_H='dirent.h'
+  dnl This is a no-op, because <dirent.h> is always overridden.
+  :
 ])
 
 AC_DEFUN([gl_DIRENT_MODULE_INDICATOR],
@@ -46,5 +50,4 @@ AC_DEFUN([gl_DIRENT_H_DEFAULTS],
   REPLACE_CLOSEDIR=0;   AC_SUBST([REPLACE_CLOSEDIR])
   REPLACE_FDOPENDIR=0;  AC_SUBST([REPLACE_FDOPENDIR])
   REPLACE_OPENDIR=0;    AC_SUBST([REPLACE_OPENDIR])
-  DIRENT_H='';          AC_SUBST([DIRENT_H])
 ])
diff --git a/libmissing/m4/dirfd.m4 b/libmissing/m4/dirfd.m4
index fe0975d..7fefa2e 100644
--- a/libmissing/m4/dirfd.m4
+++ b/libmissing/m4/dirfd.m4
@@ -2,7 +2,7 @@
 
 dnl Find out how to get the file descriptor associated with an open DIR*.
 
-# Copyright (C) 2001-2006, 2008-2009 Free Software Foundation, Inc.
+# Copyright (C) 2001-2006, 2008-2010 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/errno_h.m4 b/libmissing/m4/errno_h.m4
index 4ce1ccb..d02a039 100644
--- a/libmissing/m4/errno_h.m4
+++ b/libmissing/m4/errno_h.m4
@@ -1,5 +1,5 @@
 # errno_h.m4 serial 6
-dnl Copyright (C) 2004, 2006, 2008, 2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2004, 2006, 2008, 2009, 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/extensions.m4 b/libmissing/m4/extensions.m4
index ac19b36..7d9458a 100644
--- a/libmissing/m4/extensions.m4
+++ b/libmissing/m4/extensions.m4
@@ -1,7 +1,7 @@
 # serial 9  -*- Autoconf -*-
 # Enable extensions on systems that normally disable them.
 
-# Copyright (C) 2003, 2006-2009 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2006-2010 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/fclose.m4 b/libmissing/m4/fclose.m4
index ab2986f..85de629 100644
--- a/libmissing/m4/fclose.m4
+++ b/libmissing/m4/fclose.m4
@@ -1,5 +1,5 @@
 # fclose.m4 serial 2
-dnl Copyright (C) 2008-2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/fcntl-o.m4 b/libmissing/m4/fcntl-o.m4
index 10d564c..67167cb 100644
--- a/libmissing/m4/fcntl-o.m4
+++ b/libmissing/m4/fcntl-o.m4
@@ -1,5 +1,5 @@
 # fcntl-o.m4 serial 1
-dnl Copyright (C) 2006, 2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2006, 2009, 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/float_h.m4 b/libmissing/m4/float_h.m4
index 6cdc3f1..a74a0d9 100644
--- a/libmissing/m4/float_h.m4
+++ b/libmissing/m4/float_h.m4
@@ -1,5 +1,5 @@
 # float_h.m4 serial 3
-dnl Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/fnmatch.m4 b/libmissing/m4/fnmatch.m4
index 9481a10..212ead5 100644
--- a/libmissing/m4/fnmatch.m4
+++ b/libmissing/m4/fnmatch.m4
@@ -1,6 +1,6 @@
 # Check for fnmatch - serial 4.
 
-# Copyright (C) 2000-2007, 2009 Free Software Foundation, Inc.
+# Copyright (C) 2000-2007, 2009-2010 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/getaddrinfo.m4 b/libmissing/m4/getaddrinfo.m4
index 4445072..05fd2b6 100644
--- a/libmissing/m4/getaddrinfo.m4
+++ b/libmissing/m4/getaddrinfo.m4
@@ -1,5 +1,5 @@
 # getaddrinfo.m4 serial 22
-dnl Copyright (C) 2004-2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2004-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/getlogin_r.m4 b/libmissing/m4/getlogin_r.m4
index eaa8caf..455e081 100644
--- a/libmissing/m4/getlogin_r.m4
+++ b/libmissing/m4/getlogin_r.m4
@@ -1,6 +1,6 @@
-#serial 4
+#serial 5
 
-# Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+# Copyright (C) 2005-2007, 2009-2010 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -14,13 +14,16 @@ dnl
 AC_DEFUN([gl_GETLOGIN_R],
 [
   AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+
+  dnl Persuade glibc <unistd.h> to declare getlogin_r().
+  AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
   AC_CHECK_FUNCS_ONCE([getlogin_r])
   if test $ac_cv_func_getlogin_r = no; then
     AC_LIBOBJ([getlogin_r])
     gl_PREREQ_GETLOGIN_R
-    if test $ac_cv_have_decl_getlogin_r = yes; then
-      HAVE_DECL_GETLOGIN_R=1
-    else
+    AC_CHECK_DECLS_ONCE([getlogin_r])
+    if test $ac_cv_have_decl_getlogin_r = no; then
       HAVE_DECL_GETLOGIN_R=0
     fi
   fi
@@ -29,5 +32,4 @@ AC_DEFUN([gl_GETLOGIN_R],
 AC_DEFUN([gl_PREREQ_GETLOGIN_R],
 [
   AC_CHECK_DECLS_ONCE([getlogin])
-  AC_CHECK_DECLS_ONCE([getlogin_r])
 ])
diff --git a/libmissing/m4/glibc21.m4 b/libmissing/m4/glibc21.m4
index 2d36015..68ada9d 100644
--- a/libmissing/m4/glibc21.m4
+++ b/libmissing/m4/glibc21.m4
@@ -1,5 +1,5 @@
 # glibc21.m4 serial 4
-dnl Copyright (C) 2000-2002, 2004, 2008-2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2000-2002, 2004, 2008-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/glob.m4 b/libmissing/m4/glob.m4
index 18d0efa..545c37c 100644
--- a/libmissing/m4/glob.m4
+++ b/libmissing/m4/glob.m4
@@ -1,5 +1,5 @@
 # glob.m4 serial 10
-dnl Copyright (C) 2005-2007, 2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2005-2007, 2009-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/gnulib-cache.m4 b/libmissing/m4/gnulib-cache.m4
index d41ea3b..850d3bc 100644
--- a/libmissing/m4/gnulib-cache.m4
+++ b/libmissing/m4/gnulib-cache.m4
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2009 Free Software Foundation, Inc.
+# Copyright (C) 2002-2010 Free Software Foundation, Inc.
 #
 # This file is free software, distributed under the terms of the GNU
 # General Public License.  As a special exception to the GNU General
diff --git a/libmissing/m4/gnulib-common.m4 b/libmissing/m4/gnulib-common.m4
index 63c6300..b7812a8 100644
--- a/libmissing/m4/gnulib-common.m4
+++ b/libmissing/m4/gnulib-common.m4
@@ -1,5 +1,5 @@
-# gnulib-common.m4 serial 11
-dnl Copyright (C) 2007-2009 Free Software Foundation, Inc.
+# gnulib-common.m4 serial 12
+dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -52,6 +52,14 @@ m4_ifndef([m4_foreach_w],
   [m4_define([m4_foreach_w],
     [m4_foreach([$1], m4_split(m4_normalize([$2]), [ ]), [$3])])])
 
+# AS_VAR_IF(VAR, VALUE, [IF-MATCH], [IF-NOT-MATCH])
+# ----------------------------------------------------
+# Backport of autoconf-2.63b's macro.
+# Remove this macro when we can assume autoconf >= 2.64.
+m4_ifndef([AS_VAR_IF],
+[m4_define([AS_VAR_IF],
+[AS_IF([test x"AS_VAR_GET([$1])" = x""$2], [$3], [$4])])])
+
 # AC_PROG_MKDIR_P
 # is a backport of autoconf-2.60's AC_PROG_MKDIR_P.
 # Remove this macro when we can assume autoconf >= 2.60.
diff --git a/libmissing/m4/gnulib-comp.m4 b/libmissing/m4/gnulib-comp.m4
index a948c8f..957fe33 100644
--- a/libmissing/m4/gnulib-comp.m4
+++ b/libmissing/m4/gnulib-comp.m4
@@ -1,5 +1,5 @@
 # DO NOT EDIT! GENERATED AUTOMATICALLY!
-# Copyright (C) 2002-2009 Free Software Foundation, Inc.
+# Copyright (C) 2002-2010 Free Software Foundation, Inc.
 #
 # This file is free software, distributed under the terms of the GNU
 # General Public License.  As a special exception to the GNU General
@@ -317,7 +317,7 @@ AC_DEFUN([gltests_LIBSOURCES], [
 AC_DEFUN([gl_FILE_LIST], [
   build-aux/arg-nonnull.h
   build-aux/config.rpath
-  build-aux/link-warning.h
+  build-aux/warn-on-use.h
   lib/alignof.h
   lib/alloca.c
   lib/alloca.in.h
@@ -491,6 +491,7 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/tm_gmtoff.m4
   m4/unistd_h.m4
   m4/vasnprintf.m4
+  m4/warn-on-use.m4
   m4/wchar.m4
   m4/wchar_t.m4
   m4/wctob.m4
@@ -510,6 +511,7 @@ AC_DEFUN([gl_FILE_LIST], [
   tests/test-errno.c
   tests/test-fnmatch.c
   tests/test-getaddrinfo.c
+  tests/test-getlogin_r.c
   tests/test-glob.c
   tests/test-iconv.c
   tests/test-inet_ntop.c
diff --git a/libmissing/m4/gnulib-tool.m4 b/libmissing/m4/gnulib-tool.m4
index 03b75a9..69e7733 100644
--- a/libmissing/m4/gnulib-tool.m4
+++ b/libmissing/m4/gnulib-tool.m4
@@ -1,5 +1,5 @@
 # gnulib-tool.m4 serial 2
-dnl Copyright (C) 2004-2005, 2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2004-2005, 2009-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/hostent.m4 b/libmissing/m4/hostent.m4
index ca16a74..1111041 100644
--- a/libmissing/m4/hostent.m4
+++ b/libmissing/m4/hostent.m4
@@ -1,5 +1,5 @@
 # hostent.m4 serial 1
-dnl Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/iconv.m4 b/libmissing/m4/iconv.m4
index ce21b0b..f46ff14 100644
--- a/libmissing/m4/iconv.m4
+++ b/libmissing/m4/iconv.m4
@@ -1,5 +1,5 @@
-# iconv.m4 serial AM8 (gettext-0.18)
-dnl Copyright (C) 2000-2002, 2007-2009 Free Software Foundation, Inc.
+# iconv.m4 serial 9 (gettext-0.18)
+dnl Copyright (C) 2000-2002, 2007-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -58,7 +58,7 @@ AC_DEFUN([AM_ICONV_LINK],
   ])
   if test "$am_cv_func_iconv" = yes; then
     AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [
-      dnl This tests against bugs in AIX 5.1 and HP-UX 11.11.
+      dnl This tests against bugs in AIX 5.1, HP-UX 11.11, Solaris 10.
       am_save_LIBS="$LIBS"
       if test $am_cv_lib_iconv = yes; then
         LIBS="$LIBS $LIBICONV"
@@ -87,6 +87,25 @@ int main ()
           return 1;
       }
   }
+  /* Test against Solaris 10 bug: Failures are not distinguishable from
+     successful returns.  */
+  {
+    iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
+    if (cd_ascii_to_88591 != (iconv_t)(-1))
+      {
+        static const char input[] = "\263";
+        char buf[10];
+        const char *inptr = input;
+        size_t inbytesleft = strlen (input);
+        char *outptr = buf;
+        size_t outbytesleft = sizeof (buf);
+        size_t res = iconv (cd_ascii_to_88591,
+                            (char **) &inptr, &inbytesleft,
+                            &outptr, &outbytesleft);
+        if (res == 0)
+          return 1;
+      }
+  }
 #if 0 /* This bug could be worked around by the caller.  */
   /* Test against HP-UX 11.11 bug: Positive return value instead of 0.  */
   {
diff --git a/libmissing/m4/include_next.m4 b/libmissing/m4/include_next.m4
index 2e6273f..c7e0672 100644
--- a/libmissing/m4/include_next.m4
+++ b/libmissing/m4/include_next.m4
@@ -1,5 +1,5 @@
 # include_next.m4 serial 14
-dnl Copyright (C) 2006-2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/inet_ntop.m4 b/libmissing/m4/inet_ntop.m4
index 2a8ff20..20e8d7c 100644
--- a/libmissing/m4/inet_ntop.m4
+++ b/libmissing/m4/inet_ntop.m4
@@ -1,5 +1,5 @@
 # inet_ntop.m4 serial 11
-dnl Copyright (C) 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2005, 2006, 2008, 2009, 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/intmax_t.m4 b/libmissing/m4/intmax_t.m4
index 264cb57..975caac 100644
--- a/libmissing/m4/intmax_t.m4
+++ b/libmissing/m4/intmax_t.m4
@@ -1,5 +1,6 @@
 # intmax_t.m4 serial 7
-dnl Copyright (C) 1997-2004, 2006-2007, 2009 Free Software Foundation, Inc.
+dnl Copyright (C) 1997-2004, 2006-2007, 2009-2010 Free Software Foundation,
+dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/inttypes_h.m4 b/libmissing/m4/inttypes_h.m4
index f4ca160..782d77e 100644
--- a/libmissing/m4/inttypes_h.m4
+++ b/libmissing/m4/inttypes_h.m4
@@ -1,5 +1,5 @@
 # inttypes_h.m4 serial 9
-dnl Copyright (C) 1997-2004, 2006, 2008, 2009 Free Software Foundation, Inc.
+dnl Copyright (C) 1997-2004, 2006, 2008-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/langinfo_h.m4 b/libmissing/m4/langinfo_h.m4
index 4975734..a4c5409 100644
--- a/libmissing/m4/langinfo_h.m4
+++ b/libmissing/m4/langinfo_h.m4
@@ -1,5 +1,5 @@
-# langinfo_h.m4 serial 1
-dnl Copyright (C) 2009 Free Software Foundation, Inc.
+# langinfo_h.m4 serial 3
+dnl Copyright (C) 2009, 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -52,12 +52,10 @@ int a = ERA;
   AC_SUBST([HAVE_LANGINFO_CODESET])
   AC_SUBST([HAVE_LANGINFO_ERA])
 
-  if test $HAVE_LANGINFO_H = 1 && test $HAVE_LANGINFO_CODESET = 1 && test $HAVE_LANGINFO_ERA = 1; then
-    LANGINFO_H=
-  else
-    LANGINFO_H='langinfo.h'
-  fi
-  AC_SUBST([LANGINFO_H])
+  dnl Check for declarations of anything we want to poison if the
+  dnl corresponding gnulib module is not in use.
+  gl_WARN_ON_USE_PREPARE([[#include <langinfo.h>
+    ]], [nl_langinfo])
 ])
 
 AC_DEFUN([gl_LANGINFO_MODULE_INDICATOR],
diff --git a/libmissing/m4/lib-ld.m4 b/libmissing/m4/lib-ld.m4
index 4b4db07..ebb3052 100644
--- a/libmissing/m4/lib-ld.m4
+++ b/libmissing/m4/lib-ld.m4
@@ -1,5 +1,5 @@
 # lib-ld.m4 serial 4 (gettext-0.18)
-dnl Copyright (C) 1996-2003, 2009 Free Software Foundation, Inc.
+dnl Copyright (C) 1996-2003, 2009-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/lib-link.m4 b/libmissing/m4/lib-link.m4
index 2f8b7ff..90e1ac9 100644
--- a/libmissing/m4/lib-link.m4
+++ b/libmissing/m4/lib-link.m4
@@ -1,5 +1,5 @@
 # lib-link.m4 serial 20 (gettext-0.18)
-dnl Copyright (C) 2001-2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2001-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/lib-prefix.m4 b/libmissing/m4/lib-prefix.m4
index 4b7ee33..1601cea 100644
--- a/libmissing/m4/lib-prefix.m4
+++ b/libmissing/m4/lib-prefix.m4
@@ -1,5 +1,5 @@
 # lib-prefix.m4 serial 7 (gettext-0.18)
-dnl Copyright (C) 2001-2005, 2008-2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2001-2005, 2008-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/localcharset.m4 b/libmissing/m4/localcharset.m4
index 90b9403..ee2e801 100644
--- a/libmissing/m4/localcharset.m4
+++ b/libmissing/m4/localcharset.m4
@@ -1,5 +1,5 @@
 # localcharset.m4 serial 7
-dnl Copyright (C) 2002, 2004, 2006, 2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 2004, 2006, 2009, 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/locale-fr.m4 b/libmissing/m4/locale-fr.m4
index 653a5bc..001f539 100644
--- a/libmissing/m4/locale-fr.m4
+++ b/libmissing/m4/locale-fr.m4
@@ -1,5 +1,5 @@
 # locale-fr.m4 serial 11
-dnl Copyright (C) 2003, 2005-2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2005-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/locale-ja.m4 b/libmissing/m4/locale-ja.m4
index 9360576..0eedaf1 100644
--- a/libmissing/m4/locale-ja.m4
+++ b/libmissing/m4/locale-ja.m4
@@ -1,5 +1,5 @@
 # locale-ja.m4 serial 7
-dnl Copyright (C) 2003, 2005-2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2005-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/locale-tr.m4 b/libmissing/m4/locale-tr.m4
index 6162f65..404c063 100644
--- a/libmissing/m4/locale-tr.m4
+++ b/libmissing/m4/locale-tr.m4
@@ -1,5 +1,5 @@
 # locale-tr.m4 serial 6
-dnl Copyright (C) 2003, 2005-2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2005-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/locale-zh.m4 b/libmissing/m4/locale-zh.m4
index 36a5f1d..777fd14 100644
--- a/libmissing/m4/locale-zh.m4
+++ b/libmissing/m4/locale-zh.m4
@@ -1,5 +1,5 @@
 # locale-zh.m4 serial 6
-dnl Copyright (C) 2003, 2005-2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2005-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/longlong.m4 b/libmissing/m4/longlong.m4
index 6d17ea3..cca3c1a 100644
--- a/libmissing/m4/longlong.m4
+++ b/libmissing/m4/longlong.m4
@@ -1,5 +1,5 @@
 # longlong.m4 serial 14
-dnl Copyright (C) 1999-2007, 2009 Free Software Foundation, Inc.
+dnl Copyright (C) 1999-2007, 2009-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/malloc.m4 b/libmissing/m4/malloc.m4
index 8070171..910ac92 100644
--- a/libmissing/m4/malloc.m4
+++ b/libmissing/m4/malloc.m4
@@ -1,5 +1,5 @@
 # malloc.m4 serial 9
-dnl Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/mbrtowc.m4 b/libmissing/m4/mbrtowc.m4
index 2fddcc8..9ec93f5 100644
--- a/libmissing/m4/mbrtowc.m4
+++ b/libmissing/m4/mbrtowc.m4
@@ -1,5 +1,6 @@
 # mbrtowc.m4 serial 16
-dnl Copyright (C) 2001-2002, 2004-2005, 2008, 2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2001-2002, 2004-2005, 2008-2010 Free Software Foundation,
+dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/mbsinit.m4 b/libmissing/m4/mbsinit.m4
index 25b21c2..13907a5 100644
--- a/libmissing/m4/mbsinit.m4
+++ b/libmissing/m4/mbsinit.m4
@@ -1,5 +1,5 @@
 # mbsinit.m4 serial 3
-dnl Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/mbsrtowcs.m4 b/libmissing/m4/mbsrtowcs.m4
index 55b87c1..846a293 100644
--- a/libmissing/m4/mbsrtowcs.m4
+++ b/libmissing/m4/mbsrtowcs.m4
@@ -1,5 +1,5 @@
 # mbsrtowcs.m4 serial 5
-dnl Copyright (C) 2008-2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/mbstate_t.m4 b/libmissing/m4/mbstate_t.m4
index 6930f21..3e2df29 100644
--- a/libmissing/m4/mbstate_t.m4
+++ b/libmissing/m4/mbstate_t.m4
@@ -1,5 +1,5 @@
 # mbstate_t.m4 serial 12
-dnl Copyright (C) 2000-2002, 2008-2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2000-2002, 2008-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/memchr.m4 b/libmissing/m4/memchr.m4
index a96d114..94596ef 100644
--- a/libmissing/m4/memchr.m4
+++ b/libmissing/m4/memchr.m4
@@ -1,5 +1,5 @@
 # memchr.m4 serial 7
-dnl Copyright (C) 2002-2004, 2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2004, 2009-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/mempcpy.m4 b/libmissing/m4/mempcpy.m4
index a3c022f..12df771 100644
--- a/libmissing/m4/mempcpy.m4
+++ b/libmissing/m4/mempcpy.m4
@@ -1,5 +1,6 @@
 # mempcpy.m4 serial 10
-dnl Copyright (C) 2003-2004, 2006-2007, 2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2003-2004, 2006-2007, 2009-2010 Free Software Foundation,
+dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/mktime.m4 b/libmissing/m4/mktime.m4
index bea8782..44b8d87 100644
--- a/libmissing/m4/mktime.m4
+++ b/libmissing/m4/mktime.m4
@@ -1,5 +1,6 @@
 # serial 15
-dnl Copyright (C) 2002-2003, 2005-2007, 2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2003, 2005-2007, 2009-2010 Free Software Foundation,
+dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/mmap-anon.m4 b/libmissing/m4/mmap-anon.m4
index 14b6270..a6b7b9a 100644
--- a/libmissing/m4/mmap-anon.m4
+++ b/libmissing/m4/mmap-anon.m4
@@ -1,5 +1,5 @@
 # mmap-anon.m4 serial 8
-dnl Copyright (C) 2005, 2007, 2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2005, 2007, 2009-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/multiarch.m4 b/libmissing/m4/multiarch.m4
index ec377ba..389bd2b 100644
--- a/libmissing/m4/multiarch.m4
+++ b/libmissing/m4/multiarch.m4
@@ -1,5 +1,5 @@
 # multiarch.m4 serial 5
-dnl Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/netdb_h.m4 b/libmissing/m4/netdb_h.m4
index 6cc2cfc..84afce6 100644
--- a/libmissing/m4/netdb_h.m4
+++ b/libmissing/m4/netdb_h.m4
@@ -1,5 +1,5 @@
-# netdb_h.m4 serial 5
-dnl Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+# netdb_h.m4 serial 6
+dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -7,6 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_HEADER_NETDB],
 [
   AC_REQUIRE([gl_NETDB_H_DEFAULTS])
+  AC_CHECK_HEADERS_ONCE([netdb.h])
   gl_CHECK_NEXT_HEADERS([netdb.h])
   if test $ac_cv_header_netdb_h = yes; then
     AC_COMPILE_IFELSE(
diff --git a/libmissing/m4/netinet_in_h.m4 b/libmissing/m4/netinet_in_h.m4
index a690b8d..cc7a44c 100644
--- a/libmissing/m4/netinet_in_h.m4
+++ b/libmissing/m4/netinet_in_h.m4
@@ -1,5 +1,5 @@
 # netinet_in_h.m4 serial 4
-dnl Copyright (C) 2006-2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/nl_langinfo.m4 b/libmissing/m4/nl_langinfo.m4
index 2855d0f..ad456a2 100644
--- a/libmissing/m4/nl_langinfo.m4
+++ b/libmissing/m4/nl_langinfo.m4
@@ -1,5 +1,5 @@
-# nl_langinfo.m4 serial 1
-dnl Copyright (C) 2009 Free Software Foundation, Inc.
+# nl_langinfo.m4 serial 3
+dnl Copyright (C) 2009, 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -8,11 +8,7 @@ AC_DEFUN([gl_FUNC_NL_LANGINFO],
 [
   AC_REQUIRE([gl_LANGINFO_H_DEFAULTS])
   AC_REQUIRE([gl_LANGINFO_H])
-  if test $HAVE_LANGINFO_H = 1; then
-    AC_CHECK_FUNCS_ONCE([nl_langinfo])
-  else
-    ac_cv_func_nl_langinfo=no
-  fi
+  AC_CHECK_FUNCS_ONCE([nl_langinfo])
   if test $ac_cv_func_nl_langinfo = yes; then
     if test $HAVE_LANGINFO_CODESET = 1 && test $HAVE_LANGINFO_ERA = 1; then
       :
diff --git a/libmissing/m4/onceonly.m4 b/libmissing/m4/onceonly.m4
index 2998ab2..4a3cd84 100644
--- a/libmissing/m4/onceonly.m4
+++ b/libmissing/m4/onceonly.m4
@@ -1,5 +1,5 @@
 # onceonly.m4 serial 6
-dnl Copyright (C) 2002-2003, 2005-2006, 2008-2009 Free Software Foundation,
+dnl Copyright (C) 2002-2003, 2005-2006, 2008-2010 Free Software Foundation,
 dnl Inc.
 dnl This file is free software, distributed under the terms of the GNU
 dnl General Public License.  As a special exception to the GNU General
diff --git a/libmissing/m4/pathmax.m4 b/libmissing/m4/pathmax.m4
index f2a975c..6a3f857 100644
--- a/libmissing/m4/pathmax.m4
+++ b/libmissing/m4/pathmax.m4
@@ -1,5 +1,6 @@
 # pathmax.m4 serial 8
-dnl Copyright (C) 2002-2003, 2005-2006, 2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2003, 2005-2006, 2009-2010 Free Software Foundation,
+dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/printf.m4 b/libmissing/m4/printf.m4
index 87aa45c..ebca536 100644
--- a/libmissing/m4/printf.m4
+++ b/libmissing/m4/printf.m4
@@ -1,5 +1,5 @@
 # printf.m4 serial 33
-dnl Copyright (C) 2003, 2007-2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2007-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/servent.m4 b/libmissing/m4/servent.m4
index 3ddc610..2ed961a 100644
--- a/libmissing/m4/servent.m4
+++ b/libmissing/m4/servent.m4
@@ -1,5 +1,5 @@
 # servent.m4 serial 1
-dnl Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/sigaction.m4 b/libmissing/m4/sigaction.m4
index 770479a..8f0d450 100644
--- a/libmissing/m4/sigaction.m4
+++ b/libmissing/m4/sigaction.m4
@@ -1,5 +1,5 @@
 # sigaction.m4 serial 5
-dnl Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/signal_h.m4 b/libmissing/m4/signal_h.m4
index e69befd..7f61e0b 100644
--- a/libmissing/m4/signal_h.m4
+++ b/libmissing/m4/signal_h.m4
@@ -1,5 +1,5 @@
-# signal_h.m4 serial 7
-dnl Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+# signal_h.m4 serial 9
+dnl Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -14,6 +14,13 @@ AC_DEFUN([gl_SIGNAL_H],
     [HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=0], [[
 #include <signal.h>
     ]])
+  AC_REQUIRE([AC_TYPE_UID_T])
+
+  dnl Check for declarations of anything we want to poison if the
+  dnl corresponding gnulib module is not in use.
+  gl_WARN_ON_USE_PREPARE([[#include <signal.h>
+    ]], [sigaction sigaddset sigdelset sigemptyset sigfillset sigismember
+    sigpending sigprocmask])
 ])
 
 AC_DEFUN([gl_SIGNAL_MODULE_INDICATOR],
diff --git a/libmissing/m4/signalblocking.m4 b/libmissing/m4/signalblocking.m4
index 82b0404..4459815 100644
--- a/libmissing/m4/signalblocking.m4
+++ b/libmissing/m4/signalblocking.m4
@@ -1,5 +1,5 @@
 # signalblocking.m4 serial 10
-dnl Copyright (C) 2001-2002, 2006-2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2001-2002, 2006-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/size_max.m4 b/libmissing/m4/size_max.m4
index 35bd3d6..ce992db 100644
--- a/libmissing/m4/size_max.m4
+++ b/libmissing/m4/size_max.m4
@@ -1,5 +1,5 @@
 # size_max.m4 serial 9
-dnl Copyright (C) 2003, 2005-2006, 2008-2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2005-2006, 2008-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/sleep.m4 b/libmissing/m4/sleep.m4
index c59b383..a5ec655 100644
--- a/libmissing/m4/sleep.m4
+++ b/libmissing/m4/sleep.m4
@@ -1,5 +1,5 @@
 # sleep.m4 serial 3
-dnl Copyright (C) 2007-2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/snprintf.m4 b/libmissing/m4/snprintf.m4
index df705f4..522b107 100644
--- a/libmissing/m4/snprintf.m4
+++ b/libmissing/m4/snprintf.m4
@@ -1,5 +1,5 @@
 # snprintf.m4 serial 5
-dnl Copyright (C) 2002-2004, 2007-2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2004, 2007-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/sockets.m4 b/libmissing/m4/sockets.m4
index 3edc010..aefb936 100644
--- a/libmissing/m4/sockets.m4
+++ b/libmissing/m4/sockets.m4
@@ -1,5 +1,5 @@
 # sockets.m4 serial 6
-dnl Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/socklen.m4 b/libmissing/m4/socklen.m4
index 36436ed..2933d4b 100644
--- a/libmissing/m4/socklen.m4
+++ b/libmissing/m4/socklen.m4
@@ -1,5 +1,5 @@
 # socklen.m4 serial 7
-dnl Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2005, 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/sockpfaf.m4 b/libmissing/m4/sockpfaf.m4
index bbdfabc..8a0c236 100644
--- a/libmissing/m4/sockpfaf.m4
+++ b/libmissing/m4/sockpfaf.m4
@@ -1,5 +1,5 @@
 # sockpfaf.m4 serial 7
-dnl Copyright (C) 2004, 2006, 2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2004, 2006, 2009, 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/stdbool.m4 b/libmissing/m4/stdbool.m4
index 5e22d7a..3d672d7 100644
--- a/libmissing/m4/stdbool.m4
+++ b/libmissing/m4/stdbool.m4
@@ -1,6 +1,6 @@
 # Check for stdbool.h that conforms to C99.
 
-dnl Copyright (C) 2002-2006, 2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2006, 2009-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/stddef_h.m4 b/libmissing/m4/stddef_h.m4
index 682e9c6..c8572de 100644
--- a/libmissing/m4/stddef_h.m4
+++ b/libmissing/m4/stddef_h.m4
@@ -1,6 +1,6 @@
 dnl A placeholder for POSIX 2008 <stddef.h>, for platforms that have issues.
 # stddef_h.m4 serial 1
-dnl Copyright (C) 2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2009, 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/stdint.m4 b/libmissing/m4/stdint.m4
index 819d629..1cc57e6 100644
--- a/libmissing/m4/stdint.m4
+++ b/libmissing/m4/stdint.m4
@@ -1,5 +1,5 @@
 # stdint.m4 serial 34
-dnl Copyright (C) 2001-2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2001-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/stdint_h.m4 b/libmissing/m4/stdint_h.m4
index 82f0c24..b8e3c6c 100644
--- a/libmissing/m4/stdint_h.m4
+++ b/libmissing/m4/stdint_h.m4
@@ -1,5 +1,5 @@
 # stdint_h.m4 serial 8
-dnl Copyright (C) 1997-2004, 2006, 2008, 2009 Free Software Foundation, Inc.
+dnl Copyright (C) 1997-2004, 2006, 2008-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/stdio_h.m4 b/libmissing/m4/stdio_h.m4
index c690565..20af579 100644
--- a/libmissing/m4/stdio_h.m4
+++ b/libmissing/m4/stdio_h.m4
@@ -1,5 +1,5 @@
-# stdio_h.m4 serial 22
-dnl Copyright (C) 2007-2009 Free Software Foundation, Inc.
+# stdio_h.m4 serial 24
+dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -7,6 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_STDIO_H],
 [
   AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+  AC_REQUIRE([AC_C_INLINE])
   gl_CHECK_NEXT_HEADERS([stdio.h])
   dnl No need to create extra modules for these functions. Everyone who uses
   dnl <stdio.h> likely needs them.
@@ -30,6 +31,13 @@ AC_DEFUN([gl_STDIO_H],
       AC_LIBOBJ([stdio-write])
     fi
   ])
+
+  dnl Check for declarations of anything we want to poison if the
+  dnl corresponding gnulib module is not in use, and which is not
+  dnl guaranteed by C89.
+  gl_WARN_ON_USE_PREPARE([[#include <stdio.h>
+    ]], [dprintf fpurge fseeko ftello getdelim getline popen renameat
+    snprintf vdprintf vsnprintf])
 ])
 
 AC_DEFUN([gl_STDIO_MODULE_INDICATOR],
diff --git a/libmissing/m4/stdlib_h.m4 b/libmissing/m4/stdlib_h.m4
index 10e010e..0693d1a 100644
--- a/libmissing/m4/stdlib_h.m4
+++ b/libmissing/m4/stdlib_h.m4
@@ -1,5 +1,5 @@
-# stdlib_h.m4 serial 21
-dnl Copyright (C) 2007-2009 Free Software Foundation, Inc.
+# stdlib_h.m4 serial 22
+dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -22,6 +22,20 @@ AC_DEFUN([gl_STDLIB_H],
       # include <random.h>
       #endif
     ]])
+
+  dnl Check for declarations of anything we want to poison if the
+  dnl corresponding gnulib module is not in use, and which is not
+  dnl guaranteed by C89.
+  gl_WARN_ON_USE_PREPARE([[#include <stdlib.h>
+#if HAVE_SYS_LOADAVG_H
+# include <sys/loadavg.h>
+#endif
+#if HAVE_RANDOM_H
+# include <random.h>
+#endif
+    ]], [atoll canonicalize_file_name getloadavg getsubopt mkdtemp
+    mkostemp mkostemps mkstemp mkstemps random_r initstat_r srandom_r
+    setstate_r realpath rpmatch setenv strtod strtoll strtoull unsetenv])
 ])
 
 AC_DEFUN([gl_STDLIB_MODULE_INDICATOR],
diff --git a/libmissing/m4/strcase.m4 b/libmissing/m4/strcase.m4
index 0dfdb1a..33de423 100644
--- a/libmissing/m4/strcase.m4
+++ b/libmissing/m4/strcase.m4
@@ -1,5 +1,5 @@
 # strcase.m4 serial 10
-dnl Copyright (C) 2002, 2005-2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 2005-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/strerror.m4 b/libmissing/m4/strerror.m4
index 44e69ef..1649b24 100644
--- a/libmissing/m4/strerror.m4
+++ b/libmissing/m4/strerror.m4
@@ -1,5 +1,5 @@
 # strerror.m4 serial 9
-dnl Copyright (C) 2002, 2007-2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 2007-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/string_h.m4 b/libmissing/m4/string_h.m4
index e870534..73c6d83 100644
--- a/libmissing/m4/string_h.m4
+++ b/libmissing/m4/string_h.m4
@@ -1,11 +1,11 @@
 # Configure a GNU-like replacement for <string.h>.
 
-# Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+# Copyright (C) 2007-2010 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 9
+# serial 11
 
 # Written by Paul Eggert.
 
@@ -21,6 +21,13 @@ AC_DEFUN([gl_HEADER_STRING_H_BODY],
   AC_REQUIRE([AC_C_RESTRICT])
   AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
   gl_CHECK_NEXT_HEADERS([string.h])
+
+  dnl Check for declarations of anything we want to poison if the
+  dnl corresponding gnulib module is not in use, and which is not
+  dnl guaranteed by C89.
+  gl_WARN_ON_USE_PREPARE([[#include <string.h>
+    ]], [memmem mempcpy memrchr rawmemchr stpcpy stpncpy strchrnul strdup
+    strndup strnlen strpbrk strsep strcasestr strtok_r strsignal strverscmp])
 ])
 
 AC_DEFUN([gl_STRING_MODULE_INDICATOR],
@@ -64,7 +71,8 @@ AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS],
   GNULIB_MBSTOK_R=0;    AC_SUBST([GNULIB_MBSTOK_R])
   GNULIB_STRERROR=0;    AC_SUBST([GNULIB_STRERROR])
   GNULIB_STRSIGNAL=0;   AC_SUBST([GNULIB_STRSIGNAL])
-  GNULIB_STRVERSCMP=0;   AC_SUBST([GNULIB_STRVERSCMP])
+  GNULIB_STRVERSCMP=0;  AC_SUBST([GNULIB_STRVERSCMP])
+  HAVE_MBSLEN=0;        AC_SUBST([HAVE_MBSLEN])
   dnl Assume proper GNU behavior unless another module says otherwise.
   HAVE_DECL_MEMMEM=1;           AC_SUBST([HAVE_DECL_MEMMEM])
   HAVE_MEMPCPY=1;               AC_SUBST([HAVE_MEMPCPY])
diff --git a/libmissing/m4/strings_h.m4 b/libmissing/m4/strings_h.m4
index de0e0a6..26aa1f7 100644
--- a/libmissing/m4/strings_h.m4
+++ b/libmissing/m4/strings_h.m4
@@ -1,6 +1,7 @@
 # Configure a replacement for <string.h>.
+# serial 2
 
-# Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+# Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -16,6 +17,11 @@ AC_DEFUN([gl_HEADER_STRINGS_H_BODY],
 [
   AC_REQUIRE([gl_HEADER_STRINGS_H_DEFAULTS])
   gl_CHECK_NEXT_HEADERS([strings.h])
+
+  dnl Check for declarations of anything we want to poison if the
+  dnl corresponding gnulib module is not in use.
+  gl_WARN_ON_USE_PREPARE([[#include <strings.h>
+    ]], [strcasecmp strncasecmp])
 ])
 
 AC_DEFUN([gl_STRINGS_MODULE_INDICATOR],
diff --git a/libmissing/m4/strptime.m4 b/libmissing/m4/strptime.m4
index ee49a6e..7c081f1 100644
--- a/libmissing/m4/strptime.m4
+++ b/libmissing/m4/strptime.m4
@@ -1,5 +1,5 @@
 # strptime.m4 serial 5
-dnl Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/strsep.m4 b/libmissing/m4/strsep.m4
index 887d688..fb4d396 100644
--- a/libmissing/m4/strsep.m4
+++ b/libmissing/m4/strsep.m4
@@ -1,5 +1,6 @@
 # strsep.m4 serial 9
-dnl Copyright (C) 2002, 2003, 2004, 2007, 2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 2003, 2004, 2007, 2009, 2010 Free Software Foundation,
+dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/sys_select_h.m4 b/libmissing/m4/sys_select_h.m4
index 991c7b7..590554a 100644
--- a/libmissing/m4/sys_select_h.m4
+++ b/libmissing/m4/sys_select_h.m4
@@ -1,5 +1,5 @@
-# sys_select_h.m4 serial 8
-dnl Copyright (C) 2006-2009 Free Software Foundation, Inc.
+# sys_select_h.m4 serial 11
+dnl Copyright (C) 2006-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -45,20 +45,28 @@ AC_DEFUN([gl_HEADER_SYS_SELECT],
           ])
       fi
     ])
-  if test $gl_cv_header_sys_select_h_selfcontained = yes; then
-    SYS_SELECT_H=''
+  AC_CHECK_HEADERS_ONCE([sys/select.h])
+  gl_CHECK_NEXT_HEADERS([sys/select.h])
+  if test $ac_cv_header_sys_select_h = yes; then
+    HAVE_SYS_SELECT_H=1
   else
-    SYS_SELECT_H='sys/select.h'
-    gl_CHECK_NEXT_HEADERS([sys/select.h])
-    if test $ac_cv_header_sys_select_h = yes; then
-      HAVE_SYS_SELECT_H=1
-    else
-      HAVE_SYS_SELECT_H=0
-    fi
-    AC_SUBST([HAVE_SYS_SELECT_H])
+    HAVE_SYS_SELECT_H=0
+  fi
+  AC_SUBST([HAVE_SYS_SELECT_H])
+  if test $gl_cv_header_sys_select_h_selfcontained != yes; then
     gl_PREREQ_SYS_H_WINSOCK2
   fi
-  AC_SUBST([SYS_SELECT_H])
+
+  dnl Check for declarations of anything we want to poison if the
+  dnl corresponding gnulib module is not in use.
+  gl_WARN_ON_USE_PREPARE([[
+/* Some systems require prerequisite headers.  */
+#include <sys/types.h>
+#if !defined __GLIBC__ && HAVE_SYS_TIME_H
+# include <sys/time.h>
+#endif
+#include <sys/select.h>
+    ]], [select])
 ])
 
 AC_DEFUN([gl_SYS_SELECT_MODULE_INDICATOR],
diff --git a/libmissing/m4/sys_socket_h.m4 b/libmissing/m4/sys_socket_h.m4
index e864b2c..1d47656 100644
--- a/libmissing/m4/sys_socket_h.m4
+++ b/libmissing/m4/sys_socket_h.m4
@@ -1,5 +1,5 @@
-# sys_socket_h.m4 serial 13
-dnl Copyright (C) 2005-2009 Free Software Foundation, Inc.
+# sys_socket_h.m4 serial 14
+dnl Copyright (C) 2005-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -66,6 +66,18 @@ AC_DEFUN([gl_HEADER_SYS_SOCKET],
     gl_PREREQ_SYS_H_WINSOCK2
   fi
   AC_SUBST([SYS_SOCKET_H])
+
+  dnl Check for declarations of anything we want to poison if the
+  dnl corresponding gnulib module is not in use.
+  gl_WARN_ON_USE_PREPARE([[
+/* Some systems require prerequisite headers.  */
+#include <sys/types.h>
+#if !defined __GLIBC__ && HAVE_SYS_TIME_H
+# include <sys/time.h>
+#endif
+#include <sys/select.h>
+    ]], [socket connect accept bind getpeername getsockname getsockopt
+    listen recv send recvfrom sendto setsockopt shutdown accept4])
 ])
 
 AC_DEFUN([gl_PREREQ_SYS_H_SOCKET],
diff --git a/libmissing/m4/sys_stat_h.m4 b/libmissing/m4/sys_stat_h.m4
index 838cf48..5a113d0 100644
--- a/libmissing/m4/sys_stat_h.m4
+++ b/libmissing/m4/sys_stat_h.m4
@@ -1,5 +1,5 @@
-# sys_stat_h.m4 serial 21   -*- Autoconf -*-
-dnl Copyright (C) 2006-2009 Free Software Foundation, Inc.
+# sys_stat_h.m4 serial 22   -*- Autoconf -*-
+dnl Copyright (C) 2006-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -27,6 +27,11 @@ AC_DEFUN([gl_HEADER_SYS_STAT_H],
     [#include <sys/types.h>
      #include <sys/stat.h>])
 
+  dnl Check for declarations of anything we want to poison if the
+  dnl corresponding gnulib module is not in use.
+  gl_WARN_ON_USE_PREPARE([[#include <sys/stat.h>
+    ]], [fchmodat fstatat futimens lchmod lstat mkdirat mkfifo mkfifoat
+    mknod mknodat stat utimensat])
 ]) # gl_HEADER_SYS_STAT_H
 
 AC_DEFUN([gl_SYS_STAT_MODULE_INDICATOR],
diff --git a/libmissing/m4/sys_time_h.m4 b/libmissing/m4/sys_time_h.m4
index 10fab8e..9c16487 100644
--- a/libmissing/m4/sys_time_h.m4
+++ b/libmissing/m4/sys_time_h.m4
@@ -1,6 +1,7 @@
 # Configure a replacement for <sys/time.h>.
+# serial 2
 
-# Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+# Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -18,6 +19,7 @@ AC_DEFUN([gl_HEADER_SYS_TIME_H],
 AC_DEFUN([gl_HEADER_SYS_TIME_H_BODY],
 [
   AC_REQUIRE([AC_C_RESTRICT])
+  AC_CHECK_HEADERS_ONCE([sys/time.h])
   gl_CHECK_NEXT_HEADERS([sys/time.h])
 
   if test $ac_cv_header_sys_time_h = yes; then
diff --git a/libmissing/m4/time_h.m4 b/libmissing/m4/time_h.m4
index c038b17..c00bfae 100644
--- a/libmissing/m4/time_h.m4
+++ b/libmissing/m4/time_h.m4
@@ -1,6 +1,6 @@
 # Configure a more-standard replacement for <time.h>.
 
-# Copyright (C) 2000-2001, 2003-2007, 2009 Free Software Foundation, Inc.
+# Copyright (C) 2000-2001, 2003-2007, 2009-2010 Free Software Foundation, Inc.
 
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
diff --git a/libmissing/m4/time_r.m4 b/libmissing/m4/time_r.m4
index de22db9..b5938e7 100644
--- a/libmissing/m4/time_r.m4
+++ b/libmissing/m4/time_r.m4
@@ -1,6 +1,7 @@
 dnl Reentrant time functions like localtime_r.
 
-dnl Copyright (C) 2003, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
+dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/tm_gmtoff.m4 b/libmissing/m4/tm_gmtoff.m4
index 911af0a..43bda96 100644
--- a/libmissing/m4/tm_gmtoff.m4
+++ b/libmissing/m4/tm_gmtoff.m4
@@ -1,5 +1,5 @@
 # tm_gmtoff.m4 serial 3
-dnl Copyright (C) 2002, 2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 2009-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/unistd_h.m4 b/libmissing/m4/unistd_h.m4
index cb50d50..31d31c1 100644
--- a/libmissing/m4/unistd_h.m4
+++ b/libmissing/m4/unistd_h.m4
@@ -1,5 +1,5 @@
-# unistd_h.m4 serial 36
-dnl Copyright (C) 2006-2009 Free Software Foundation, Inc.
+# unistd_h.m4 serial 39
+dnl Copyright (C) 2006-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -11,6 +11,7 @@ AC_DEFUN([gl_UNISTD_H],
   dnl Use AC_REQUIRE here, so that the default behavior below is expanded
   dnl once only, before all statements that occur in other macros.
   AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+  AC_REQUIRE([AC_C_INLINE])
 
   gl_CHECK_NEXT_HEADERS([unistd.h])
 
@@ -21,6 +22,24 @@ AC_DEFUN([gl_UNISTD_H],
     HAVE_UNISTD_H=0
   fi
   AC_SUBST([HAVE_UNISTD_H])
+
+  dnl Check for declarations of anything we want to poison if the
+  dnl corresponding gnulib module is not in use.
+  gl_WARN_ON_USE_PREPARE([[#include <unistd.h>
+/* Some systems declare various items in the wrong headers.  */
+#ifndef __GLIBC__
+# include <fcntl.h>
+# include <stdio.h>
+# include <stdlib.h>
+# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#  include <io.h>
+# endif
+#endif
+    ]], [chown dup2 dup3 environ euidaccess faccessat fchdir fchownat
+    fsync ftruncate getcwd getdomainname getdtablesize getgroups
+    gethostname getlogin getlogin_r getpagesize getusershell setusershell
+    endusershell lchown link linkat lseek pipe2 pread readlink readlinkat
+    rmdir sleep symlink symlinkat unlink unlinkat usleep])
 ])
 
 AC_DEFUN([gl_UNISTD_MODULE_INDICATOR],
@@ -48,6 +67,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
   GNULIB_GETDTABLESIZE=0;    AC_SUBST([GNULIB_GETDTABLESIZE])
   GNULIB_GETGROUPS=0;        AC_SUBST([GNULIB_GETGROUPS])
   GNULIB_GETHOSTNAME=0;      AC_SUBST([GNULIB_GETHOSTNAME])
+  GNULIB_GETLOGIN=0;         AC_SUBST([GNULIB_GETLOGIN])
   GNULIB_GETLOGIN_R=0;       AC_SUBST([GNULIB_GETLOGIN_R])
   GNULIB_GETPAGESIZE=0;      AC_SUBST([GNULIB_GETPAGESIZE])
   GNULIB_GETUSERSHELL=0;     AC_SUBST([GNULIB_GETUSERSHELL])
@@ -82,6 +102,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
   HAVE_GETDTABLESIZE=1;   AC_SUBST([HAVE_GETDTABLESIZE])
   HAVE_GETGROUPS=1;       AC_SUBST([HAVE_GETGROUPS])
   HAVE_GETHOSTNAME=1;     AC_SUBST([HAVE_GETHOSTNAME])
+  HAVE_GETLOGIN=1;        AC_SUBST([HAVE_GETLOGIN])
   HAVE_GETPAGESIZE=1;     AC_SUBST([HAVE_GETPAGESIZE])
   HAVE_GETUSERSHELL=1;    AC_SUBST([HAVE_GETUSERSHELL])
   HAVE_LCHOWN=1;          AC_SUBST([HAVE_LCHOWN])
diff --git a/libmissing/m4/vasnprintf.m4 b/libmissing/m4/vasnprintf.m4
index 3a1d1e0..50a20cc 100644
--- a/libmissing/m4/vasnprintf.m4
+++ b/libmissing/m4/vasnprintf.m4
@@ -1,5 +1,5 @@
 # vasnprintf.m4 serial 29
-dnl Copyright (C) 2002-2004, 2006-2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2004, 2006-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/warn-on-use.m4 b/libmissing/m4/warn-on-use.m4
new file mode 100644
index 0000000..ab46422
--- /dev/null
+++ b/libmissing/m4/warn-on-use.m4
@@ -0,0 +1,45 @@
+# warn-on-use.m4 serial 1
+dnl Copyright (C) 2010 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# gl_WARN_ON_USE_PREPARE(INCLUDES, NAMES)
+# ---------------------------------------
+# For each whitespace-separated element in the list of NAMES, define
+# HAVE_RAW_DECL_name if the function has a declaration among INCLUDES
+# even after being undefined as a macro.
+#
+# See warn-on-use.h for some hints on how to poison function names, as
+# well as ideas on poisoning global variables and macros.  NAMES may
+# include global variables, but remember that only functions work with
+# _GL_WARN_ON_USE.  Typically, INCLUDES only needs to list a single
+# header, but if the replacement header pulls in other headers because
+# some systems declare functions in the wrong header, then INCLUDES
+# should do likewise.
+#
+# If you assume C89, then it is generally safe to assume declarations
+# for functions declared in that standard (such as gets) without
+# needing gl_WARN_ON_USE_PREPARE.
+AC_DEFUN([gl_WARN_ON_USE_PREPARE],
+[
+  m4_foreach_w([gl_decl], [$2],
+    [AH_TEMPLATE([HAVE_RAW_DECL_]AS_TR_CPP(m4_defn([gl_decl])),
+      [Define to 1 if ]m4_defn([gl_decl])[ is declared even after
+       undefining macros.])])dnl
+  for gl_func in m4_flatten([$2]); do
+    AS_VAR_PUSHDEF([gl_Symbol], [gl_cv_have_raw_decl_$gl_func])dnl
+    AC_CACHE_CHECK([whether $gl_func is declared without a macro],
+      [gl_Symbol],
+      [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$1],
+[@%:@undef $gl_func
+  (void) $gl_func;])],
+        [AS_VAR_SET([gl_Symbol], [yes])], [AS_VAR_SET([gl_Symbol], [no])])])
+     AS_VAR_IF([gl_Symbol], [yes],
+       [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_RAW_DECL_$gl_func]), [1])
+       dnl shortcut - if the raw declaration exists, then set a cache
+       dnl variable to allow skipping any later AC_CHECK_DECL efforts
+       eval ac_cv_have_decl_$gl_func=yes])
+    AS_VAR_POPDEF([gl_Symbol])dnl
+  done
+])
diff --git a/libmissing/m4/wchar.m4 b/libmissing/m4/wchar.m4
index ad19376..e81485d 100644
--- a/libmissing/m4/wchar.m4
+++ b/libmissing/m4/wchar.m4
@@ -1,54 +1,51 @@
 dnl A placeholder for ISO C99 <wchar.h>, for platforms that have issues.
 
-dnl Copyright (C) 2007-2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
 dnl Written by Eric Blake.
 
-# wchar.m4 serial 27
+# wchar.m4 serial 31
 
 AC_DEFUN([gl_WCHAR_H],
 [
   AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
   AC_REQUIRE([gl_WCHAR_H_INLINE_OK])
-  AC_CACHE_CHECK([whether <wchar.h> is standalone],
-    [gl_cv_header_wchar_h_standalone],
-    [AC_COMPILE_IFELSE([[#include <wchar.h>
-wchar_t w;]],
-      [gl_cv_header_wchar_h_standalone=yes],
-      [gl_cv_header_wchar_h_standalone=no])])
-
-  AC_REQUIRE([gt_TYPE_WINT_T])
-  if test $gt_cv_c_wint_t = yes; then
-    HAVE_WINT_T=1
-  else
-    HAVE_WINT_T=0
-  fi
-  AC_SUBST([HAVE_WINT_T])
-
-  dnl If <stddef.h> is replaced, then <wchar.h> must also be replaced.
-  AC_REQUIRE([gl_STDDEF_H])
-
-  if test $gl_cv_header_wchar_h_standalone != yes || test $gt_cv_c_wint_t != yes || test -n "$STDDEF_H"; then
-    WCHAR_H=wchar.h
-  fi
-
   dnl Prepare for creating substitute <wchar.h>.
-  dnl Do it always: WCHAR_H may be empty here but can be set later.
   dnl Check for <wchar.h> (missing in Linux uClibc when built without wide
   dnl character support).
+  dnl <wchar.h> is always overridden, because of GNULIB_POSIXCHECK.
   AC_CHECK_HEADERS_ONCE([wchar.h])
+  gl_CHECK_NEXT_HEADERS([wchar.h])
   if test $ac_cv_header_wchar_h = yes; then
     HAVE_WCHAR_H=1
   else
     HAVE_WCHAR_H=0
   fi
   AC_SUBST([HAVE_WCHAR_H])
-  dnl Execute this unconditionally, because WCHAR_H may be set by other
-  dnl modules, after this code is executed.
-  gl_CHECK_NEXT_HEADERS([wchar.h])
+
+  AC_REQUIRE([gt_TYPE_WINT_T])
+  if test $gt_cv_c_wint_t = yes; then
+    HAVE_WINT_T=1
+  else
+    HAVE_WINT_T=0
+  fi
+  AC_SUBST([HAVE_WINT_T])
+
+  dnl Check for declarations of anything we want to poison if the
+  dnl corresponding gnulib module is not in use.
+  gl_WARN_ON_USE_PREPARE([[
+/* Some systems require additional headers.  */
+#ifndef __GLIBC__
+# include <stddef.h>
+# include <stdio.h>
+# include <time.h>
+#endif
+#include <wchar.h>
+    ]], [btowc wctob mbsinit mbrtowc mbrlen mbsrtowcs mbsnrtowcs wcrtomb
+    wcsrtombs wcsnrtombs wcwidth])
 ])
 
 dnl Check whether <wchar.h> is usable at all.
@@ -102,8 +99,8 @@ Configuration aborted.])
 dnl Unconditionally enables the replacement of <wchar.h>.
 AC_DEFUN([gl_REPLACE_WCHAR_H],
 [
-  AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
-  WCHAR_H=wchar.h
+  dnl This is a no-op, because <wchar.h> is always overridden.
+  :
 ])
 
 AC_DEFUN([gl_WCHAR_MODULE_INDICATOR],
@@ -150,5 +147,4 @@ AC_DEFUN([gl_WCHAR_H_DEFAULTS],
   REPLACE_WCSRTOMBS=0;  AC_SUBST([REPLACE_WCSRTOMBS])
   REPLACE_WCSNRTOMBS=0; AC_SUBST([REPLACE_WCSNRTOMBS])
   REPLACE_WCWIDTH=0;    AC_SUBST([REPLACE_WCWIDTH])
-  WCHAR_H='';           AC_SUBST([WCHAR_H])
 ])
diff --git a/libmissing/m4/wchar_t.m4 b/libmissing/m4/wchar_t.m4
index fb27a7f..ed804e6 100644
--- a/libmissing/m4/wchar_t.m4
+++ b/libmissing/m4/wchar_t.m4
@@ -1,5 +1,5 @@
 # wchar_t.m4 serial 3 (gettext-0.18)
-dnl Copyright (C) 2002-2003, 2008, 2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2003, 2008-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/wctob.m4 b/libmissing/m4/wctob.m4
index 39270c9..3362ec6 100644
--- a/libmissing/m4/wctob.m4
+++ b/libmissing/m4/wctob.m4
@@ -1,5 +1,5 @@
 # wctob.m4 serial 4
-dnl Copyright (C) 2008-2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/wctype.m4 b/libmissing/m4/wctype.m4
index b611ebb..7fa36a1 100644
--- a/libmissing/m4/wctype.m4
+++ b/libmissing/m4/wctype.m4
@@ -2,7 +2,7 @@
 
 dnl A placeholder for ISO C99 <wctype.h>, for platforms that lack it.
 
-dnl Copyright (C) 2006-2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/wint_t.m4 b/libmissing/m4/wint_t.m4
index 47a4363..a6c7d15 100644
--- a/libmissing/m4/wint_t.m4
+++ b/libmissing/m4/wint_t.m4
@@ -1,5 +1,5 @@
 # wint_t.m4 serial 4 (gettext-0.18)
-dnl Copyright (C) 2003, 2007-2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2007-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/m4/xsize.m4 b/libmissing/m4/xsize.m4
index af293de..b653693 100644
--- a/libmissing/m4/xsize.m4
+++ b/libmissing/m4/xsize.m4
@@ -1,5 +1,5 @@
 # xsize.m4 serial 4
-dnl Copyright (C) 2003-2004, 2008-2009 Free Software Foundation, Inc.
+dnl Copyright (C) 2003-2004, 2008-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/libmissing/malloc.c b/libmissing/malloc.c
index fcb8e72..614320c 100644
--- a/libmissing/malloc.c
+++ b/libmissing/malloc.c
@@ -1,6 +1,6 @@
 /* malloc() function that is glibc compatible.
 
-   Copyright (C) 1997-1998, 2006-2007, 2009 Free Software Foundation, Inc.
+   Copyright (C) 1997-1998, 2006-2007, 2009-2010 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
diff --git a/libmissing/mbrtowc.c b/libmissing/mbrtowc.c
index e8b26e2..31f229c 100644
--- a/libmissing/mbrtowc.c
+++ b/libmissing/mbrtowc.c
@@ -1,5 +1,5 @@
 /* Convert multibyte character to wide character.
-   Copyright (C) 1999-2002, 2005-2009 Free Software Foundation, Inc.
+   Copyright (C) 1999-2002, 2005-2010 Free Software Foundation, Inc.
    Written by Bruno Haible <[email protected]>, 2008.
 
    This program is free software: you can redistribute it and/or modify
diff --git a/libmissing/mbsinit.c b/libmissing/mbsinit.c
index f152eec..811e39b 100644
--- a/libmissing/mbsinit.c
+++ b/libmissing/mbsinit.c
@@ -1,5 +1,5 @@
 /* Test for initial conversion state.
-   Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
    Written by Bruno Haible <[email protected]>, 2008.
 
    This program is free software: you can redistribute it and/or modify
diff --git a/libmissing/mbsrtowcs-state.c b/libmissing/mbsrtowcs-state.c
index b4eee86..02a976b 100644
--- a/libmissing/mbsrtowcs-state.c
+++ b/libmissing/mbsrtowcs-state.c
@@ -1,5 +1,5 @@
 /* Convert string to wide string.
-   Copyright (C) 2008-2009 Free Software Foundation, Inc.
+   Copyright (C) 2008-2010 Free Software Foundation, Inc.
    Written by Bruno Haible <[email protected]>, 2008.
 
    This program is free software: you can redistribute it and/or modify
diff --git a/libmissing/mbsrtowcs.c b/libmissing/mbsrtowcs.c
index 49dbc5a..d206831 100644
--- a/libmissing/mbsrtowcs.c
+++ b/libmissing/mbsrtowcs.c
@@ -1,5 +1,5 @@
 /* Convert string to wide string.
-   Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
    Written by Bruno Haible <[email protected]>, 2008.
 
    This program is free software: you can redistribute it and/or modify
diff --git a/libmissing/memchr.c b/libmissing/memchr.c
index 92efa41..1e897cd 100644
--- a/libmissing/memchr.c
+++ b/libmissing/memchr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2009
+/* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2010
    Free Software Foundation, Inc.
 
    Based on strlen implementation by Torbjorn Granlund ([email protected]),
diff --git a/libmissing/mempcpy.c b/libmissing/mempcpy.c
index e78c0ff..d69d2df 100644
--- a/libmissing/mempcpy.c
+++ b/libmissing/mempcpy.c
@@ -1,5 +1,5 @@
 /* Copy memory area and return pointer after last written byte.
-   Copyright (C) 2003, 2007, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2007, 2009, 2010 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
diff --git a/libmissing/mktime.c b/libmissing/mktime.c
index f6f6bde..1b85552 100644
--- a/libmissing/mktime.c
+++ b/libmissing/mktime.c
@@ -1,5 +1,5 @@
 /* Convert a `struct tm' to a time_t value.
-   Copyright (C) 1993-1999, 2002-2007, 2009 Free Software Foundation, Inc.
+   Copyright (C) 1993-1999, 2002-2007, 2009-2010 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Paul Eggert <[email protected]>.
 
diff --git a/libmissing/netdb.in.h b/libmissing/netdb.in.h
index 2762cb3..981a432 100644
--- a/libmissing/netdb.in.h
+++ b/libmissing/netdb.in.h
@@ -1,5 +1,5 @@
 /* Provide a netdb.h header file for systems lacking it (read: MinGW).
-   Copyright (C) 2008-2009 Free Software Foundation, Inc.
+   Copyright (C) 2008-2010 Free Software Foundation, Inc.
    Written by Simon Josefsson.
 
    This program is free software; you can redistribute it and/or modify
diff --git a/libmissing/netinet_in.in.h b/libmissing/netinet_in.in.h
index 6b134d4..8a86bca 100644
--- a/libmissing/netinet_in.in.h
+++ b/libmissing/netinet_in.in.h
@@ -1,5 +1,5 @@
 /* Substitute for <netinet/in.h>.
-   Copyright (C) 2007-2009 Free Software Foundation, Inc.
+   Copyright (C) 2007-2010 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
diff --git a/libmissing/nl_langinfo.c b/libmissing/nl_langinfo.c
index 741bb0b..0c02346 100644
--- a/libmissing/nl_langinfo.c
+++ b/libmissing/nl_langinfo.c
@@ -1,6 +1,6 @@
 /* nl_langinfo() replacement: query locale dependent information.
 
-   Copyright (C) 2007-2009 Free Software Foundation, Inc.
+   Copyright (C) 2007-2010 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
diff --git a/libmissing/pathmax.h b/libmissing/pathmax.h
index 61ccf07..c53aa9d 100644
--- a/libmissing/pathmax.h
+++ b/libmissing/pathmax.h
@@ -1,6 +1,6 @@
 /* Define PATH_MAX somehow.  Requires sys/types.h.
-   Copyright (C) 1992, 1999, 2001, 2003, 2005, 2009 Free Software Foundation,
-   Inc.
+   Copyright (C) 1992, 1999, 2001, 2003, 2005, 2009-2010 Free Software
+   Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
diff --git a/libmissing/printf-args.c b/libmissing/printf-args.c
index 921931c..597bba9 100644
--- a/libmissing/printf-args.c
+++ b/libmissing/printf-args.c
@@ -1,5 +1,5 @@
 /* Decomposed printf argument list.
-   Copyright (C) 1999, 2002-2003, 2005-2007, 2009 Free Software
+   Copyright (C) 1999, 2002-2003, 2005-2007, 2009-2010 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
diff --git a/libmissing/printf-args.h b/libmissing/printf-args.h
index 38dfb43..d76352d 100644
--- a/libmissing/printf-args.h
+++ b/libmissing/printf-args.h
@@ -1,6 +1,6 @@
 /* Decomposed printf argument list.
-   Copyright (C) 1999, 2002-2003, 2006-2007, 2009 Free Software Foundation,
-   Inc.
+   Copyright (C) 1999, 2002-2003, 2006-2007, 2009-2010 Free Software
+   Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
diff --git a/libmissing/printf-parse.c b/libmissing/printf-parse.c
index 22872ca..d88ddf3 100644
--- a/libmissing/printf-parse.c
+++ b/libmissing/printf-parse.c
@@ -1,5 +1,5 @@
 /* Formatted output to strings.
-   Copyright (C) 1999-2000, 2002-2003, 2006-2009 Free Software Foundation, Inc.
+   Copyright (C) 1999-2000, 2002-2003, 2006-2010 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
diff --git a/libmissing/printf-parse.h b/libmissing/printf-parse.h
index 19d4e3d..2cf965b 100644
--- a/libmissing/printf-parse.h
+++ b/libmissing/printf-parse.h
@@ -1,6 +1,6 @@
 /* Parse printf format string.
-   Copyright (C) 1999, 2002-2003, 2005, 2007, 2009 Free Software Foundation,
-   Inc.
+   Copyright (C) 1999, 2002-2003, 2005, 2007, 2009-2010 Free Software
+   Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
diff --git a/libmissing/recvfrom.c b/libmissing/recvfrom.c
index 9f55d75..6668ca2 100644
--- a/libmissing/recvfrom.c
+++ b/libmissing/recvfrom.c
@@ -1,6 +1,6 @@
 /* recvfrom.c --- wrappers for Windows recvfrom function
 
-   Copyright (C) 2008-2009 Free Software Foundation, Inc.
+   Copyright (C) 2008-2010 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
diff --git a/libmissing/ref-add.sin b/libmissing/ref-add.sin
index 71ab221..cb482d7 100644
--- a/libmissing/ref-add.sin
+++ b/libmissing/ref-add.sin
@@ -1,6 +1,6 @@
 # Add this package to a list of references stored in a text file.
 #
-#   Copyright (C) 2000, 2009 Free Software Foundation, Inc.
+#   Copyright (C) 2000, 2009, 2010 Free Software Foundation, Inc.
 #
 #   This program is free software; you can redistribute it and/or modify
 #   it under the terms of the GNU Lesser General Public License as published by
diff --git a/libmissing/ref-del.sin b/libmissing/ref-del.sin
index 6c0b1de..74f8e1c 100644
--- a/libmissing/ref-del.sin
+++ b/libmissing/ref-del.sin
@@ -1,6 +1,6 @@
 # Remove this package from a list of references stored in a text file.
 #
-#   Copyright (C) 2000, 2009 Free Software Foundation, Inc.
+#   Copyright (C) 2000, 2009, 2010 Free Software Foundation, Inc.
 #
 #   This program is free software; you can redistribute it and/or modify
 #   it under the terms of the GNU Lesser General Public License as published by
diff --git a/libmissing/sig-handler.h b/libmissing/sig-handler.h
index 41077f3..228ff38 100644
--- a/libmissing/sig-handler.h
+++ b/libmissing/sig-handler.h
@@ -1,6 +1,6 @@
 /* Convenience declarations when working with <signal.h>.
 
-   Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
diff --git a/libmissing/sigaction.c b/libmissing/sigaction.c
index 4e77f32..b4b2e59 100644
--- a/libmissing/sigaction.c
+++ b/libmissing/sigaction.c
@@ -1,5 +1,5 @@
 /* POSIX compatible signal blocking.
-   Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
    Written by Eric Blake <[email protected]>, 2008.
 
    This program is free software: you can redistribute it and/or modify
diff --git a/libmissing/signal.in.h b/libmissing/signal.in.h
index 1dc5e3e..3cc6d77 100644
--- a/libmissing/signal.in.h
+++ b/libmissing/signal.in.h
@@ -1,6 +1,6 @@
 /* A GNU-like <signal.h>.
 
-   Copyright (C) 2006-2009 Free Software Foundation, Inc.
+   Copyright (C) 2006-2010 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
@@ -35,10 +35,10 @@
 #ifndef _GL_SIGNAL_H
 #define _GL_SIGNAL_H
 
-/* The definition of GL_LINK_WARNING is copied here.  */
-
 /* The definition of _GL_ARG_NONNULL is copied here.  */
 
+/* The definition of _GL_WARN_ON_USE is copied here.  */
+
 /* Define pid_t, uid_t.
    Also, mingw defines sigset_t not in <signal.h>, but in <sys/types.h>.  */
 #include <sys/types.h>
@@ -52,6 +52,11 @@ typedef int rpl_sig_atomic_t;
 # define sig_atomic_t rpl_sig_atomic_t
 #endif
 
+/* A set or mask of signals.  */
+#if !@HAVE_SIGSET_T@
+typedef unsigned int sigset_t;
+#endif
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -68,21 +73,17 @@ extern "C" {
 #endif
 
 
-#if !@HAVE_POSIX_SIGNALBLOCKING@
+#if @GNULIB_SIGPROCMASK@
+# if !@HAVE_POSIX_SIGNALBLOCKING@
 
 /* Maximum signal number + 1.  */
-# ifndef NSIG
-#  define NSIG 32
-# endif
+#  ifndef NSIG
+#   define NSIG 32
+#  endif
 
 /* This code supports only 32 signals.  */
 typedef int verify_NSIG_constraint[2 * (NSIG <= 32) - 1];
 
-/* A set or mask of signals.  */
-# if !@HAVE_SIGSET_T@
-typedef unsigned int sigset_t;
-# endif
-
 /* Test whether a given signal is contained in a signal set.  */
 extern int sigismember (const sigset_t *set, int sig) _GL_ARG_NONNULL ((1));
 
@@ -106,31 +107,69 @@ extern int sigpending (sigset_t *set) _GL_ARG_NONNULL ((1));
    combining it with *SET as indicated in OPERATION.
    In this implementation, you are not allowed to change a signal handler
    while the signal is blocked.  */
-# define SIG_BLOCK   0  /* blocked_set = blocked_set | *set; */
-# define SIG_SETMASK 1  /* blocked_set = *set; */
-# define SIG_UNBLOCK 2  /* blocked_set = blocked_set & ~*set; */
+#  define SIG_BLOCK   0  /* blocked_set = blocked_set | *set; */
+#  define SIG_SETMASK 1  /* blocked_set = *set; */
+#  define SIG_UNBLOCK 2  /* blocked_set = blocked_set & ~*set; */
 extern int sigprocmask (int operation, const sigset_t *set, sigset_t *old_set);
 
-# define signal rpl_signal
+#  define signal rpl_signal
 /* Install the handler FUNC for signal SIG, and return the previous
    handler.  */
 extern void (*signal (int sig, void (*func) (int))) (int);
 
-# if GNULIB_defined_SIGPIPE
+#  if GNULIB_defined_SIGPIPE
 
 /* Raise signal SIG.  */
-#  undef raise
-#  define raise rpl_raise
+#   undef raise
+#   define raise rpl_raise
 extern int raise (int sig);
 
-# endif
+#  endif
 
-#endif /* !@HAVE_POSIX_SIGNALBLOCKING@ */
+# endif /* !@HAVE_POSIX_SIGNALBLOCKING@ */
+#elif defined GNULIB_POSIXCHECK
+# undef sigaddset
+# if HAVE_RAW_DECL_SIGADDSET
+_GL_WARN_ON_USE (sigaddset, "sigaddset is unportable - "
+                 "use the gnulib module sigprocmask for portability");
+# endif
+# undef sigdelset
+# if HAVE_RAW_DECL_SIGDELSET
+_GL_WARN_ON_USE (sigdelset, "sigdelset is unportable - "
+                 "use the gnulib module sigprocmask for portability");
+# endif
+# undef sigemptyset
+# if HAVE_RAW_DECL_SIGEMPTYSET
+_GL_WARN_ON_USE (sigemptyset, "sigemptyset is unportable - "
+                 "use the gnulib module sigprocmask for portability");
+# endif
+# undef sigfillset
+# if HAVE_RAW_DECL_SIGFILLSET
+_GL_WARN_ON_USE (sigfillset, "sigfillset is unportable - "
+                 "use the gnulib module sigprocmask for portability");
+# endif
+# undef sigismember
+# if HAVE_RAW_DECL_SIGISMEMBER
+_GL_WARN_ON_USE (sigismember, "sigismember is unportable - "
+                 "use the gnulib module sigprocmask for portability");
+# endif
+# undef sigpending
+# if HAVE_RAW_DECL_SIGPENDING
+_GL_WARN_ON_USE (sigpending, "sigpending is unportable - "
+                 "use the gnulib module sigprocmask for portability");
+# endif
+# undef sigprocmask
+# if HAVE_RAW_DECL_SIGPROCMASK
+_GL_WARN_ON_USE (sigprocmask, "sigprocmask is unportable - "
+                 "use the gnulib module sigprocmask for portability");
+# endif
+#endif /* @GNULIB_SIGPROCMASK@ */
 
 
-#if !@HAVE_SIGACTION@
+#if @GNULIB_SIGACTION@
+# if !@HAVE_SIGACTION@
 
-# if !@HAVE_SIGINFO_T@
+#  if !@HAVE_SIGINFO_T@
 /* Present to allow compilation, but unsupported by gnulib.  */
 union sigval
 {
@@ -152,7 +191,7 @@ struct siginfo_t
   union sigval si_value;
 };
 typedef struct siginfo_t siginfo_t;
-# endif /* !@HAVE_SIGINFO_T@ */
+#  endif /* !@HAVE_SIGINFO_T@ */
 
 /* We assume that platforms which lack the sigaction() function also lack
    the 'struct sigaction' type, and vice versa.  */
@@ -172,22 +211,28 @@ struct sigaction
   /* Not all POSIX flags are supported.  */
   int sa_flags;
 };
-# define sa_handler _sa_func._sa_handler
-# define sa_sigaction _sa_func._sa_sigaction
+#  define sa_handler _sa_func._sa_handler
+#  define sa_sigaction _sa_func._sa_sigaction
 /* Unsupported flags are not present.  */
-# define SA_RESETHAND 1
-# define SA_NODEFER 2
-# define SA_RESTART 4
+#  define SA_RESETHAND 1
+#  define SA_NODEFER 2
+#  define SA_RESTART 4
 
 extern int sigaction (int, const struct sigaction *restrict,
                       struct sigaction *restrict);
 
-#elif !@HAVE_STRUCT_SIGACTION_SA_SIGACTION@
-
-# define sa_sigaction sa_handler
+# elif !@HAVE_STRUCT_SIGACTION_SA_SIGACTION@
 
-#endif /* !@HAVE_SIGACTION@, !@HAVE_STRUCT_SIGACTION_SA_SIGACTION@ */
+#  define sa_sigaction sa_handler
 
+# endif /* !@HAVE_SIGACTION@, !@HAVE_STRUCT_SIGACTION_SA_SIGACTION@ */
+#elif defined GNULIB_POSIXCHECK
+# undef sigaction
+# if HAVE_RAW_DECL_SIGACTION
+_GL_WARN_ON_USE (sigaction, "sigaction is unportable - "
+                 "use the gnulib module sigaction for portability");
+# endif
+#endif
 
 /* Some systems don't have SA_NODEFER.  */
 #ifndef SA_NODEFER
diff --git a/libmissing/sigprocmask.c b/libmissing/sigprocmask.c
index 45e594e..c72294f 100644
--- a/libmissing/sigprocmask.c
+++ b/libmissing/sigprocmask.c
@@ -1,5 +1,5 @@
 /* POSIX compatible signal blocking.
-   Copyright (C) 2006-2009 Free Software Foundation, Inc.
+   Copyright (C) 2006-2010 Free Software Foundation, Inc.
    Written by Bruno Haible <[email protected]>, 2006.
 
    This program is free software: you can redistribute it and/or modify
diff --git a/libmissing/size_max.h b/libmissing/size_max.h
index a2c27d3..381eea1 100644
--- a/libmissing/size_max.h
+++ b/libmissing/size_max.h
@@ -1,5 +1,5 @@
 /* size_max.h -- declare SIZE_MAX through system headers
-   Copyright (C) 2005-2006, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2005-2006, 2009-2010 Free Software Foundation, Inc.
    Written by Simon Josefsson.
 
    This program is free software; you can redistribute it and/or modify
diff --git a/libmissing/sleep.c b/libmissing/sleep.c
index bbeadb4..3772be0 100644
--- a/libmissing/sleep.c
+++ b/libmissing/sleep.c
@@ -1,5 +1,5 @@
 /* Pausing execution of the current thread.
-   Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
    Written by Bruno Haible <[email protected]>, 2007.
 
    This program is free software: you can redistribute it and/or modify
diff --git a/libmissing/snprintf.c b/libmissing/snprintf.c
index f07d66e..4243679 100644
--- a/libmissing/snprintf.c
+++ b/libmissing/snprintf.c
@@ -1,5 +1,5 @@
 /* Formatted output to strings.
-   Copyright (C) 2004, 2006-2009 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2006-2010 Free Software Foundation, Inc.
    Written by Simon Josefsson and Paul Eggert.
 
    This program is free software; you can redistribute it and/or modify
diff --git a/libmissing/socket.c b/libmissing/socket.c
index e8107bd..dc857fa 100644
--- a/libmissing/socket.c
+++ b/libmissing/socket.c
@@ -1,6 +1,6 @@
 /* socket.c --- wrappers for Windows socket function
 
-   Copyright (C) 2008-2009 Free Software Foundation, Inc.
+   Copyright (C) 2008-2010 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
diff --git a/libmissing/sockets.c b/libmissing/sockets.c
index 30605f2..a853c8c 100644
--- a/libmissing/sockets.c
+++ b/libmissing/sockets.c
@@ -1,6 +1,6 @@
 /* sockets.c --- wrappers for Windows socket functions
 
-   Copyright (C) 2008-2009 Free Software Foundation, Inc.
+   Copyright (C) 2008-2010 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
diff --git a/libmissing/sockets.h b/libmissing/sockets.h
index ed2de22..0ecedce 100644
--- a/libmissing/sockets.h
+++ b/libmissing/sockets.h
@@ -1,6 +1,6 @@
 /* sockets.h - wrappers for Windows socket functions
 
-   Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
diff --git a/libmissing/stdbool.in.h b/libmissing/stdbool.in.h
index f4059af..7b681f6 100644
--- a/libmissing/stdbool.in.h
+++ b/libmissing/stdbool.in.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2003, 2006-2009 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2003, 2006-2010 Free Software Foundation, Inc.
    Written by Bruno Haible <[email protected]>, 2001.
 
    This program is free software; you can redistribute it and/or modify
diff --git a/libmissing/stddef.in.h b/libmissing/stddef.in.h
index dacc83d..b1dfb67 100644
--- a/libmissing/stddef.in.h
+++ b/libmissing/stddef.in.h
@@ -1,6 +1,6 @@
 /* A substitute for POSIX 2008 <stddef.h>, for platforms that have issues.
 
-   Copyright (C) 2009 Free Software Foundation, Inc.
+   Copyright (C) 2009, 2010 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
diff --git a/libmissing/stdint.in.h b/libmissing/stdint.in.h
index 36e6469..a1162d4 100644
--- a/libmissing/stdint.in.h
+++ b/libmissing/stdint.in.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2002, 2004-2009 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2002, 2004-2010 Free Software Foundation, Inc.
    Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood.
    This file is part of gnulib.
 
diff --git a/libmissing/stdio-write.c b/libmissing/stdio-write.c
index 7b26c78..61bba92 100644
--- a/libmissing/stdio-write.c
+++ b/libmissing/stdio-write.c
@@ -1,5 +1,5 @@
 /* POSIX compatible FILE stream write function.
-   Copyright (C) 2008-2009 Free Software Foundation, Inc.
+   Copyright (C) 2008-2010 Free Software Foundation, Inc.
    Written by Bruno Haible <[email protected]>, 2008.
 
    This program is free software: you can redistribute it and/or modify
diff --git a/libmissing/stdio.in.h b/libmissing/stdio.in.h
index 29629fd..5454245 100644
--- a/libmissing/stdio.in.h
+++ b/libmissing/stdio.in.h
@@ -1,6 +1,6 @@
 /* A GNU-like <stdio.h>.
 
-   Copyright (C) 2004, 2007-2009 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2007-2010 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
@@ -36,36 +36,31 @@
 #ifndef _GL_STDIO_H
 #define _GL_STDIO_H
 
+/* Get va_list.  Needed on many systems, including glibc 2.8.  */
 #include <stdarg.h>
+
 #include <stddef.h>
 
-#if ((@GNULIB_FSEEKO@ && @REPLACE_FSEEKO@) \
-     || (@GNULIB_FTELLO@ && @REPLACE_FTELLO@) \
-     || (@GNULIB_GETDELIM@ && !@HAVE_DECL_GETDELIM@) \
-     || (@GNULIB_GETLINE@ && (!@HAVE_DECL_GETLINE@ || @REPLACE_GETLINE@)) \
-     || defined GNULIB_POSIXCHECK)
-/* Get off_t and ssize_t.  */
-# include <sys/types.h>
-#endif
+/* Get off_t and ssize_t.  Needed on many systems, including glibc 2.8.  */
+#include <sys/types.h>
 
 #ifndef __attribute__
-/* This feature is available in gcc versions 2.5 and later.  */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
-#  define __attribute__(Spec) /* empty */
-# endif
-/* The __-protected variants of `format' and `printf' attributes
-   are accepted by gcc versions 2.6.4 (effectively 2.7) and later.  */
+/* The __attribute__ feature is available in gcc versions 2.5 and later.
+   The __-protected variants of the attributes 'format' and 'printf' are
+   accepted by gcc versions 2.6.4 (effectively 2.7) and later.
+   We enable __attribute__ only if these are supported too, because
+   gnulib and libintl do '#define printf __printf__' when they override
+   the 'printf' function.  */
 # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
-#  define __format__ format
-#  define __printf__ printf
+#  define __attribute__(Spec)   /* empty */
 # endif
 #endif
 
 
-/* The definition of GL_LINK_WARNING is copied here.  */
-
 /* The definition of _GL_ARG_NONNULL is copied here.  */
 
+/* The definition of _GL_WARN_ON_USE is copied here.  */
+
 
 #ifdef __cplusplus
 extern "C" {
@@ -81,10 +76,10 @@ extern int dprintf (int fd, const char *format, ...)
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef dprintf
-# define dprintf \
-    (GL_LINK_WARNING ("dprintf is unportable - " \
-                      "use gnulib module dprintf for portability"), \
-     dprintf)
+# if HAVE_RAW_DECL_DPRINTF
+_GL_WARN_ON_USE (dprintf, "dprintf is unportable - "
+                 "use gnulib module dprintf for portability");
+# endif
 #endif
 
 #if @GNULIB_FCLOSE@
@@ -95,11 +90,9 @@ extern int fclose (FILE *stream) _GL_ARG_NONNULL ((1));
 # 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))
+/* Assume fclose is always declared.  */
+_GL_WARN_ON_USE (fclose, "fclose is not always POSIX compliant - "
+                 "use gnulib module fclose for portable POSIX compliance");
 #endif
 
 #if @GNULIB_FFLUSH@
@@ -115,13 +108,17 @@ extern int fclose (FILE *stream) _GL_ARG_NONNULL ((1));
 # 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))
+/* Assume fflush is always declared.  */
+_GL_WARN_ON_USE (fflush, "fflush is not always POSIX compliant - "
+                 "use gnulib module fflush for portable POSIX compliance");
 #endif
 
+/* It is very rare that the developer ever has full control of stdin,
+   so any use of gets warrants an unconditional warning.  Assume it is
+   always declared, since it is required by C89.  */
+#undef gets
+_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+
 #if @GNULIB_FOPEN@
 # if @REPLACE_FOPEN@
 #  undef fopen
@@ -131,10 +128,9 @@ extern FILE * fopen (const char *filename, const char *mode)
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef fopen
-# define fopen(f,m) \
-   (GL_LINK_WARNING ("fopen on Win32 platforms is not POSIX compatible - " \
-                     "use gnulib module fopen for portability"), \
-    fopen (f, m))
+/* Assume fopen is always declared.  */
+_GL_WARN_ON_USE (fopen, "fopen on Win32 platforms is not POSIX compatible - "
+                 "use gnulib module fopen for portability");
 #endif
 
 #if @GNULIB_FPRINTF_POSIX@
@@ -151,11 +147,10 @@ extern int fprintf (FILE *fp, const char *format, ...)
        _GL_ARG_NONNULL ((1, 2));
 #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)
+/* Assume fprintf is always declared.  */
+_GL_WARN_ON_USE (fprintf, "fprintf is not always POSIX compliant - "
+                 "use gnulib module fprintf-posix for portable "
+                 "POSIX compliance");
 #endif
 
 #if @GNULIB_FPURGE@
@@ -173,10 +168,10 @@ extern int fprintf (FILE *fp, const char *format, ...)
 # 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))
+# if HAVE_RAW_DECL_FPURGE
+_GL_WARN_ON_USE (fpurge, "fpurge is not always present - "
+                 "use gnulib module fpurge for portability");
+# endif
 #endif
 
 #if @GNULIB_FPUTC@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
@@ -200,98 +195,141 @@ extern FILE * freopen (const char *filename, const char *mode, FILE *stream)
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef freopen
-# define freopen(f,m,s) \
-   (GL_LINK_WARNING ("freopen on Win32 platforms is not POSIX compatible - " \
-                     "use gnulib module freopen for portability"), \
-    freopen (f, m, s))
-#endif
-
-#if @GNULIB_FSEEK@ && @REPLACE_FSEEK@
-extern int rpl_fseek (FILE *fp, long offset, int whence) _GL_ARG_NONNULL ((1));
-# undef fseek
-# if defined GNULIB_POSIXCHECK
-#  define fseek(f,o,w) \
-     (GL_LINK_WARNING ("fseek cannot handle files larger than 4 GB " \
-                       "on 32-bit platforms - " \
-                       "use fseeko function for handling of large files"), \
-      rpl_fseek (f, o, w))
-# else
+/* Assume freopen is always declared.  */
+_GL_WARN_ON_USE (freopen, "freopen on Win32 platforms is not POSIX compatible - "
+                 "use gnulib module freopen for portability");
+#endif
+
+/* Set up the following warnings, based on which modules are in use.
+   GNU Coding Standards discourage the use of fseek, since it imposes
+   an arbitrary limitation on some 32-bit hosts.  Remember that the
+   fseek module depends on the fseeko module, so we only have three
+   cases to consider:
+
+   1. The developer is not using either module.  Issue a warning under
+   GNULIB_POSIXCHECK for both functions, to remind them that both
+   functions have bugs on some systems.  _GL_NO_LARGE_FILES has no
+   impact on this warning.
+
+   2. The developer is using both modules.  They may be unaware of the
+   arbitrary limitations of fseek, so issue a warning under
+   GNULIB_POSIXCHECK.  On the other hand, they may be using both
+   modules intentionally, so the developer can define
+   _GL_NO_LARGE_FILES in the compilation units where the use of fseek
+   is safe, to silence the warning.
+
+   3. The developer is using the fseeko module, but not fseek.  Gnulib
+   guarantees that fseek will still work around platform bugs in that
+   case, but we presume that the developer is aware of the pitfalls of
+   fseek and was trying to avoid it, so issue a warning even when
+   GNULIB_POSIXCHECK is undefined.  Again, _GL_NO_LARGE_FILES can be
+   defined to silence the warning in particular compilation units.
+
+   Most gnulib clients that perform stream operations should fall into
+   category three.  */
+
+#if @GNULIB_FSEEK@
+# if defined GNULIB_POSIXCHECK && !defined _GL_NO_LARGE_FILES
+#  define _GL_FSEEK_WARN /* Category 2, above.  */
+#  undef fseek
+# endif
+# if @REPLACE_FSEEK@
+#  undef fseek
 #  define fseek rpl_fseek
-# endif
-#elif defined GNULIB_POSIXCHECK
-# ifndef fseek
-#  define fseek(f,o,w) \
-     (GL_LINK_WARNING ("fseek cannot handle files larger than 4 GB " \
-                       "on 32-bit platforms - " \
-                       "use fseeko function for handling of large files"), \
-      fseek (f, o, w))
+extern int fseek (FILE *fp, long offset, int whence) _GL_ARG_NONNULL ((1));
 # endif
 #endif
 
 #if @GNULIB_FSEEKO@
+# if !@GNULIB_FSEEK@ && !defined _GL_NO_LARGE_FILES
+#  define _GL_FSEEK_WARN /* Category 3, above.  */
+#  undef fseek
+# endif
 # if @REPLACE_FSEEKO@
 /* Provide fseek, fseeko functions that are aware of a preceding
    fflush(), and which detect pipes.  */
+#  undef fseeko
 #  define fseeko rpl_fseeko
 extern int fseeko (FILE *fp, off_t offset, int whence) _GL_ARG_NONNULL ((1));
 #  if !@GNULIB_FSEEK@
 #   undef fseek
-#   define fseek(f,o,w) \
-     (GL_LINK_WARNING ("fseek cannot handle files larger than 4 GB " \
-                       "on 32-bit platforms - " \
-                       "use fseeko function for handling of large files"), \
-      fseeko (f, o, w))
+#   define fseek rpl_fseek
+static inline int _GL_ARG_NONNULL ((1))
+rpl_fseek (FILE *fp, long offset, int whence)
+{
+  return fseeko (fp, offset, whence);
+}
 #  endif
 # endif
 #elif defined GNULIB_POSIXCHECK
+# define _GL_FSEEK_WARN /* Category 1, above.  */
+# undef fseek
 # undef fseeko
-# define fseeko(f,o,w) \
-   (GL_LINK_WARNING ("fseeko is unportable - " \
-                     "use gnulib module fseeko for portability"), \
-    fseeko (f, o, w))
+# if HAVE_RAW_DECL_FSEEKO
+_GL_WARN_ON_USE (fseeko, "fseeko is unportable - "
+                 "use gnulib module fseeko for portability");
+# endif
 #endif
 
-#if @GNULIB_FTELL@ && @REPLACE_FTELL@
-extern long rpl_ftell (FILE *fp) _GL_ARG_NONNULL ((1));
-# undef ftell
-# if GNULIB_POSIXCHECK
-#  define ftell(f) \
-     (GL_LINK_WARNING ("ftell cannot handle files larger than 4 GB " \
-                       "on 32-bit platforms - " \
-                       "use ftello function for handling of large files"), \
-      rpl_ftell (f))
-# else
-#  define ftell rpl_ftell
+#ifdef _GL_FSEEK_WARN
+# undef _GL_FSEEK_WARN
+/* Here, either fseek is undefined (but C89 guarantees that it is
+   declared), or it is defined as rpl_fseek (declared above).  */
+_GL_WARN_ON_USE (fseek, "fseek cannot handle files larger than 4 GB "
+                 "on 32-bit platforms - "
+                 "use fseeko function for handling of large files");
+#endif
+
+/* See the comments on fseek/fseeko.  */
+
+#if @GNULIB_FTELL@
+# if defined GNULIB_POSIXCHECK && !defined _GL_NO_LARGE_FILES
+#  define _GL_FTELL_WARN /* Category 2, above.  */
+#  undef ftell
 # endif
-#elif defined GNULIB_POSIXCHECK
-# ifndef ftell
-#  define ftell(f) \
-     (GL_LINK_WARNING ("ftell cannot handle files larger than 4 GB " \
-                       "on 32-bit platforms - " \
-                       "use ftello function for handling of large files"), \
-      ftell (f))
+# if @REPLACE_FTELL@
+#  undef ftell
+#  define ftell rpl_ftell
+extern long ftell (FILE *fp) _GL_ARG_NONNULL ((1));
 # endif
 #endif
 
 #if @GNULIB_FTELLO@
+# if !@GNULIB_FTELL@ && !defined _GL_NO_LARGE_FILES
+#  define _GL_FTELL_WARN /* Category 3, above.  */
+#  undef ftell
+# endif
 # if @REPLACE_FTELLO@
+#  undef ftello
 #  define ftello rpl_ftello
 extern off_t ftello (FILE *fp) _GL_ARG_NONNULL ((1));
 #  if !@GNULIB_FTELL@
 #   undef ftell
-#   define ftell(f) \
-     (GL_LINK_WARNING ("ftell cannot handle files larger than 4 GB " \
-                       "on 32-bit platforms - " \
-                       "use ftello function for handling of large files"), \
-      ftello (f))
+#   define ftell rpl_ftell
+static inline long _GL_ARG_NONNULL ((1))
+rpl_ftell (FILE *f)
+{
+  return ftello (f);
+}
 #  endif
 # endif
 #elif defined GNULIB_POSIXCHECK
+# define _GL_FTELL_WARN /* Category 1, above.  */
+# undef ftell
 # undef ftello
-# define ftello(f) \
-   (GL_LINK_WARNING ("ftello is unportable - " \
-                     "use gnulib module ftello for portability"), \
-    ftello (f))
+# if HAVE_RAW_DECL_FTELLO
+_GL_WARN_ON_USE (ftello, "ftello is unportable - "
+                 "use gnulib module ftello for portability");
+# endif
+#endif
+
+#ifdef _GL_FTELL_WARN
+# undef _GL_FTELL_WARN
+/* Here, either ftell is undefined (but C89 guarantees that it is
+   declared), or it is defined as rpl_ftell (declared above).  */
+_GL_WARN_ON_USE (ftell, "ftell cannot handle files larger than 4 GB "
+                 "on 32-bit platforms - "
+                 "use ftello function for handling of large files");
 #endif
 
 #if @GNULIB_FWRITE@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
@@ -315,10 +353,10 @@ extern ssize_t getdelim (char **lineptr, size_t *linesize, int delimiter,
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef getdelim
-# define getdelim(l, s, d, f)                                       \
-  (GL_LINK_WARNING ("getdelim is unportable - "                     \
-                    "use gnulib module getdelim for portability"),  \
-   getdelim (l, s, d, f))
+# if HAVE_RAW_DECL_GETDELIM
+_GL_WARN_ON_USE (getdelim, "getdelim is unportable - "
+                 "use gnulib module getdelim for portability");
+# endif
 #endif
 
 #if @GNULIB_GETLINE@
@@ -338,10 +376,10 @@ extern ssize_t getline (char **lineptr, size_t *linesize, FILE *stream)
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef getline
-# define getline(l, s, f)                                               \
-  (GL_LINK_WARNING ("getline is unportable - "                          \
-                    "use gnulib module getline for portability"),       \
-   getline (l, s, f))
+# if HAVE_RAW_DECL_GETLINE
+_GL_WARN_ON_USE (getline, "getline is unportable - "
+                 "use gnulib module getline for portability");
+# endif
 #endif
 
 #if @GNULIB_OBSTACK_PRINTF@
@@ -374,10 +412,9 @@ extern void perror (const char *string);
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef perror
-# define perror(s) \
-    (GL_LINK_WARNING ("perror is not always POSIX compliant - " \
-                      "use gnulib module perror for portability"), \
-     perror (s))
+/* Assume perror is always declared.  */
+_GL_WARN_ON_USE (perror, "perror is not always POSIX compliant - "
+                 "use gnulib module perror for portability");
 #endif
 
 #if @GNULIB_POPEN@
@@ -389,10 +426,10 @@ 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))
+# if HAVE_RAW_DECL_POPEN
+_GL_WARN_ON_USE (popen, "popen is buggy on some platforms - "
+                 "use gnulib module popen or pipe for more portability");
+# endif
 #endif
 
 #if @GNULIB_PRINTF_POSIX@
@@ -409,18 +446,10 @@ extern int printf (const char *format, ...)
        __attribute__ ((__format__ (__printf__, 1, 2))) _GL_ARG_NONNULL ((1));
 #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__
+/* Assume printf is always declared.  */
+_GL_WARN_ON_USE (printf, "printf is not always POSIX compliant - "
+                 "use gnulib module printf-posix for portable "
+                 "POSIX compliance");
 #endif
 
 #if @GNULIB_PUTC@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
@@ -449,10 +478,9 @@ extern int remove (const char *name) _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef remove
-# define remove(n)                                         \
-   (GL_LINK_WARNING ("remove cannot handle directories on some platforms - " \
-                     "use gnulib module remove for more portability"), \
-    remove (n))
+/* Assume remove is always declared.  */
+_GL_WARN_ON_USE (remove, "remove cannot handle directories on some platforms - "
+                 "use gnulib module remove for more portability");
 #endif
 
 #if @GNULIB_RENAME@
@@ -464,10 +492,9 @@ extern int rename (const char *old_filename, const char *new_filename)
 # 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))
+/* Assume rename is always declared.  */
+_GL_WARN_ON_USE (rename, "rename is buggy on some platforms - "
+                 "use gnulib module rename for more portability");
 #endif
 
 #if @GNULIB_RENAMEAT@
@@ -481,10 +508,10 @@ extern int renameat (int fd1, char const *file1, int fd2, char const *file2)
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef renameat
-# define renameat(d1,f1,d2,f2)             \
-    (GL_LINK_WARNING ("renameat is not portable - " \
-                      "use gnulib module renameat for portability"), \
-     renameat (d1, f1, d2, f2))
+# if HAVE_RAW_DECL_RENAMEAT
+_GL_WARN_ON_USE (renameat, "renameat is not portable - "
+                 "use gnulib module renameat for portability");
+# endif
 #endif
 
 #if @GNULIB_SNPRINTF@
@@ -498,12 +525,21 @@ extern int snprintf (char *str, size_t size, const char *format, ...)
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef snprintf
-# define snprintf \
-    (GL_LINK_WARNING ("snprintf is unportable - " \
-                      "use gnulib module snprintf for portability"), \
-     snprintf)
+# if HAVE_RAW_DECL_SNPRINTF
+_GL_WARN_ON_USE (snprintf, "snprintf is unportable - "
+                 "use gnulib module snprintf for portability");
+# endif
 #endif
 
+/* Some people would argue that sprintf should be handled like gets
+   (for example, OpenBSD issues a link warning for both functions),
+   since both can cause security holes due to buffer overruns.
+   However, we believe that sprintf can be used safely, and is more
+   efficient than snprintf in those safe cases; and as proof of our
+   belief, we use sprintf in several gnulib modules.  So this header
+   intentionally avoids adding a warning to sprintf except when
+   GNULIB_POSIXCHECK is defined.  */
+
 #if @GNULIB_SPRINTF_POSIX@
 # if @REPLACE_SPRINTF@
 #  define sprintf rpl_sprintf
@@ -513,11 +549,10 @@ extern int sprintf (char *str, const char *format, ...)
 # 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)
+/* Assume sprintf is always declared.  */
+_GL_WARN_ON_USE (sprintf, "sprintf is not always POSIX compliant - "
+                 "use gnulib module sprintf-posix for portable "
+                 "POSIX compliance");
 #endif
 
 #if @GNULIB_VASPRINTF@
@@ -547,10 +582,10 @@ extern int vdprintf (int fd, const char *format, va_list args)
 # 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))
+# if HAVE_RAW_DECL_VDPRINTF
+_GL_WARN_ON_USE (vdprintf, "vdprintf is unportable - "
+                 "use gnulib module vdprintf for portability");
+# endif
 #endif
 
 #if @GNULIB_VFPRINTF_POSIX@
@@ -567,11 +602,10 @@ extern int vfprintf (FILE *fp, const char *format, va_list args)
        _GL_ARG_NONNULL ((1, 2));
 #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))
+/* Assume vfprintf is always declared.  */
+_GL_WARN_ON_USE (vfprintf, "vfprintf is not always POSIX compliant - "
+                 "use gnulib module vfprintf-posix for portable "
+                      "POSIX compliance");
 #endif
 
 #if @GNULIB_VPRINTF_POSIX@
@@ -586,11 +620,10 @@ extern int vprintf (const char *format, va_list args)
        __attribute__ ((__format__ (__printf__, 1, 0))) _GL_ARG_NONNULL ((1));
 #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))
+/* Assume vprintf is always declared.  */
+_GL_WARN_ON_USE (vprintf, "vprintf is not always POSIX compliant - "
+                 "use gnulib module vprintf-posix for portable "
+                 "POSIX compliance");
 #endif
 
 #if @GNULIB_VSNPRINTF@
@@ -604,10 +637,10 @@ extern int vsnprintf (char *str, size_t size, const char *format, va_list args)
 # 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))
+# if HAVE_RAW_DECL_VSNPRINTF
+_GL_WARN_ON_USE (vsnprintf, "vsnprintf is unportable - "
+                 "use gnulib module vsnprintf for portability");
+# endif
 #endif
 
 #if @GNULIB_VSPRINTF_POSIX@
@@ -619,11 +652,10 @@ extern int vsprintf (char *str, const char *format, va_list args)
 # 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))
+/* Assume vsprintf is always declared.  */
+_GL_WARN_ON_USE (vsprintf, "vsprintf is not always POSIX compliant - "
+                 "use gnulib module vsprintf-posix for portable "
+                      "POSIX compliance");
 #endif
 
 #ifdef __cplusplus
diff --git a/libmissing/stdlib.in.h b/libmissing/stdlib.in.h
index 058cf1d..54c4ee7 100644
--- a/libmissing/stdlib.in.h
+++ b/libmissing/stdlib.in.h
@@ -1,6 +1,6 @@
 /* A GNU-like <stdlib.h>.
 
-   Copyright (C) 1995, 2001-2004, 2006-2009 Free Software Foundation, Inc.
+   Copyright (C) 1995, 2001-2004, 2006-2010 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
@@ -74,10 +74,10 @@ struct random_data
 # include <unistd.h>
 #endif
 
-/* The definition of GL_LINK_WARNING is copied here.  */
-
 /* The definition of _GL_ARG_NONNULL is copied here.  */
 
+/* The definition of _GL_WARN_ON_USE is copied here.  */
+
 
 /* Some systems do not define EXIT_*, despite otherwise supporting C89.  */
 #ifndef EXIT_SUCCESS
@@ -105,10 +105,10 @@ extern long long atoll (const char *string) _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef atoll
-# define atoll(s) \
-    (GL_LINK_WARNING ("atoll is unportable - " \
-                      "use gnulib module atoll for portability"), \
-     atoll (s))
+# if HAVE_RAW_DECL_ATOLL
+_GL_WARN_ON_USE (atoll, "atoll is unportable - "
+                 "use gnulib module atoll for portability");
+# endif
 #endif
 
 #if @GNULIB_CALLOC_POSIX@
@@ -119,10 +119,9 @@ extern void * calloc (size_t nmemb, size_t size);
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef calloc
-# define calloc(n,s) \
-    (GL_LINK_WARNING ("calloc is not POSIX compliant everywhere - " \
-                      "use gnulib module calloc-posix for portability"), \
-     calloc (n, s))
+/* Assume calloc is always declared.  */
+_GL_WARN_ON_USE (calloc, "calloc is not POSIX compliant everywhere - "
+                 "use gnulib module calloc-posix for portability");
 #endif
 
 #if @GNULIB_CANONICALIZE_FILE_NAME@
@@ -134,10 +133,10 @@ extern char *canonicalize_file_name (const char *name) _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef canonicalize_file_name
-# define canonicalize_file_name(n)                        \
-    (GL_LINK_WARNING ("canonicalize_file_name is unportable - " \
-                      "use gnulib module canonicalize-lgpl for portability"), \
-     canonicalize_file_name (n))
+# if HAVE_RAW_DECL_CANONICALIZE_FILE_NAME
+_GL_WARN_ON_USE (canonicalize_file_name, "canonicalize_file_name is unportable - "
+                 "use gnulib module canonicalize-lgpl for portability");
+# endif
 #endif
 
 #if @GNULIB_GETLOADAVG@
@@ -150,10 +149,10 @@ extern int getloadavg (double loadavg[], int nelem) _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef getloadavg
-# define getloadavg(l,n) \
-    (GL_LINK_WARNING ("getloadavg is not portable - " \
-                      "use gnulib module getloadavg for portability"), \
-     getloadavg (l, n))
+# if HAVE_RAW_DECL_GETLOADAVG
+_GL_WARN_ON_USE (getloadavg, "getloadavg is not portable - "
+                 "use gnulib module getloadavg for portability");
+# endif
 #endif
 
 #if @GNULIB_GETSUBOPT@
@@ -174,10 +173,10 @@ extern int getsubopt (char **optionp, char *const *tokens, char **valuep)
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef getsubopt
-# define getsubopt(o,t,v) \
-    (GL_LINK_WARNING ("getsubopt is unportable - " \
-                      "use gnulib module getsubopt for portability"), \
-     getsubopt (o, t, v))
+# if HAVE_RAW_DECL_GETSUBOPT
+_GL_WARN_ON_USE (getsubopt, "getsubopt is unportable - "
+                 "use gnulib module getsubopt for portability");
+# endif
 #endif
 
 #if @GNULIB_MALLOC_POSIX@
@@ -188,10 +187,9 @@ extern void * malloc (size_t size);
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef malloc
-# define malloc(s) \
-    (GL_LINK_WARNING ("malloc is not POSIX compliant everywhere - " \
-                      "use gnulib module malloc-posix for portability"), \
-     malloc (s))
+/* Assume malloc is always declared.  */
+_GL_WARN_ON_USE (malloc, "malloc is not POSIX compliant everywhere - "
+                 "use gnulib module malloc-posix for portability");
 #endif
 
 #if @GNULIB_MKDTEMP@
@@ -205,10 +203,10 @@ extern char * mkdtemp (char * /*template*/) _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef mkdtemp
-# define mkdtemp(t) \
-    (GL_LINK_WARNING ("mkdtemp is unportable - " \
-                      "use gnulib module mkdtemp for portability"), \
-     mkdtemp (t))
+# if HAVE_RAW_DECL_MKDTEMP
+_GL_WARN_ON_USE (mkdtemp, "mkdtemp is unportable - "
+                 "use gnulib module mkdtemp for portability");
+# endif
 #endif
 
 #if @GNULIB_MKOSTEMP@
@@ -229,10 +227,10 @@ extern int mkostemp (char * /*template*/, int /*flags*/) _GL_ARG_NONNULL ((1));
 # 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))
+# if HAVE_RAW_DECL_MKOSTEMP
+_GL_WARN_ON_USE (mkostemp, "mkostemp is unportable - "
+                 "use gnulib module mkostemp for portability");
+# endif
 #endif
 
 #if @GNULIB_MKOSTEMPS@
@@ -255,10 +253,10 @@ extern int mkostemps (char * /*template*/, int /*suffixlen*/, int /*flags*/)
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef mkostemps
-# define mkostemps(t,s,f)                          \
-    (GL_LINK_WARNING ("mkostemps is unportable - " \
-                      "use gnulib module mkostemps for portability"), \
-     mkostemps (t, s, f))
+# if HAVE_RAW_DECL_MKOSTEMPS
+_GL_WARN_ON_USE (mkostemps, "mkostemps is unportable - "
+                 "use gnulib module mkostemps for portability");
+# endif
 #endif
 
 #if @GNULIB_MKSTEMP@
@@ -277,10 +275,10 @@ extern int mkstemp (char * /*template*/) _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef mkstemp
-# define mkstemp(t) \
-    (GL_LINK_WARNING ("mkstemp is unportable - " \
-                      "use gnulib module mkstemp for portability"), \
-     mkstemp (t))
+# if HAVE_RAW_DECL_MKSTEMP
+_GL_WARN_ON_USE (mkstemp, "mkstemp is unportable - "
+                 "use gnulib module mkstemp for portability");
+# endif
 #endif
 
 #if @GNULIB_MKSTEMPS@
@@ -300,10 +298,10 @@ extern int mkstemps (char * /*template*/, int /*suffixlen*/)
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef mkstemps
-# define mkstemps(t,s)                             \
-    (GL_LINK_WARNING ("mkstemps is unportable - " \
-                      "use gnulib module mkstemps for portability"), \
-     mkstemps (t, s))
+# if HAVE_RAW_DECL_MKSTEMPS
+_GL_WARN_ON_USE (mkstemps, "mkstemps is unportable - "
+                 "use gnulib module mkstemps for portability");
+# endif
 #endif
 
 #if @GNULIB_PUTENV@
@@ -333,25 +331,25 @@ int random_r (struct random_data *buf, int32_t *result)
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef random_r
-# define random_r(b,r)                            \
-    (GL_LINK_WARNING ("random_r is unportable - " \
-                      "use gnulib module random_r for portability"), \
-     random_r (b,r))
+# if HAVE_RAW_DECL_RANDOM_R
+_GL_WARN_ON_USE (random_r, "random_r is unportable - "
+                 "use gnulib module random_r for portability");
+# endif
 # undef initstate_r
-# define initstate_r(s,b,sz,r)                       \
-    (GL_LINK_WARNING ("initstate_r is unportable - " \
-                      "use gnulib module random_r for portability"), \
-     initstate_r (s,b,sz,r))
+# if HAVE_RAW_DECL_INITSTATE_R
+_GL_WARN_ON_USE (initstate_r, "initstate_r is unportable - "
+                 "use gnulib module random_r for portability");
+# endif
 # undef srandom_r
-# define srandom_r(s,r)                            \
-    (GL_LINK_WARNING ("srandom_r is unportable - " \
-                      "use gnulib module random_r for portability"), \
-     srandom_r (s,r))
+# if HAVE_RAW_DECL_SRANDOM_R
+_GL_WARN_ON_USE (srandom_r, "srandom_r is unportable - "
+                 "use gnulib module random_r for portability");
+# endif
 # undef setstate_r
-# define setstate_r(a,r)                                    \
-    (GL_LINK_WARNING ("setstate_r is unportable - " \
-                      "use gnulib module random_r for portability"), \
-     setstate_r (a,r))
+# if HAVE_RAW_DECL_SETSTATE_R
+_GL_WARN_ON_USE (setstate_r, "setstate_r is unportable - "
+                 "use gnulib module random_r for portability");
+# endif
 #endif
 
 #if @GNULIB_REALLOC_POSIX@
@@ -362,10 +360,9 @@ extern void * realloc (void *ptr, size_t size);
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef realloc
-# define realloc(p,s) \
-    (GL_LINK_WARNING ("realloc is not POSIX compliant everywhere - " \
-                      "use gnulib module realloc-posix for portability"), \
-     realloc (p, s))
+/* Assume realloc is always declared.  */
+_GL_WARN_ON_USE (realloc, "realloc is not POSIX compliant everywhere - "
+                 "use gnulib module realloc-posix for portability");
 #endif
 
 #if @GNULIB_REALPATH@
@@ -377,10 +374,10 @@ extern char *realpath (const char *name, char *resolved) _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef realpath
-# define realpath(n,r)                        \
-    (GL_LINK_WARNING ("realpath is unportable - use gnulib module " \
-                      "canonicalize or canonicalize-lgpl for portability"), \
-     realpath (n, r))
+# if HAVE_RAW_DECL_REALPATH
+_GL_WARN_ON_USE (realpath, "realpath is unportable - use gnulib module "
+                 "canonicalize or canonicalize-lgpl for portability");
+# endif
 #endif
 
 #if @GNULIB_RPMATCH@
@@ -391,10 +388,10 @@ extern int rpmatch (const char *response) _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef rpmatch
-# define rpmatch(r) \
-    (GL_LINK_WARNING ("rpmatch is unportable - " \
-                      "use gnulib module rpmatch for portability"), \
-     rpmatch (r))
+# if HAVE_RAW_DECL_RPMATCH
+_GL_WARN_ON_USE (rpmatch, "rpmatch is unportable - "
+                 "use gnulib module rpmatch for portability");
+# endif
 #endif
 
 #if @GNULIB_SETENV@
@@ -410,10 +407,10 @@ extern int setenv (const char *name, const char *value, int replace)
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef setenv
-# define setenv(n,v,o)                                                  \
-    (GL_LINK_WARNING ("setenv is unportable - "                         \
-                      "use gnulib module setenv for portability"),      \
-     setenv (n, v, o))
+# if HAVE_RAW_DECL_SETENV
+_GL_WARN_ON_USE (setenv, "setenv is unportable - "
+                 "use gnulib module setenv for portability");
+# endif
 #endif
 
 #if @GNULIB_STRTOD@
@@ -426,10 +423,10 @@ extern double strtod (const char *str, char **endp) _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef strtod
-# define strtod(s, e)                           \
-    (GL_LINK_WARNING ("strtod is unportable - " \
-                      "use gnulib module strtod for portability"), \
-     strtod (s, e))
+# if HAVE_RAW_DECL_STRTOD
+_GL_WARN_ON_USE (strtod, "strtod is unportable - "
+                 "use gnulib module strtod for portability");
+# endif
 #endif
 
 #if @GNULIB_STRTOLL@
@@ -447,10 +444,10 @@ extern long long strtoll (const char *string, char **endptr, int base)
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef strtoll
-# define strtoll(s,e,b) \
-    (GL_LINK_WARNING ("strtoll is unportable - " \
-                      "use gnulib module strtoll for portability"), \
-     strtoll (s, e, b))
+# if HAVE_RAW_DECL_STRTOLL
+_GL_WARN_ON_USE (strtoll, "strtoll is unportable - "
+                 "use gnulib module strtoll for portability");
+# endif
 #endif
 
 #if @GNULIB_STRTOULL@
@@ -468,10 +465,10 @@ extern unsigned long long strtoull (const char *string, char **endptr, int base)
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef strtoull
-# define strtoull(s,e,b) \
-    (GL_LINK_WARNING ("strtoull is unportable - " \
-                      "use gnulib module strtoull for portability"), \
-     strtoull (s, e, b))
+# if HAVE_RAW_DECL_STRTOULL
+_GL_WARN_ON_USE (strtoull, "strtoull is unportable - "
+                 "use gnulib module strtoull for portability");
+# endif
 #endif
 
 #if @GNULIB_UNSETENV@
@@ -485,10 +482,10 @@ extern int unsetenv (const char *name) _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef unsetenv
-# define unsetenv(n)                                                    \
-    (GL_LINK_WARNING ("unsetenv is unportable - "                       \
-                      "use gnulib module unsetenv for portability"),    \
-     unsetenv (n))
+# if HAVE_RAW_DECL_UNSETENV
+_GL_WARN_ON_USE (unsetenv, "unsetenv is unportable - "
+                 "use gnulib module unsetenv for portability");
+# endif
 #endif
 
 #ifdef __cplusplus
diff --git a/libmissing/strcasecmp.c b/libmissing/strcasecmp.c
index fc3acc2..2891544 100644
--- a/libmissing/strcasecmp.c
+++ b/libmissing/strcasecmp.c
@@ -1,5 +1,5 @@
 /* Case-insensitive string comparison function.
-   Copyright (C) 1998-1999, 2005-2007, 2009 Free Software Foundation, Inc.
+   Copyright (C) 1998-1999, 2005-2007, 2009-2010 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
diff --git a/libmissing/streq.h b/libmissing/streq.h
index 393f6d9..8791598 100644
--- a/libmissing/streq.h
+++ b/libmissing/streq.h
@@ -1,5 +1,5 @@
 /* Optimized string comparison.
-   Copyright (C) 2001-2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2001-2002, 2007, 2009-2010 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify it
    under the terms of the GNU Lesser General Public License as published
diff --git a/libmissing/string.in.h b/libmissing/string.in.h
index 7a0a9a2..002088a 100644
--- a/libmissing/string.in.h
+++ b/libmissing/string.in.h
@@ -1,6 +1,6 @@
 /* A GNU-like <string.h>.
 
-   Copyright (C) 1995-1996, 2001-2009 Free Software Foundation, Inc.
+   Copyright (C) 1995-1996, 2001-2010 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
@@ -31,6 +31,11 @@
 /* NetBSD 5.0 mis-defines NULL.  */
 #include <stddef.h>
 
+/* MirBSD defines mbslen as a macro.  */
+#if @GNULIB_MBSLEN@ && defined __MirBSD__
+# include <wchar.h>
+#endif
+
 #ifndef __attribute__
 /* This feature is available in gcc versions 2.5 and later.  */
 # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
@@ -43,10 +48,10 @@
 #endif
 
 
-/* The definition of GL_LINK_WARNING is copied here.  */
-
 /* The definition of _GL_ARG_NONNULL is copied here.  */
 
+/* The definition of _GL_WARN_ON_USE is copied here.  */
+
 
 #ifdef __cplusplus
 extern "C" {
@@ -62,10 +67,9 @@ extern void *memchr (void const *__s, int __c, size_t __n)
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef memchr
-# define memchr(s,c,n) \
-    (GL_LINK_WARNING ("memchr has platform-specific bugs - " \
-                      "use gnulib module memchr for portability" ), \
-     memchr (s, c, n))
+/* Assume memchr is always declared.  */
+_GL_WARN_ON_USE (memchr, "memchr has platform-specific bugs - "
+                 "use gnulib module memchr for portability" );
 #endif
 
 /* Return the first occurrence of NEEDLE in HAYSTACK.  */
@@ -80,11 +84,11 @@ extern void *memmem (void const *__haystack, size_t __haystack_len,
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef memmem
-# define memmem(a,al,b,bl) \
-    (GL_LINK_WARNING ("memmem is unportable and often quadratic - " \
-                      "use gnulib module memmem-simple for portability, " \
-                      "and module memmem for speed" ), \
-     memmem (a, al, b, bl))
+# if HAVE_RAW_DECL_MEMMEM
+_GL_WARN_ON_USE (memmem, "memmem is unportable and often quadratic - "
+                 "use gnulib module memmem-simple for portability, "
+                 "and module memmem for speed" );
+# endif
 #endif
 
 /* Copy N bytes of SRC to DEST, return pointer to bytes after the
@@ -97,10 +101,10 @@ extern void *mempcpy (void *restrict __dest, void const *restrict __src,
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef mempcpy
-# define mempcpy(a,b,n) \
-    (GL_LINK_WARNING ("mempcpy is unportable - " \
-                      "use gnulib module mempcpy for portability"), \
-     mempcpy (a, b, n))
+# if HAVE_RAW_DECL_MEMPCPY
+_GL_WARN_ON_USE (mempcpy, "mempcpy is unportable - "
+                 "use gnulib module mempcpy for portability");
+# endif
 #endif
 
 /* Search backwards through a block for a byte (specified as an int).  */
@@ -111,10 +115,10 @@ extern void *memrchr (void const *, int, size_t)
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef memrchr
-# define memrchr(a,b,c) \
-    (GL_LINK_WARNING ("memrchr is unportable - " \
-                      "use gnulib module memrchr for portability"), \
-     memrchr (a, b, c))
+# if HAVE_RAW_DECL_MEMRCHR
+_GL_WARN_ON_USE (memrchr, "memrchr is unportable - "
+                 "use gnulib module memrchr for portability");
+# endif
 #endif
 
 /* Find the first occurrence of C in S.  More efficient than
@@ -127,10 +131,10 @@ extern void *rawmemchr (void const *__s, int __c_in)
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef rawmemchr
-# define rawmemchr(a,b) \
-    (GL_LINK_WARNING ("rawmemchr is unportable - " \
-                      "use gnulib module rawmemchr for portability"), \
-     rawmemchr (a, b))
+# if HAVE_RAW_DECL_RAWMEMCHR
+_GL_WARN_ON_USE (rawmemchr, "rawmemchr is unportable - "
+                 "use gnulib module rawmemchr for portability");
+# endif
 #endif
 
 /* Copy SRC to DST, returning the address of the terminating '\0' in DST.  */
@@ -141,10 +145,10 @@ extern char *stpcpy (char *restrict __dst, char const *restrict __src)
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef stpcpy
-# define stpcpy(a,b) \
-    (GL_LINK_WARNING ("stpcpy is unportable - " \
-                      "use gnulib module stpcpy for portability"), \
-     stpcpy (a, b))
+# if HAVE_RAW_DECL_STPCPY
+_GL_WARN_ON_USE (stpcpy, "stpcpy is unportable - "
+                 "use gnulib module stpcpy for portability");
+# endif
 #endif
 
 /* Copy no more than N bytes of SRC to DST, returning a pointer past the
@@ -158,21 +162,20 @@ extern char *stpncpy (char *restrict __dst, char const *restrict __src,
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef stpncpy
-# define stpncpy(a,b,n) \
-    (GL_LINK_WARNING ("stpncpy is unportable - " \
-                      "use gnulib module stpncpy for portability"), \
-     stpncpy (a, b, n))
+# if HAVE_RAW_DECL_STPNCPY
+_GL_WARN_ON_USE (stpncpy, "stpncpy is unportable - "
+                 "use gnulib module stpncpy for portability");
+# endif
 #endif
 
 #if defined GNULIB_POSIXCHECK
 /* strchr() does not work with multibyte strings if the locale encoding is
    GB18030 and the character to be searched is a digit.  */
 # undef strchr
-# define strchr(s,c) \
-    (GL_LINK_WARNING ("strchr cannot work correctly on character strings " \
-                      "in some multibyte locales - " \
-                      "use mbschr if you care about internationalization"), \
-     strchr (s, c))
+/* Assume strchr is always declared.  */
+_GL_WARN_ON_USE (strchr, "strchr cannot work correctly on character strings "
+                 "in some multibyte locales - "
+                 "use mbschr if you care about internationalization");
 #endif
 
 /* Find the first occurrence of C in S or the final NUL byte.  */
@@ -183,10 +186,10 @@ extern char *strchrnul (char const *__s, int __c_in)
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef strchrnul
-# define strchrnul(a,b) \
-    (GL_LINK_WARNING ("strchrnul is unportable - " \
-                      "use gnulib module strchrnul for portability"), \
-     strchrnul (a, b))
+# if HAVE_RAW_DECL_STRCHRNUL
+_GL_WARN_ON_USE (strchrnul, "strchrnul is unportable - "
+                 "use gnulib module strchrnul for portability");
+# endif
 #endif
 
 /* Duplicate S, returning an identical malloc'd string.  */
@@ -200,10 +203,10 @@ extern char *strdup (char const *__s) _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef strdup
-# define strdup(a) \
-    (GL_LINK_WARNING ("strdup is unportable - " \
-                      "use gnulib module strdup for portability"), \
-     strdup (a))
+# if HAVE_RAW_DECL_STRDUP
+_GL_WARN_ON_USE (strdup, "strdup is unportable - "
+                 "use gnulib module strdup for portability");
+# endif
 #endif
 
 /* Return a newly allocated copy of at most N bytes of STRING.  */
@@ -217,10 +220,10 @@ extern char *strndup (char const *__string, size_t __n) _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef strndup
-# define strndup(a,n) \
-    (GL_LINK_WARNING ("strndup is unportable - " \
-                      "use gnulib module strndup for portability"), \
-     strndup (a, n))
+# if HAVE_RAW_DECL_STRNDUP
+_GL_WARN_ON_USE (strndup, "strndup is unportable - "
+                 "use gnulib module strndup for portability");
+# endif
 #endif
 
 /* Find the length (number of bytes) of STRING, but scan at most
@@ -233,10 +236,10 @@ extern size_t strnlen (char const *__string, size_t __maxlen)
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef strnlen
-# define strnlen(a,n) \
-    (GL_LINK_WARNING ("strnlen is unportable - " \
-                      "use gnulib module strnlen for portability"), \
-     strnlen (a, n))
+# if HAVE_RAW_DECL_STRNLEN
+_GL_WARN_ON_USE (strnlen, "strnlen is unportable - "
+                 "use gnulib module strnlen for portability");
+# endif
 #endif
 
 #if defined GNULIB_POSIXCHECK
@@ -245,11 +248,10 @@ extern size_t strnlen (char const *__string, size_t __maxlen)
    locale encoding is GB18030 and one of the characters to be searched is a
    digit.  */
 # undef strcspn
-# define strcspn(s,a) \
-    (GL_LINK_WARNING ("strcspn cannot work correctly on character strings " \
-                      "in multibyte locales - " \
-                      "use mbscspn if you care about internationalization"), \
-     strcspn (s, a))
+/* Assume strcspn is always declared.  */
+_GL_WARN_ON_USE (strcspn, "strcspn cannot work correctly on character strings "
+                 "in multibyte locales - "
+                 "use mbscspn if you care about internationalization");
 #endif
 
 /* Find the first occurrence in S of any character in ACCEPT.  */
@@ -264,40 +266,36 @@ extern char *strpbrk (char const *__s, char const *__accept)
    locale encoding is GB18030 and one of the characters to be searched is a
    digit.  */
 #  undef strpbrk
-#  define strpbrk(s,a) \
-     (GL_LINK_WARNING ("strpbrk cannot work correctly on character strings " \
-                       "in multibyte locales - " \
-                       "use mbspbrk if you care about internationalization"), \
-      strpbrk (s, a))
+_GL_WARN_ON_USE (strpbrk, "strpbrk cannot work correctly on character strings "
+                 "in multibyte locales - "
+                 "use mbspbrk if you care about internationalization");
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef strpbrk
-# define strpbrk(s,a) \
-    (GL_LINK_WARNING ("strpbrk is unportable - " \
-                      "use gnulib module strpbrk for portability"), \
-     strpbrk (s, a))
+# if HAVE_RAW_DECL_STRPBRK
+_GL_WARN_ON_USE (strpbrk, "strpbrk is unportable - "
+                 "use gnulib module strpbrk for portability");
+# endif
 #endif
 
 #if defined GNULIB_POSIXCHECK
 /* strspn() assumes the second argument is a list of single-byte characters.
    Even in this simple case, it cannot work with multibyte strings.  */
 # undef strspn
-# define strspn(s,a) \
-    (GL_LINK_WARNING ("strspn cannot work correctly on character strings " \
-                      "in multibyte locales - " \
-                      "use mbsspn if you care about internationalization"), \
-     strspn (s, a))
+/* Assume strspn is always declared.  */
+_GL_WARN_ON_USE (strspn, "strspn cannot work correctly on character strings "
+                 "in multibyte locales - "
+                 "use mbsspn if you care about internationalization");
 #endif
 
 #if defined GNULIB_POSIXCHECK
 /* strrchr() does not work with multibyte strings if the locale encoding is
    GB18030 and the character to be searched is a digit.  */
 # undef strrchr
-# define strrchr(s,c) \
-    (GL_LINK_WARNING ("strrchr cannot work correctly on character strings " \
-                      "in some multibyte locales - " \
-                      "use mbsrchr if you care about internationalization"), \
-     strrchr (s, c))
+/* Assume strrchr is always declared.  */
+_GL_WARN_ON_USE (strrchr, "strrchr cannot work correctly on character strings "
+                 "in some multibyte locales - "
+                 "use mbsrchr if you care about internationalization");
 #endif
 
 /* Search the next delimiter (char listed in DELIM) starting at *STRINGP.
@@ -323,18 +321,16 @@ extern char *strsep (char **restrict __stringp, char const *restrict __delim)
 # endif
 # if defined GNULIB_POSIXCHECK
 #  undef strsep
-#  define strsep(s,d) \
-     (GL_LINK_WARNING ("strsep cannot work correctly on character strings " \
-                       "in multibyte locales - " \
-                       "use mbssep if you care about internationalization"), \
-      strsep (s, d))
+_GL_WARN_ON_USE (strsep, "strsep cannot work correctly on character strings "
+                 "in multibyte locales - "
+                 "use mbssep if you care about internationalization");
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef strsep
-# define strsep(s,d) \
-    (GL_LINK_WARNING ("strsep is unportable - " \
-                      "use gnulib module strsep for portability"), \
-     strsep (s, d))
+# if HAVE_RAW_DECL_STRSEP
+_GL_WARN_ON_USE (strsep, "strsep is unportable - "
+                 "use gnulib module strsep for portability");
+# endif
 #endif
 
 #if @GNULIB_STRSTR@
@@ -349,13 +345,12 @@ extern char *strstr (const char *haystack, const char *needle)
    POSIX says that it operates on "strings", and "string" in POSIX is defined
    as a sequence of bytes, not of characters.  */
 # undef strstr
-# define strstr(a,b) \
-    (GL_LINK_WARNING ("strstr is quadratic on many systems, and cannot " \
-                      "work correctly on character strings in most "    \
-                      "multibyte locales - " \
-                      "use mbsstr if you care about internationalization, " \
-                      "or use strstr if you care about speed"), \
-     strstr (a, b))
+/* Assume strstr is always declared.  */
+_GL_WARN_ON_USE (strstr, "strstr is quadratic on many systems, and cannot "
+                 "work correctly on character strings in most "
+                 "multibyte locales - "
+                 "use mbsstr if you care about internationalization, "
+                 "or use strstr if you care about speed");
 #endif
 
 /* Find the first occurrence of NEEDLE in HAYSTACK, using case-insensitive
@@ -373,13 +368,13 @@ extern char *strcasestr (const char *haystack, const char *needle)
    It is a glibc extension, and glibc implements it only for unibyte
    locales.  */
 # undef strcasestr
-# define strcasestr(a,b) \
-    (GL_LINK_WARNING ("strcasestr does work correctly on character strings " \
-                      "in multibyte locales - " \
-                      "use mbscasestr if you care about " \
-                      "internationalization, or use c-strcasestr if you want " \
-                      "a locale independent function"), \
-     strcasestr (a, b))
+# if HAVE_RAW_DECL_STRCASESTR
+_GL_WARN_ON_USE (strcasestr, "strcasestr does work correctly on character "
+                 "strings in multibyte locales - "
+                 "use mbscasestr if you care about "
+                 "internationalization, or use c-strcasestr if you want "
+                 "a locale independent function");
+# endif
 #endif
 
 /* Parse S into tokens separated by characters in DELIM.
@@ -408,7 +403,7 @@ extern char *strcasestr (const char *haystack, const char *needle)
 # if @REPLACE_STRTOK_R@
 #  undef strtok_r
 #  define strtok_r rpl_strtok_r
-# elif @UNDEFINE_STRTOK_R@
+# elif @UNDEFINE_STRTOK_R@ || defined GNULIB_POSIXCHECK
 #  undef strtok_r
 # endif
 # if ! @HAVE_DECL_STRTOK_R@ || @REPLACE_STRTOK_R@
@@ -417,19 +412,16 @@ extern char *strtok_r (char *restrict s, char const *restrict delim,
      _GL_ARG_NONNULL ((2, 3));
 # endif
 # if defined GNULIB_POSIXCHECK
-#  undef strtok_r
-#  define strtok_r(s,d,p) \
-     (GL_LINK_WARNING ("strtok_r cannot work correctly on character strings " \
-                       "in multibyte locales - " \
-                       "use mbstok_r if you care about internationalization"), \
-      strtok_r (s, d, p))
+_GL_WARN_ON_USE (strtok_r, "strtok_r cannot work correctly on character "
+                 "strings in multibyte locales - "
+                 "use mbstok_r if you care about internationalization");
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef strtok_r
-# define strtok_r(s,d,p) \
-    (GL_LINK_WARNING ("strtok_r is unportable - " \
-                      "use gnulib module strtok_r for portability"), \
-     strtok_r (s, d, p))
+# if HAVE_RAW_DECL_STRTOK_R
+_GL_WARN_ON_USE (strtok_r, "strtok_r is unportable - "
+                 "use gnulib module strtok_r for portability");
+# endif
 #endif
 
 
@@ -439,6 +431,12 @@ extern char *strtok_r (char *restrict s, char const *restrict delim,
 #if @GNULIB_MBSLEN@
 /* Return the number of multibyte characters in the character string STRING.
    This considers multibyte characters, unlike strlen, which counts bytes.  */
+# ifdef __MirBSD__  /* MirBSD defines mbslen as a macro.  Override it.  */
+#  undef mbslen
+# endif
+# if @HAVE_MBSLEN@  /* AIX, OSF/1, MirBSD define mbslen already in libc.  */
+#  define mbslen rpl_mbslen
+# endif
 extern size_t mbslen (const char *string) _GL_ARG_NONNULL ((1));
 #endif
 
@@ -603,10 +601,9 @@ extern char *strerror (int);
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef strerror
-# define strerror(e) \
-    (GL_LINK_WARNING ("strerror is unportable - " \
-                      "use gnulib module strerror to guarantee non-NULL result"), \
-     strerror (e))
+/* Assume strerror is always declared.  */
+_GL_WARN_ON_USE (strerror, "strerror is unportable - "
+                 "use gnulib module strerror to guarantee non-NULL result");
 #endif
 
 #if @GNULIB_STRSIGNAL@
@@ -618,10 +615,10 @@ extern char *strsignal (int __sig);
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef strsignal
-# define strsignal(a) \
-    (GL_LINK_WARNING ("strsignal is unportable - " \
-                      "use gnulib module strsignal for portability"), \
-     strsignal (a))
+# if HAVE_RAW_DECL_STRSIGNAL
+_GL_WARN_ON_USE (strsignal, "strsignal is unportable - "
+                 "use gnulib module strsignal for portability");
+# endif
 #endif
 
 #if @GNULIB_STRVERSCMP@
@@ -630,10 +627,10 @@ extern int strverscmp (const char *, const char *) _GL_ARG_NONNULL ((1, 2));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef strverscmp
-# define strverscmp(a, b) \
-    (GL_LINK_WARNING ("strverscmp is unportable - " \
-                      "use gnulib module strverscmp for portability"), \
-     strverscmp (a, b))
+# if HAVE_RAW_DECL_STRVERSCMP
+_GL_WARN_ON_USE (strverscmp, "strverscmp is unportable - "
+                 "use gnulib module strverscmp for portability");
+# endif
 #endif
 
 
diff --git a/libmissing/strings.in.h b/libmissing/strings.in.h
index 8e2b95c..b2cf2cf 100644
--- a/libmissing/strings.in.h
+++ b/libmissing/strings.in.h
@@ -1,6 +1,6 @@
 /* A substitute <strings.h>.
 
-   Copyright (C) 2007-2009 Free Software Foundation, Inc.
+   Copyright (C) 2007-2010 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
@@ -29,10 +29,9 @@
 #define _GL_STRINGS_H
 
 
-/* The definition of GL_LINK_WARNING is copied here.  */
-
 /* The definition of _GL_ARG_NONNULL is copied here.  */
 
+/* The definition of _GL_WARN_ON_USE is copied here.  */
 
 #ifdef __cplusplus
 extern "C" {
@@ -52,14 +51,14 @@ extern int strcasecmp (char const *s1, char const *s2)
    POSIX says that it operates on "strings", and "string" in POSIX is defined
    as a sequence of bytes, not of characters.   */
 # undef strcasecmp
-# define strcasecmp(a,b) \
-    (GL_LINK_WARNING ("strcasecmp cannot work correctly on character strings " \
-                      "in multibyte locales - " \
-                      "use mbscasecmp if you care about " \
-                      "internationalization, or use c_strcasecmp (from " \
-                      "gnulib module c-strcase) if you want a locale " \
-                      "independent function"), \
-     strcasecmp (a, b))
+# if HAVE_RAW_DECL_STRCASECMP
+_GL_WARN_ON_USE (strcasecmp, "strcasecmp cannot work correctly on character "
+                 "strings in multibyte locales - "
+                 "use mbscasecmp if you care about "
+                 "internationalization, or use c_strcasecmp , "
+                 "gnulib module c-strcase) if you want a locale "
+                 "independent function");
+# endif
 #endif
 
 /* Compare no more than N bytes of strings S1 and S2, ignoring case,
@@ -75,14 +74,14 @@ extern int strncasecmp (char const *s1, char const *s2, size_t n)
    POSIX says that it operates on "strings", and "string" in POSIX is defined
    as a sequence of bytes, not of characters.  */
 # undef strncasecmp
-# define strncasecmp(a,b,n) \
-    (GL_LINK_WARNING ("strncasecmp cannot work correctly on character " \
-                      "strings in multibyte locales - " \
-                      "use mbsncasecmp or mbspcasecmp if you care about " \
-                      "internationalization, or use c_strncasecmp (from " \
-                      "gnulib module c-strcase) if you want a locale " \
-                      "independent function"), \
-     strncasecmp (a, b, n))
+# if HAVE_RAW_DECL_STRNCASECMP
+_GL_WARN_ON_USE (strncasecmp, "strncasecmp cannot work correctly on character "
+                 "strings in multibyte locales - "
+                 "use mbsncasecmp or mbspcasecmp if you care about "
+                 "internationalization, or use c_strncasecmp , "
+                 "gnulib module c-strcase) if you want a locale "
+                 "independent function");
+# endif
 #endif
 
 
diff --git a/libmissing/strncasecmp.c b/libmissing/strncasecmp.c
index 4a2eb1e..d525deb 100644
--- a/libmissing/strncasecmp.c
+++ b/libmissing/strncasecmp.c
@@ -1,5 +1,5 @@
 /* strncasecmp.c -- case insensitive string comparator
-   Copyright (C) 1998-1999, 2005-2007, 2009 Free Software Foundation, Inc.
+   Copyright (C) 1998-1999, 2005-2007, 2009-2010 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
diff --git a/libmissing/strnlen1.c b/libmissing/strnlen1.c
index b01dee0..9eda1b9 100644
--- a/libmissing/strnlen1.c
+++ b/libmissing/strnlen1.c
@@ -1,5 +1,5 @@
 /* Find the length of STRING + 1, but scan at most MAXLEN bytes.
-   Copyright (C) 2005-2006, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2005-2006, 2009-2010 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
diff --git a/libmissing/strnlen1.h b/libmissing/strnlen1.h
index 3698fec..4d75c2e 100644
--- a/libmissing/strnlen1.h
+++ b/libmissing/strnlen1.h
@@ -1,5 +1,5 @@
 /* Find the length of STRING + 1, but scan at most MAXLEN bytes.
-   Copyright (C) 2005, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2009, 2010 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
diff --git a/libmissing/strptime.c b/libmissing/strptime.c
index 0172f7b..c041f81 100644
--- a/libmissing/strptime.c
+++ b/libmissing/strptime.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2002, 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2004, 2005, 2007, 2009, 2010 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
diff --git a/libmissing/strsep.c b/libmissing/strsep.c
index f71b810..3a200e3 100644
--- a/libmissing/strsep.c
+++ b/libmissing/strsep.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004, 2007, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2004, 2007, 2009, 2010 Free Software Foundation, Inc.
 
    Written by Yoann Vandoorselaere <[email protected]>.
 
diff --git a/libmissing/sys_select.in.h b/libmissing/sys_select.in.h
index 336894c..b91f93d 100644
--- a/libmissing/sys_select.in.h
+++ b/libmissing/sys_select.in.h
@@ -1,5 +1,5 @@
 /* Substitute for <sys/select.h>.
-   Copyright (C) 2007-2009 Free Software Foundation, Inc.
+   Copyright (C) 2007-2010 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
@@ -69,7 +69,7 @@
 
 # include <sys/socket.h>
 
-/* The definition of GL_LINK_WARNING is copied here.  */
+/* The definition of _GL_WARN_ON_USE is copied here.  */
 
 # ifdef __cplusplus
 extern "C" {
@@ -86,10 +86,10 @@ extern int rpl_select (int, fd_set *, fd_set *, fd_set *, struct timeval *);
 #  define select select_used_without_requesting_gnulib_module_select
 # elif defined GNULIB_POSIXCHECK
 #  undef select
-#  define select(n,r,w,e,t) \
-     (GL_LINK_WARNING ("select is not always POSIX compliant - " \
-                       "use gnulib module select for portability"), \
-      select (n, r, w, e, t))
+#  if HAVE_RAW_DECL_SELECT
+_GL_WARN_ON_USE (select, "select is not always POSIX compliant - "
+                 "use gnulib module select for portability");
+#  endif
 # endif
 
 # ifdef __cplusplus
diff --git a/libmissing/sys_socket.in.h b/libmissing/sys_socket.in.h
index 1d46175..20583c0 100644
--- a/libmissing/sys_socket.in.h
+++ b/libmissing/sys_socket.in.h
@@ -1,6 +1,6 @@
 /* Provide a sys/socket header file for systems lacking it (read: MinGW)
    and for systems where it is incomplete.
-   Copyright (C) 2005-2009 Free Software Foundation, Inc.
+   Copyright (C) 2005-2010 Free Software Foundation, Inc.
    Written by Simon Josefsson.
 
    This program is free software; you can redistribute it and/or modify
@@ -126,7 +126,7 @@ struct sockaddr_storage
 #  define SHUT_RDWR SD_BOTH
 # endif
 
-/* The definition of GL_LINK_WARNING is copied here.  */
+/* The definition of _GL_WARN_ON_USE is copied here.  */
 
 # if @HAVE_WINSOCK2_H@
 /* Include headers needed by the emulation code.  */
@@ -187,10 +187,10 @@ extern int rpl_socket (int, int, int protocol);
 #  define socket socket_used_without_requesting_gnulib_module_socket
 # elif defined GNULIB_POSIXCHECK
 #  undef socket
-#  define socket(d,t,p) \
-     (GL_LINK_WARNING ("socket is not always POSIX compliant - " \
-                       "use gnulib module socket for portability"), \
-      socket (d, t, p))
+#  if HAVE_RAW_DECL_SOCKET
+_GL_WARN_ON_USE (socket, "socket is not always POSIX compliant - "
+                 "use gnulib module socket for portability");
+#  endif
 # endif
 
 # if @GNULIB_CONNECT@
@@ -204,10 +204,10 @@ extern int rpl_connect (int, struct sockaddr *, int) _GL_ARG_NONNULL ((2));
 #  define connect socket_used_without_requesting_gnulib_module_connect
 # elif defined GNULIB_POSIXCHECK
 #  undef connect
-#  define connect(s,a,l) \
-     (GL_LINK_WARNING ("connect is not always POSIX compliant - " \
-                       "use gnulib module connect for portability"), \
-      connect (s, a, l))
+#  if HAVE_RAW_DECL_CONNECT
+_GL_WARN_ON_USE (connect, "connect is not always POSIX compliant - "
+                 "use gnulib module connect for portability");
+#  endif
 # endif
 
 # if @GNULIB_ACCEPT@
@@ -221,10 +221,10 @@ extern int rpl_accept (int, struct sockaddr *, int *);
 #  define accept accept_used_without_requesting_gnulib_module_accept
 # elif defined GNULIB_POSIXCHECK
 #  undef accept
-#  define accept(s,a,l) \
-     (GL_LINK_WARNING ("accept is not always POSIX compliant - " \
-                       "use gnulib module accept for portability"), \
-      accept (s, a, l))
+# if HAVE_RAW_DECL_ACCEPT
+_GL_WARN_ON_USE (accept, "accept is not always POSIX compliant - "
+                 "use gnulib module accept for portability");
+#  endif
 # endif
 
 # if @GNULIB_BIND@
@@ -238,10 +238,10 @@ extern int rpl_bind (int, struct sockaddr *, int) _GL_ARG_NONNULL ((2));
 #  define bind bind_used_without_requesting_gnulib_module_bind
 # elif defined GNULIB_POSIXCHECK
 #  undef bind
-#  define bind(s,a,l) \
-     (GL_LINK_WARNING ("bind is not always POSIX compliant - " \
-                       "use gnulib module bind for portability"), \
-      bind (s, a, l))
+#  if HAVE_RAW_DECL_BIND
+_GL_WARN_ON_USE (bind, "bind is not always POSIX compliant - "
+                 "use gnulib module bind for portability");
+#  endif
 # endif
 
 # if @GNULIB_GETPEERNAME@
@@ -256,10 +256,10 @@ extern int rpl_getpeername (int, struct sockaddr *, int *)
 #  define getpeername getpeername_used_without_requesting_gnulib_module_getpeername
 # elif defined GNULIB_POSIXCHECK
 #  undef getpeername
-#  define getpeername(s,a,l) \
-     (GL_LINK_WARNING ("getpeername is not always POSIX compliant - " \
-                       "use gnulib module getpeername for portability"), \
-      getpeername (s, a, l))
+#  if HAVE_RAW_DECL_GETPEERNAME
+_GL_WARN_ON_USE (getpeername, "getpeername is not always POSIX compliant - "
+                 "use gnulib module getpeername for portability");
+#  endif
 # endif
 
 # if @GNULIB_GETSOCKNAME@
@@ -274,10 +274,10 @@ extern int rpl_getsockname (int, struct sockaddr *, int *)
 #  define getsockname getsockname_used_without_requesting_gnulib_module_getsockname
 # elif defined GNULIB_POSIXCHECK
 #  undef getsockname
-#  define getsockname(s,a,l) \
-     (GL_LINK_WARNING ("getsockname is not always POSIX compliant - " \
-                       "use gnulib module getsockname for portability"), \
-      getsockname (s, a, l))
+#  if HAVE_RAW_DECL_GETSOCKNAME
+_GL_WARN_ON_USE (getsockname, "getsockname is not always POSIX compliant - "
+                 "use gnulib module getsockname for portability");
+#  endif
 # endif
 
 # if @GNULIB_GETSOCKOPT@
@@ -292,10 +292,10 @@ extern int rpl_getsockopt (int, int, int, void *, socklen_t *)
 #  define getsockopt getsockopt_used_without_requesting_gnulib_module_getsockopt
 # elif defined GNULIB_POSIXCHECK
 #  undef getsockopt
-#  define getsockopt(s,lvl,o,v,l) \
-     (GL_LINK_WARNING ("getsockopt is not always POSIX compliant - " \
-                       "use gnulib module getsockopt for portability"), \
-      getsockopt (s, lvl, o, v, l))
+#  if HAVE_RAW_DECL_GETSOCKOPT
+_GL_WARN_ON_USE (getsockopt, "getsockopt is not always POSIX compliant - "
+                 "use gnulib module getsockopt for portability");
+#  endif
 # endif
 
 # if @GNULIB_LISTEN@
@@ -309,10 +309,10 @@ extern int rpl_listen (int, int);
 #  define listen listen_used_without_requesting_gnulib_module_listen
 # elif defined GNULIB_POSIXCHECK
 #  undef listen
-#  define listen(s,b) \
-     (GL_LINK_WARNING ("listen is not always POSIX compliant - " \
-                       "use gnulib module listen for portability"), \
-      listen (s, b))
+#  if HAVE_RAW_DECL_LISTEN
+_GL_WARN_ON_USE (listen, "listen is not always POSIX compliant - "
+                 "use gnulib module listen for portability");
+#  endif
 # endif
 
 # if @GNULIB_RECV@
@@ -326,10 +326,10 @@ extern int rpl_recv (int, void *, int, int) _GL_ARG_NONNULL ((2));
 #  define recv recv_used_without_requesting_gnulib_module_recv
 # elif defined GNULIB_POSIXCHECK
 #  undef recv
-#  define recv(s,b,n,f) \
-     (GL_LINK_WARNING ("recv is not always POSIX compliant - " \
-                       "use gnulib module recv for portability"), \
-      recv (s, b, n, f))
+#  if HAVE_RAW_DECL_RECV
+_GL_WARN_ON_USE (recv, "recv is not always POSIX compliant - "
+                 "use gnulib module recv for portability");
+#  endif
 # endif
 
 # if @GNULIB_SEND@
@@ -343,10 +343,10 @@ extern int rpl_send (int, const void *, int, int) _GL_ARG_NONNULL ((2));
 #  define send send_used_without_requesting_gnulib_module_send
 # elif defined GNULIB_POSIXCHECK
 #  undef send
-#  define send(s,b,n,f) \
-     (GL_LINK_WARNING ("send is not always POSIX compliant - " \
-                       "use gnulib module send for portability"), \
-      send (s, b, n, f))
+#  if HAVE_RAW_DECL_SEND
+_GL_WARN_ON_USE (send, "send is not always POSIX compliant - "
+                 "use gnulib module send for portability");
+#  endif
 # endif
 
 # if @GNULIB_RECVFROM@
@@ -361,10 +361,10 @@ extern int rpl_recvfrom (int, void *, int, int, struct sockaddr *, int *)
 #  define recvfrom recvfrom_used_without_requesting_gnulib_module_recvfrom
 # elif defined GNULIB_POSIXCHECK
 #  undef recvfrom
-#  define recvfrom(s,b,n,f,a,l) \
-     (GL_LINK_WARNING ("recvfrom is not always POSIX compliant - " \
-                       "use gnulib module recvfrom for portability"), \
-      recvfrom (s, b, n, f, a, l))
+#  if HAVE_RAW_DECL_RECVFROM
+_GL_WARN_ON_USE (recvfrom, "recvfrom is not always POSIX compliant - "
+                 "use gnulib module recvfrom for portability");
+#  endif
 # endif
 
 # if @GNULIB_SENDTO@
@@ -379,10 +379,10 @@ extern int rpl_sendto (int, const void *, int, int, struct sockaddr *, int)
 #  define sendto sendto_used_without_requesting_gnulib_module_sendto
 # elif defined GNULIB_POSIXCHECK
 #  undef sendto
-#  define sendto(s,b,n,f,a,l) \
-     (GL_LINK_WARNING ("sendto is not always POSIX compliant - " \
-                       "use gnulib module sendto for portability"), \
-      sendto (s, b, n, f, a, l))
+#  if HAVE_RAW_DECL_SENDTO
+_GL_WARN_ON_USE (sendto, "sendto is not always POSIX compliant - "
+                 "use gnulib module sendto for portability");
+#  endif
 # endif
 
 # if @GNULIB_SETSOCKOPT@
@@ -397,10 +397,10 @@ extern int rpl_setsockopt (int, int, int, const void *, socklen_t)
 #  define setsockopt setsockopt_used_without_requesting_gnulib_module_setsockopt
 # elif defined GNULIB_POSIXCHECK
 #  undef setsockopt
-#  define setsockopt(s,lvl,o,v,l) \
-     (GL_LINK_WARNING ("setsockopt is not always POSIX compliant - " \
-                       "use gnulib module setsockopt for portability"), \
-      setsockopt (s, lvl, o, v, l))
+#  if HAVE_RAW_DECL_SETSOCKOPT
+_GL_WARN_ON_USE (setsockopt, "setsockopt is not always POSIX compliant - "
+                 "use gnulib module setsockopt for portability");
+#  endif
 # endif
 
 # if @GNULIB_SHUTDOWN@
@@ -414,10 +414,10 @@ extern int rpl_shutdown (int, int);
 #  define shutdown shutdown_used_without_requesting_gnulib_module_shutdown
 # elif defined GNULIB_POSIXCHECK
 #  undef shutdown
-#  define shutdown(s,h) \
-     (GL_LINK_WARNING ("shutdown is not always POSIX compliant - " \
-                       "use gnulib module shutdown for portability"), \
-      shutdown (s, h))
+#  if HAVE_RAW_DECL_SHUTDOWN
+_GL_WARN_ON_USE (shutdown, "shutdown is not always POSIX compliant - "
+                 "use gnulib module shutdown for portability");
+#  endif
 # endif
 
 # if @HAVE_WINSOCK2_H@
@@ -448,10 +448,10 @@ 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))
+# if HAVE_RAW_DECL_ACCEPT4
+_GL_WARN_ON_USE (accept4, "accept4 is unportable - "
+                 "use gnulib module accept4 for portability");
+# endif
 #endif
 
 #ifdef __cplusplus
diff --git a/libmissing/sys_stat.in.h b/libmissing/sys_stat.in.h
index 0db3c4d..ab5f161 100644
--- a/libmissing/sys_stat.in.h
+++ b/libmissing/sys_stat.in.h
@@ -1,5 +1,5 @@
 /* Provide a more complete sys/stat header file.
-   Copyright (C) 2005-2009 Free Software Foundation, Inc.
+   Copyright (C) 2005-2010 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
@@ -47,10 +47,10 @@
 #ifndef _GL_SYS_STAT_H
 #define _GL_SYS_STAT_H
 
-/* The definition of GL_LINK_WARNING is copied here.  */
-
 /* The definition of _GL_ARG_NONNULL is copied here.  */
 
+/* The definition of _GL_WARN_ON_USE is copied here.  */
+
 /* Before doing "#define mkdir rpl_mkdir" below, we need to include all
    headers that may declare mkdir().  */
 #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
@@ -302,10 +302,10 @@ 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))
+# if HAVE_RAW_DECL_FCHMODAT
+_GL_WARN_ON_USE (fchmodat, "fchmodat is not portable - "
+                 "use gnulib module openat for portability");
+# endif
 #endif
 
 
@@ -326,10 +326,10 @@ 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))
+# if HAVE_RAW_DECL_FSTATAT
+_GL_WARN_ON_USE (fstatat, "fstatat is not portable - "
+                 "use gnulib module openat for portability");
+# endif
 #endif
 
 
@@ -343,10 +343,10 @@ extern int futimens (int fd, struct timespec const times[2]);
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef futimens
-# define futimens(f,t)                         \
-    (GL_LINK_WARNING ("futimens is not portable - " \
-                      "use gnulib module futimens for portability"), \
-     futimens (f, t))
+# if HAVE_RAW_DECL_FUTIMENS
+_GL_WARN_ON_USE (futimens, "futimens is not portable - "
+                 "use gnulib module futimens for portability");
+# endif
 #endif
 
 
@@ -368,10 +368,10 @@ extern int lchmod (const char *filename, mode_t mode) _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef lchmod
-# define lchmod(f,m) \
-    (GL_LINK_WARNING ("lchmod is unportable - " \
-                      "use gnulib module lchmod for portability"), \
-     lchmod (f, m))
+# if HAVE_RAW_DECL_LCHMOD
+_GL_WARN_ON_USE (lchmod, "lchmod is unportable - "
+                 "use gnulib module lchmod for portability");
+# endif
 #endif
 
 
@@ -388,10 +388,10 @@ extern int rpl_lstat (const char *name, struct stat *buf)
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef lstat
-# define lstat(p,b)                                                     \
-  (GL_LINK_WARNING ("lstat is unportable - "                            \
-                    "use gnulib module lstat for portability"),         \
-   lstat (p, b))
+# if HAVE_RAW_DECL_LSTAT
+_GL_WARN_ON_USE (lstat, "lstat is unportable - "
+                 "use gnulib module lstat for portability");
+# endif
 #endif
 
 
@@ -423,10 +423,10 @@ 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))
+# if HAVE_RAW_DECL_MKDIRAT
+_GL_WARN_ON_USE (mkdirat, "mkdirat is not portable - "
+                 "use gnulib module openat for portability");
+# endif
 #endif
 
 
@@ -440,10 +440,10 @@ extern int mkfifo (char const *file, mode_t mode) _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef mkfifo
-# define mkfifo(n,m)                                                    \
-    (GL_LINK_WARNING ("mkfifo is not portable - "                       \
-                      "use gnulib module mkfifo for portability"),      \
-     mkfifo (n, m))
+# if HAVE_RAW_DECL_MKFIFO
+_GL_WARN_ON_USE (mkfifo, "mkfifo is not portable - "
+                 "use gnulib module mkfifo for portability");
+# endif
 #endif
 
 
@@ -454,10 +454,10 @@ extern 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))
+# if HAVE_RAW_DECL_MKFIFOAT
+_GL_WARN_ON_USE (mkfifoat, "mkfifoat is not portable - "
+                 "use gnulib module mkfifoat for portability");
+# endif
 #endif
 
 
@@ -472,10 +472,10 @@ extern int mknod (char const *file, mode_t mode, dev_t dev)
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef mknod
-# define mknod(n,m,d)                                                   \
-    (GL_LINK_WARNING ("mknod is not portable - "                        \
-                      "use gnulib module mknod for portability"),       \
-     mknod (n, m, d))
+# if HAVE_RAW_DECL_MKNOD
+_GL_WARN_ON_USE (mknod, "mknod is not portable - "
+                 "use gnulib module mknod for portability");
+# endif
 #endif
 
 
@@ -486,10 +486,10 @@ extern 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))
+# if HAVE_RAW_DECL_MKNODAT
+_GL_WARN_ON_USE (mknodat, "mknodat is not portable - "
+                 "use gnulib module mkfifoat for portability");
+# endif
 #endif
 
 
@@ -512,10 +512,10 @@ extern int stat (const char *name, struct stat *buf) _GL_ARG_NONNULL ((1, 2));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef stat
-# define stat(p,b)                                                      \
-  (GL_LINK_WARNING ("stat is unportable - "                             \
-                    "use gnulib module stat for portability"),          \
-   stat (p, b))
+# if HAVE_RAW_DECL_STAT
+_GL_WARN_ON_USE (stat, "stat is unportable - "
+                 "use gnulib module stat for portability");
+# endif
 #endif
 
 
@@ -531,10 +531,10 @@ extern int stat (const char *name, struct stat *buf) _GL_ARG_NONNULL ((1, 2));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef utimensat
-# define utimensat(d,n,t,f)                          \
-    (GL_LINK_WARNING ("utimensat is not portable - " \
-                      "use gnulib module utimensat for portability"), \
-     utimensat (d, n, t, f))
+# if HAVE_RAW_DECL_UTIMENSAT
+_GL_WARN_ON_USE (utimensat, "utimensat is not portable - "
+                 "use gnulib module utimensat for portability");
+# endif
 #endif
 
 
diff --git a/libmissing/sys_time.in.h b/libmissing/sys_time.in.h
index f4befee..544a725 100644
--- a/libmissing/sys_time.in.h
+++ b/libmissing/sys_time.in.h
@@ -1,6 +1,6 @@
 /* Provide a more complete sys/time.h.
 
-   Copyright (C) 2007-2009 Free Software Foundation, Inc.
+   Copyright (C) 2007-2010 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
diff --git a/libmissing/tests/Makefile.am b/libmissing/tests/Makefile.am
index cd188fb..0aaa768 100644
--- a/libmissing/tests/Makefile.am
+++ b/libmissing/tests/Makefile.am
@@ -1,6 +1,6 @@
 ## DO NOT EDIT! GENERATED AUTOMATICALLY!
 ## Process this file with automake to produce Makefile.in.
-# Copyright (C) 2002-2009 Free Software Foundation, Inc.
+# Copyright (C) 2002-2010 Free Software Foundation, Inc.
 #
 # This file is free software, distributed under the terms of the GNU
 # General Public License.  As a special exception to the GNU General
@@ -43,6 +43,8 @@ libtests_a_DEPENDENCIES = $(gltests_LIBOBJS)
 EXTRA_libtests_a_SOURCES =
 AM_LIBTOOLFLAGS = --preserve-dup-deps
 
+TESTS_ENVIRONMENT += EXEEXT='@EXEEXT@' srcdir='$(srcdir)'
+
 ## begin gnulib module alignof-tests
 
 TESTS += test-alignof
@@ -117,7 +119,7 @@ libtests_a_SOURCES += c-strcase.h c-strcasecmp.c c-strncasecmp.c
 ## begin gnulib module c-strcase-tests
 
 TESTS += test-c-strcase.sh
-TESTS_ENVIRONMENT += EXEEXT='@EXEEXT@' LOCALE_FR='@LOCALE_FR@' LOCALE_TR_UTF8='@LOCALE_TR_UTF8@'
+TESTS_ENVIRONMENT += LOCALE_FR='@LOCALE_FR@' LOCALE_TR_UTF8='@LOCALE_TR_UTF8@'
 check_PROGRAMS += test-c-strcasecmp test-c-strncasecmp
 EXTRA_DIST += test-c-strcase.sh test-c-strcasecmp.c test-c-strncasecmp.c macros.h
 
@@ -157,6 +159,14 @@ EXTRA_DIST += signature.h test-getaddrinfo.c
 
 ## end   gnulib module getaddrinfo-tests
 
+## begin gnulib module getlogin_r-tests
+
+TESTS += test-getlogin_r
+check_PROGRAMS += test-getlogin_r
+EXTRA_DIST += test-getlogin_r.c signature.h macros.h
+
+## end   gnulib module getlogin_r-tests
+
 ## begin gnulib module glob-tests
 
 TESTS += test-glob
@@ -199,35 +209,10 @@ EXTRA_DIST += test-langinfo.c
 
 ## end   gnulib module langinfo-tests
 
-## begin gnulib module link-warning
-
-# The BUILT_SOURCES created by this Makefile snippet are not used via #include
-# statements but through direct file reference. Therefore this snippet must be
-# present in all Makefile.am that need it. This is ensured by the applicability
-# 'all' defined above.
-
-BUILT_SOURCES += link-warning.h
-# The link-warning.h that gets inserted into generated .h files is the same as
-# build-aux/link-warning.h, except that it has the copyright header cut off.
-link-warning.h: $(top_srcdir)/./link-warning.h
-	$(AM_V_GEN)rm -f $@-t $@ && \
-	sed -n -e '/GL_LINK_WARNING/,$$p' \
-	  < $(top_srcdir)/./link-warning.h \
-	  > $@-t && \
-	mv $@-t $@
-MOSTLYCLEANFILES += link-warning.h link-warning.h-t
-
-LINK_WARNING_H=link-warning.h
-
-EXTRA_DIST += $(top_srcdir)/./link-warning.h
-
-## end   gnulib module link-warning
-
 ## begin gnulib module mbrtowc-tests
 
 TESTS += test-mbrtowc1.sh test-mbrtowc2.sh test-mbrtowc3.sh test-mbrtowc4.sh
 TESTS_ENVIRONMENT += \
-  EXEEXT='@EXEEXT@' \
   LOCALE_FR='@LOCALE_FR@' \
   LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' \
   LOCALE_JA='@LOCALE_JA@' \
@@ -241,7 +226,7 @@ EXTRA_DIST += test-mbrtowc1.sh test-mbrtowc2.sh test-mbrtowc3.sh test-mbrtowc4.s
 ## begin gnulib module mbsinit-tests
 
 TESTS += test-mbsinit.sh
-TESTS_ENVIRONMENT += EXEEXT='@EXEEXT@' LOCALE_FR_UTF8='@LOCALE_FR_UTF8@'
+TESTS_ENVIRONMENT += LOCALE_FR_UTF8='@LOCALE_FR_UTF8@'
 check_PROGRAMS += test-mbsinit
 
 EXTRA_DIST += test-mbsinit.sh test-mbsinit.c signature.h macros.h
@@ -252,7 +237,6 @@ EXTRA_DIST += test-mbsinit.sh test-mbsinit.c signature.h macros.h
 
 TESTS += test-mbsrtowcs1.sh test-mbsrtowcs2.sh test-mbsrtowcs3.sh test-mbsrtowcs4.sh
 TESTS_ENVIRONMENT += \
-  EXEEXT='@EXEEXT@' \
   LOCALE_FR='@LOCALE_FR@' \
   LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' \
   LOCALE_JA='@LOCALE_JA@' \
@@ -290,7 +274,7 @@ EXTRA_DIST += test-netinet_in.c
 ## begin gnulib module nl_langinfo-tests
 
 TESTS += test-nl_langinfo.sh
-TESTS_ENVIRONMENT += EXEEXT='@EXEEXT@' LOCALE_FR='@LOCALE_FR@' LOCALE_FR_UTF8='@LOCALE_FR_UTF8@'
+TESTS_ENVIRONMENT += LOCALE_FR='@LOCALE_FR@' LOCALE_FR_UTF8='@LOCALE_FR_UTF8@'
 check_PROGRAMS += test-nl_langinfo
 EXTRA_DIST += test-nl_langinfo.sh test-nl_langinfo.c signature.h macros.h
 
@@ -468,6 +452,25 @@ EXTRA_DIST += test-vasnprintf.c macros.h
 
 ## end   gnulib module vasnprintf-tests
 
+## begin gnulib module warn-on-use
+
+BUILT_SOURCES += warn-on-use.h
+# The warn-on-use.h that gets inserted into generated .h files is the same as
+# build-aux/warn-on-use.h, except that it has the copyright header cut off.
+warn-on-use.h: $(top_srcdir)/./warn-on-use.h
+	$(AM_V_GEN)rm -f $@-t $@ && \
+	sed -n -e '/^.ifndef/,$$p' \
+	  < $(top_srcdir)/./warn-on-use.h \
+	  > $@-t && \
+	mv $@-t $@
+MOSTLYCLEANFILES += warn-on-use.h warn-on-use.h-t
+
+WARN_ON_USE_H=warn-on-use.h
+
+EXTRA_DIST += $(top_srcdir)/./warn-on-use.h
+
+## end   gnulib module warn-on-use
+
 ## begin gnulib module wchar-tests
 
 TESTS += test-wchar
diff --git a/libmissing/tests/c-ctype.c b/libmissing/tests/c-ctype.c
index 1442d87..0d8da20 100644
--- a/libmissing/tests/c-ctype.c
+++ b/libmissing/tests/c-ctype.c
@@ -1,6 +1,6 @@
 /* Character handling in C locale.
 
-   Copyright 2000-2003, 2006, 2009 Free Software Foundation, Inc.
+   Copyright 2000-2003, 2006, 2009-2010 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
diff --git a/libmissing/tests/c-ctype.h b/libmissing/tests/c-ctype.h
index 5bcd1b7..0eb27e6 100644
--- a/libmissing/tests/c-ctype.h
+++ b/libmissing/tests/c-ctype.h
@@ -5,7 +5,7 @@
    <ctype.h> functions' behaviour depends on the current locale set via
    setlocale.
 
-   Copyright (C) 2000-2003, 2006, 2008-2009 Free Software Foundation, Inc.
+   Copyright (C) 2000-2003, 2006, 2008-2010 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
diff --git a/libmissing/tests/c-strcase.h b/libmissing/tests/c-strcase.h
index a83573e..802ccfd 100644
--- a/libmissing/tests/c-strcase.h
+++ b/libmissing/tests/c-strcase.h
@@ -1,6 +1,6 @@
 /* Case-insensitive string comparison functions in C locale.
-   Copyright (C) 1995-1996, 2001, 2003, 2005, 2009 Free Software Foundation,
-   Inc.
+   Copyright (C) 1995-1996, 2001, 2003, 2005, 2009-2010 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
diff --git a/libmissing/tests/c-strcasecmp.c b/libmissing/tests/c-strcasecmp.c
index b80302e..5589463 100644
--- a/libmissing/tests/c-strcasecmp.c
+++ b/libmissing/tests/c-strcasecmp.c
@@ -1,5 +1,5 @@
 /* c-strcasecmp.c -- case insensitive string comparator in C locale
-   Copyright (C) 1998-1999, 2005-2006, 2009 Free Software Foundation, Inc.
+   Copyright (C) 1998-1999, 2005-2006, 2009-2010 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
diff --git a/libmissing/tests/c-strncasecmp.c b/libmissing/tests/c-strncasecmp.c
index 2b9b562..ef4dee6 100644
--- a/libmissing/tests/c-strncasecmp.c
+++ b/libmissing/tests/c-strncasecmp.c
@@ -1,5 +1,5 @@
 /* c-strncasecmp.c -- case insensitive string comparator in C locale
-   Copyright (C) 1998-1999, 2005-2006, 2009 Free Software Foundation, Inc.
+   Copyright (C) 1998-1999, 2005-2006, 2009-2010 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
diff --git a/libmissing/tests/intprops.h b/libmissing/tests/intprops.h
index a0f4669..46f4d47 100644
--- a/libmissing/tests/intprops.h
+++ b/libmissing/tests/intprops.h
@@ -1,6 +1,6 @@
 /* intprops.h -- properties of integer types
 
-   Copyright (C) 2001, 2002, 2003, 2004, 2005, 2009 Free Software
+   Copyright (C) 2001, 2002, 2003, 2004, 2005, 2009, 2010 Free Software
    Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
diff --git a/libmissing/tests/macros.h b/libmissing/tests/macros.h
index b29378e..11db5a8 100644
--- a/libmissing/tests/macros.h
+++ b/libmissing/tests/macros.h
@@ -1,5 +1,5 @@
 /* Common macros used by gnulib tests.
-   Copyright (C) 2006-2009 Free Software Foundation, Inc.
+   Copyright (C) 2006-2010 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
diff --git a/libmissing/tests/signature.h b/libmissing/tests/signature.h
index bf1bb86..6e15c43 100644
--- a/libmissing/tests/signature.h
+++ b/libmissing/tests/signature.h
@@ -1,5 +1,5 @@
 /* Macro for checking that a function declaration is compliant.
-   Copyright (C) 2009 Free Software Foundation, Inc.
+   Copyright (C) 2009, 2010 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
diff --git a/libmissing/tests/strerror.c b/libmissing/tests/strerror.c
index fa0ed14..b0df778 100644
--- a/libmissing/tests/strerror.c
+++ b/libmissing/tests/strerror.c
@@ -1,6 +1,6 @@
 /* strerror.c --- POSIX compatible system error routine
 
-   Copyright (C) 2007-2009 Free Software Foundation, Inc.
+   Copyright (C) 2007-2010 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
diff --git a/libmissing/tests/test-alignof.c b/libmissing/tests/test-alignof.c
index d42bdf5..a8b6d18 100644
--- a/libmissing/tests/test-alignof.c
+++ b/libmissing/tests/test-alignof.c
@@ -1,5 +1,5 @@
 /* Test of <alignof.h>.
-   Copyright (C) 2009 Free Software Foundation, Inc.
+   Copyright (C) 2009, 2010 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
diff --git a/libmissing/tests/test-alloca-opt.c b/libmissing/tests/test-alloca-opt.c
index fe10802..cfbecaf 100644
--- a/libmissing/tests/test-alloca-opt.c
+++ b/libmissing/tests/test-alloca-opt.c
@@ -1,5 +1,5 @@
 /* Test of optional automatic memory allocation.
-   Copyright (C) 2005, 2007, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2007, 2009, 2010 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
diff --git a/libmissing/tests/test-arpa_inet.c b/libmissing/tests/test-arpa_inet.c
index 1e2479f..262686a 100644
--- a/libmissing/tests/test-arpa_inet.c
+++ b/libmissing/tests/test-arpa_inet.c
@@ -1,5 +1,5 @@
 /* Test of <arpa/inet.h> substitute.
-   Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009, 2010 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
diff --git a/libmissing/tests/test-c-ctype.c b/libmissing/tests/test-c-ctype.c
index 9580966..ebe594d 100644
--- a/libmissing/tests/test-c-ctype.c
+++ b/libmissing/tests/test-c-ctype.c
@@ -1,5 +1,5 @@
 /* Test of character handling in C locale.
-   Copyright (C) 2005, 2007-2009 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2007-2010 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
diff --git a/libmissing/tests/test-c-strcasecmp.c b/libmissing/tests/test-c-strcasecmp.c
index cfa5e12..84ea9b5 100644
--- a/libmissing/tests/test-c-strcasecmp.c
+++ b/libmissing/tests/test-c-strcasecmp.c
@@ -1,5 +1,5 @@
 /* Test of case-insensitive string comparison function.
-   Copyright (C) 2007-2009 Free Software Foundation, Inc.
+   Copyright (C) 2007-2010 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
diff --git a/libmissing/tests/test-c-strncasecmp.c b/libmissing/tests/test-c-strncasecmp.c
index b993cf9..f02cb2d 100644
--- a/libmissing/tests/test-c-strncasecmp.c
+++ b/libmissing/tests/test-c-strncasecmp.c
@@ -1,5 +1,5 @@
 /* Test of case-insensitive string comparison function.
-   Copyright (C) 2007-2009 Free Software Foundation, Inc.
+   Copyright (C) 2007-2010 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
diff --git a/libmissing/tests/test-dirent.c b/libmissing/tests/test-dirent.c
index 716b201..2c6d1fd 100644
--- a/libmissing/tests/test-dirent.c
+++ b/libmissing/tests/test-dirent.c
@@ -1,5 +1,5 @@
 /* Test of <dirent.h> substitute.
-   Copyright (C) 2009 Free Software Foundation, Inc.
+   Copyright (C) 2009, 2010 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
diff --git a/libmissing/tests/test-errno.c b/libmissing/tests/test-errno.c
index 754ec13..129b236 100644
--- a/libmissing/tests/test-errno.c
+++ b/libmissing/tests/test-errno.c
@@ -1,5 +1,5 @@
 /* Test of <errno.h> substitute.
-   Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2008, 2009, 2010 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
diff --git a/libmissing/tests/test-fnmatch.c b/libmissing/tests/test-fnmatch.c
index 6cd2d8a..a85db70 100644
--- a/libmissing/tests/test-fnmatch.c
+++ b/libmissing/tests/test-fnmatch.c
@@ -1,5 +1,5 @@
 /* Test of fnmatch string matching function.
-   Copyright (C) 2009 Free Software Foundation, Inc.
+   Copyright (C) 2009, 2010 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
diff --git a/libmissing/tests/test-getaddrinfo.c b/libmissing/tests/test-getaddrinfo.c
index a7e2381..bd245b4 100644
--- a/libmissing/tests/test-getaddrinfo.c
+++ b/libmissing/tests/test-getaddrinfo.c
@@ -1,6 +1,6 @@
 /* Test the getaddrinfo module.
 
-   Copyright (C) 2006-2009 Free Software Foundation, Inc.
+   Copyright (C) 2006-2010 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
diff --git a/libmissing/tests/test-getlogin_r.c b/libmissing/tests/test-getlogin_r.c
new file mode 100644
index 0000000..68c6812
--- /dev/null
+++ b/libmissing/tests/test-getlogin_r.c
@@ -0,0 +1,88 @@
+/* Test of getting user name.
+   Copyright (C) 2010 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 Bruno Haible <[email protected]>, 2010.  */
+
+#include <config.h>
+
+#include <unistd.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (getlogin_r, int, (char *, size_t));
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "macros.h"
+
+int
+main (void)
+{
+  /* Test with a large enough buffer.  */
+  char buf[1024];
+
+  if (getlogin_r (buf, sizeof (buf)) != 0)
+    {
+      /* getlogin_r() fails when stdin is not connected to a tty.  */
+      ASSERT (! isatty (0));
+      fprintf (stderr, "Skipping test: stdin is not a tty.\n");
+      return 77;
+    }
+
+  /* Compare against the value from the environment.  */
+#if !((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__)
+  /* Unix platform */
+  {
+    const char *name = getenv ("LOGNAME");
+    if (name == NULL || name[0] == '\0')
+      name = getenv ("USER");
+    if (name != NULL && name[0] != '\0')
+      ASSERT (strcmp (buf, name) == 0);
+  }
+#endif
+#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+  /* Native Windows platform.
+     Note: This test would fail on Cygwin in an ssh session, because sshd
+     sets USERNAME=SYSTEM.  */
+  {
+    const char *name = getenv ("USERNAME");
+    if (name != NULL && name[0] != '\0')
+      ASSERT (strcmp (buf, name) == 0);
+  }
+#endif
+
+  /* Test with a small buffer.  */
+  {
+    char smallbuf[1024];
+    size_t n = strlen (buf);
+    size_t i;
+
+    for (i = 0; i <= n; i++)
+      ASSERT (getlogin_r (smallbuf, i) == ERANGE);
+  }
+
+  /* Test with a huge buffer.  */
+  {
+    static char hugebuf[70000];
+
+    ASSERT (getlogin_r (hugebuf, sizeof (hugebuf)) == 0);
+    ASSERT (strcmp (hugebuf, buf) == 0);
+  }
+
+  return 0;
+}
diff --git a/libmissing/tests/test-glob.c b/libmissing/tests/test-glob.c
index f8d132e..ab2d531 100644
--- a/libmissing/tests/test-glob.c
+++ b/libmissing/tests/test-glob.c
@@ -1,5 +1,5 @@
 /* Test of glob/globfree functions.
-   Copyright (C) 2009 Free Software Foundation, Inc.
+   Copyright (C) 2009, 2010 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
diff --git a/libmissing/tests/test-iconv.c b/libmissing/tests/test-iconv.c
index 66db918..cf00ac8 100644
--- a/libmissing/tests/test-iconv.c
+++ b/libmissing/tests/test-iconv.c
@@ -1,5 +1,5 @@
 /* Test of character set conversion.
-   Copyright (C) 2007-2009 Free Software Foundation, Inc.
+   Copyright (C) 2007-2010 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
diff --git a/libmissing/tests/test-inet_ntop.c b/libmissing/tests/test-inet_ntop.c
index d424b72..d3b045c 100644
--- a/libmissing/tests/test-inet_ntop.c
+++ b/libmissing/tests/test-inet_ntop.c
@@ -1,5 +1,5 @@
 /* Test of inet_ntop function.
-   Copyright (C) 2009 Free Software Foundation, Inc.
+   Copyright (C) 2009, 2010 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
diff --git a/libmissing/tests/test-langinfo.c b/libmissing/tests/test-langinfo.c
index 9f0608f..7547f3b 100644
--- a/libmissing/tests/test-langinfo.c
+++ b/libmissing/tests/test-langinfo.c
@@ -1,5 +1,5 @@
 /* Test of <langinfo.h> substitute.
-   Copyright (C) 2009 Free Software Foundation, Inc.
+   Copyright (C) 2009, 2010 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
diff --git a/libmissing/tests/test-mbrtowc.c b/libmissing/tests/test-mbrtowc.c
index d84bafe..5477677 100644
--- a/libmissing/tests/test-mbrtowc.c
+++ b/libmissing/tests/test-mbrtowc.c
@@ -1,5 +1,5 @@
 /* Test of conversion of multibyte character to wide character.
-   Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2008, 2009, 2010 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
diff --git a/libmissing/tests/test-mbsinit.c b/libmissing/tests/test-mbsinit.c
index e72086d..4ca0fc3 100644
--- a/libmissing/tests/test-mbsinit.c
+++ b/libmissing/tests/test-mbsinit.c
@@ -1,5 +1,5 @@
 /* Test of test for initial conversion state.
-   Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2008, 2009, 2010 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
diff --git a/libmissing/tests/test-mbsrtowcs.c b/libmissing/tests/test-mbsrtowcs.c
index 4447f2c..85d9e1a 100644
--- a/libmissing/tests/test-mbsrtowcs.c
+++ b/libmissing/tests/test-mbsrtowcs.c
@@ -1,5 +1,5 @@
 /* Test of conversion of string to wide string.
-   Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2008, 2009, 2010 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
diff --git a/libmissing/tests/test-memchr.c b/libmissing/tests/test-memchr.c
index 5d31e76..a801614 100644
--- a/libmissing/tests/test-memchr.c
+++ b/libmissing/tests/test-memchr.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2008-2009 Free Software Foundation
+ * Copyright (C) 2008-2010 Free Software Foundation, Inc.
  * Written by Eric Blake and Bruno Haible
  *
  * This program is free software: you can redistribute it and/or modify
diff --git a/libmissing/tests/test-netdb.c b/libmissing/tests/test-netdb.c
index 9202c74..5f2bcd4 100644
--- a/libmissing/tests/test-netdb.c
+++ b/libmissing/tests/test-netdb.c
@@ -1,5 +1,5 @@
 /* Test of <netdb.h> substitute.
-   Copyright (C) 2007-2009 Free Software Foundation, Inc.
+   Copyright (C) 2007-2010 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
diff --git a/libmissing/tests/test-netinet_in.c b/libmissing/tests/test-netinet_in.c
index 5a61557..af403ed 100644
--- a/libmissing/tests/test-netinet_in.c
+++ b/libmissing/tests/test-netinet_in.c
@@ -1,5 +1,5 @@
 /* Test of <netinet/in.h> substitute.
-   Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009, 2010 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
diff --git a/libmissing/tests/test-nl_langinfo.c b/libmissing/tests/test-nl_langinfo.c
index 4a79b50..ec89b3f 100644
--- a/libmissing/tests/test-nl_langinfo.c
+++ b/libmissing/tests/test-nl_langinfo.c
@@ -1,5 +1,5 @@
 /* Test of nl_langinfo replacement.
-   Copyright (C) 2009 Free Software Foundation, Inc.
+   Copyright (C) 2009, 2010 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
diff --git a/libmissing/tests/test-sigaction.c b/libmissing/tests/test-sigaction.c
index d219f02..73579d9 100644
--- a/libmissing/tests/test-sigaction.c
+++ b/libmissing/tests/test-sigaction.c
@@ -1,5 +1,5 @@
 /* Test of sigaction() function.
-   Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2008, 2009, 2010 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
diff --git a/libmissing/tests/test-signal.c b/libmissing/tests/test-signal.c
index 5154f4e..e4258d3 100644
--- a/libmissing/tests/test-signal.c
+++ b/libmissing/tests/test-signal.c
@@ -1,5 +1,5 @@
 /* Test of <signal.h> substitute.
-   Copyright (C) 2009 Free Software Foundation, Inc.
+   Copyright (C) 2009, 2010 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,10 +20,106 @@
 
 #include <signal.h>
 
-volatile sig_atomic_t s;
+/* Check for required types.  */
+struct
+{
+  size_t a;
+  uid_t b;
+  volatile sig_atomic_t c;
+  sigset_t d;
+  pid_t e;
+#if 0
+  /* Not guaranteed by gnulib.  */
+  pthread_t f;
+  struct timespec g;
+#endif
+} s;
 
 int
 main (void)
 {
-  return s;
+  switch (0)
+    {
+      /* The following are guaranteed by C.  */
+    case 0:
+    case SIGABRT:
+    case SIGFPE:
+    case SIGILL:
+    case SIGINT:
+    case SIGSEGV:
+    case SIGTERM:
+      /* The following is guaranteed by gnulib.  */
+#if GNULIB_SIGPIPE || defined SIGPIPE
+    case SIGPIPE:
+#endif
+      /* Ensure no conflict with other standardized names.  */
+#ifdef SIGALRM
+    case SIGALRM:
+#endif
+#ifdef SIGBUS
+    case SIGBUS:
+#endif
+#ifdef SIGCHLD
+    case SIGCHLD:
+#endif
+#ifdef SIGCONT
+    case SIGCONT:
+#endif
+#ifdef SIGHUP
+    case SIGHUP:
+#endif
+#ifdef SIGKILL
+    case SIGKILL:
+#endif
+#ifdef SIGQUIT
+    case SIGQUIT:
+#endif
+#ifdef SIGSTOP
+    case SIGSTOP:
+#endif
+#ifdef SIGTSTP
+    case SIGTSTP:
+#endif
+#ifdef SIGTTIN
+    case SIGTTIN:
+#endif
+#ifdef SIGTTOU
+    case SIGTTOU:
+#endif
+#ifdef SIGUSR1
+    case SIGUSR1:
+#endif
+#ifdef SIGUSR2
+    case SIGUSR2:
+#endif
+#ifdef SIGSYS
+    case SIGSYS:
+#endif
+#ifdef SIGTRAP
+    case SIGTRAP:
+#endif
+#ifdef SIGURG
+    case SIGURG:
+#endif
+#ifdef SIGVTALRM
+    case SIGVTALRM:
+#endif
+#ifdef SIGXCPU
+    case SIGXCPU:
+#endif
+#ifdef SIGXFSZ
+    case SIGXFSZ:
+#endif
+      /* SIGRTMIN and SIGRTMAX need not be compile-time constants.  */
+#if 0
+# ifdef SIGRTMIN
+    case SIGRTMIN:
+# endif
+# ifdef SIGRTMAX
+    case SIGRTMAX:
+# endif
+#endif
+      ;
+    }
+  return s.a + s.b + s.c + s.e;
 }
diff --git a/libmissing/tests/test-sleep.c b/libmissing/tests/test-sleep.c
index 3bb2de6..6878ccf 100644
--- a/libmissing/tests/test-sleep.c
+++ b/libmissing/tests/test-sleep.c
@@ -1,5 +1,5 @@
 /* Test of sleep() function.
-   Copyright (C) 2007-2009 Free Software Foundation, Inc.
+   Copyright (C) 2007-2010 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
diff --git a/libmissing/tests/test-snprintf.c b/libmissing/tests/test-snprintf.c
index 3780786..62a411b 100644
--- a/libmissing/tests/test-snprintf.c
+++ b/libmissing/tests/test-snprintf.c
@@ -1,5 +1,5 @@
 /* Test of snprintf() function.
-   Copyright (C) 2007-2009 Free Software Foundation, Inc.
+   Copyright (C) 2007-2010 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
diff --git a/libmissing/tests/test-sockets.c b/libmissing/tests/test-sockets.c
index 2d25964..ab5460a 100644
--- a/libmissing/tests/test-sockets.c
+++ b/libmissing/tests/test-sockets.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2008, 2009 Free Software Foundation
+ * Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
  * Written by Simon Josefsson.
  *
  * This program is free software: you can redistribute it and/or modify
diff --git a/libmissing/tests/test-stdbool.c b/libmissing/tests/test-stdbool.c
index 360375c..560e0e5 100644
--- a/libmissing/tests/test-stdbool.c
+++ b/libmissing/tests/test-stdbool.c
@@ -1,5 +1,5 @@
 /* Test of <stdbool.h> substitute.
-   Copyright (C) 2002-2007, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2002-2007, 2009-2010 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
diff --git a/libmissing/tests/test-stddef.c b/libmissing/tests/test-stddef.c
index c0a7515..d047e57 100644
--- a/libmissing/tests/test-stddef.c
+++ b/libmissing/tests/test-stddef.c
@@ -1,5 +1,5 @@
 /* Test of <stddef.h> substitute.
-   Copyright (C) 2009 Free Software Foundation, Inc.
+   Copyright (C) 2009, 2010 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
diff --git a/libmissing/tests/test-stdint.c b/libmissing/tests/test-stdint.c
index 4e9b362..9cec2e2 100644
--- a/libmissing/tests/test-stdint.c
+++ b/libmissing/tests/test-stdint.c
@@ -1,5 +1,5 @@
 /* Test of <stdint.h> substitute.
-   Copyright (C) 2006-2009 Free Software Foundation, Inc.
+   Copyright (C) 2006-2010 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
diff --git a/libmissing/tests/test-stdio.c b/libmissing/tests/test-stdio.c
index 3f2f067..8710057 100644
--- a/libmissing/tests/test-stdio.c
+++ b/libmissing/tests/test-stdio.c
@@ -1,5 +1,5 @@
 /* Test of <stdio.h> substitute.
-   Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2010 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
@@ -29,6 +29,13 @@ int sk[] = { SEEK_CUR, SEEK_END, SEEK_SET };
    per POSIX 2008.  */
 verify (sizeof NULL == sizeof (void *));
 
+/* Check that the types are all defined.  */
+fpos_t t1;
+off_t t2;
+size_t t3;
+ssize_t t4;
+va_list t5;
+
 int
 main (void)
 {
diff --git a/libmissing/tests/test-stdlib.c b/libmissing/tests/test-stdlib.c
index fad5cf4..4bd8715 100644
--- a/libmissing/tests/test-stdlib.c
+++ b/libmissing/tests/test-stdlib.c
@@ -1,5 +1,5 @@
 /* Test of <stdlib.h> substitute.
-   Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009, 2010 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
diff --git a/libmissing/tests/test-strerror.c b/libmissing/tests/test-strerror.c
index 99c3c5f..11ab7e3 100644
--- a/libmissing/tests/test-strerror.c
+++ b/libmissing/tests/test-strerror.c
@@ -1,5 +1,5 @@
 /* Test of strerror() function.
-   Copyright (C) 2007-2009 Free Software Foundation, Inc.
+   Copyright (C) 2007-2010 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
diff --git a/libmissing/tests/test-string.c b/libmissing/tests/test-string.c
index 69df747..019a817 100644
--- a/libmissing/tests/test-string.c
+++ b/libmissing/tests/test-string.c
@@ -1,5 +1,5 @@
 /* Test of <string.h> substitute.
-   Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009, 2010 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
diff --git a/libmissing/tests/test-strings.c b/libmissing/tests/test-strings.c
index 2a09475..caba95c 100644
--- a/libmissing/tests/test-strings.c
+++ b/libmissing/tests/test-strings.c
@@ -1,5 +1,5 @@
 /* Test of <strings.h> substitute.
-   Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009, 2010 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
diff --git a/libmissing/tests/test-sys_select.c b/libmissing/tests/test-sys_select.c
index aef8941..3a06c64 100644
--- a/libmissing/tests/test-sys_select.c
+++ b/libmissing/tests/test-sys_select.c
@@ -1,5 +1,5 @@
 /* Test of <sys/select.h> substitute.
-   Copyright (C) 2007-2009 Free Software Foundation, Inc.
+   Copyright (C) 2007-2010 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
diff --git a/libmissing/tests/test-sys_socket.c b/libmissing/tests/test-sys_socket.c
index 606708d..badf308 100644
--- a/libmissing/tests/test-sys_socket.c
+++ b/libmissing/tests/test-sys_socket.c
@@ -1,5 +1,5 @@
 /* Test of <sys/socket.h> substitute.
-   Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009, 2010 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
diff --git a/libmissing/tests/test-sys_stat.c b/libmissing/tests/test-sys_stat.c
index 4a85c9f..5f1aacd 100644
--- a/libmissing/tests/test-sys_stat.c
+++ b/libmissing/tests/test-sys_stat.c
@@ -1,5 +1,5 @@
 /* Test of <sys/stat.h> substitute.
-   Copyright (C) 2007-2009 Free Software Foundation, Inc.
+   Copyright (C) 2007-2010 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
diff --git a/libmissing/tests/test-sys_time.c b/libmissing/tests/test-sys_time.c
index 74f35ac..2ab849e 100644
--- a/libmissing/tests/test-sys_time.c
+++ b/libmissing/tests/test-sys_time.c
@@ -1,5 +1,5 @@
 /* Test of <sys/time.h> substitute.
-   Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009, 2010 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
diff --git a/libmissing/tests/test-time.c b/libmissing/tests/test-time.c
index 4afa3b3..8e250bd 100644
--- a/libmissing/tests/test-time.c
+++ b/libmissing/tests/test-time.c
@@ -1,5 +1,5 @@
 /* Test of <time.h> substitute.
-   Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009, 2010 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
diff --git a/libmissing/tests/test-unistd.c b/libmissing/tests/test-unistd.c
index dd907f4..ec02eee 100644
--- a/libmissing/tests/test-unistd.c
+++ b/libmissing/tests/test-unistd.c
@@ -1,5 +1,5 @@
 /* Test of <unistd.h> substitute.
-   Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009, 2010 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
diff --git a/libmissing/tests/test-vasnprintf.c b/libmissing/tests/test-vasnprintf.c
index 2f7f0db..e283142 100644
--- a/libmissing/tests/test-vasnprintf.c
+++ b/libmissing/tests/test-vasnprintf.c
@@ -1,5 +1,5 @@
 /* Test of vasnprintf() and asnprintf() functions.
-   Copyright (C) 2007-2009 Free Software Foundation, Inc.
+   Copyright (C) 2007-2010 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
diff --git a/libmissing/tests/test-wchar.c b/libmissing/tests/test-wchar.c
index 2e60bb8..2a03d6b 100644
--- a/libmissing/tests/test-wchar.c
+++ b/libmissing/tests/test-wchar.c
@@ -1,5 +1,5 @@
 /* Test of <wchar.h> substitute.
-   Copyright (C) 2007-2009 Free Software Foundation, Inc.
+   Copyright (C) 2007-2010 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
diff --git a/libmissing/tests/test-wctype.c b/libmissing/tests/test-wctype.c
index fd801d1..49d7cfa 100644
--- a/libmissing/tests/test-wctype.c
+++ b/libmissing/tests/test-wctype.c
@@ -1,5 +1,5 @@
 /* Test of <wctype.h> substitute.
-   Copyright (C) 2007-2009 Free Software Foundation, Inc.
+   Copyright (C) 2007-2010 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
diff --git a/libmissing/tests/wctob.c b/libmissing/tests/wctob.c
index c8381db..1d1cc7b 100644
--- a/libmissing/tests/wctob.c
+++ b/libmissing/tests/wctob.c
@@ -1,5 +1,5 @@
 /* Convert wide character to unibyte character.
-   Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
    Written by Bruno Haible <[email protected]>, 2008.
 
    This program is free software: you can redistribute it and/or modify
diff --git a/libmissing/tests/zerosize-ptr.h b/libmissing/tests/zerosize-ptr.h
index 399d019..cfab200 100644
--- a/libmissing/tests/zerosize-ptr.h
+++ b/libmissing/tests/zerosize-ptr.h
@@ -1,5 +1,5 @@
 /* Return a pointer to a zero-size object in memory.
-   Copyright (C) 2009 Free Software Foundation, Inc.
+   Copyright (C) 2009, 2010 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
diff --git a/libmissing/time.in.h b/libmissing/time.in.h
index eb35cc2..e5f1a38 100644
--- a/libmissing/time.in.h
+++ b/libmissing/time.in.h
@@ -1,6 +1,6 @@
 /* A more-standard <time.h>.
 
-   Copyright (C) 2007-2009 Free Software Foundation, Inc.
+   Copyright (C) 2007-2010 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
diff --git a/libmissing/time_r.c b/libmissing/time_r.c
index 08579c3..a4f2b4d 100644
--- a/libmissing/time_r.c
+++ b/libmissing/time_r.c
@@ -1,6 +1,6 @@
 /* Reentrant time functions like localtime_r.
 
-   Copyright (C) 2003, 2006, 2007, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
diff --git a/libmissing/unistd.in.h b/libmissing/unistd.in.h
index 0796dfd..3257251 100644
--- a/libmissing/unistd.in.h
+++ b/libmissing/unistd.in.h
@@ -1,5 +1,5 @@
 /* Substitute for and wrapper around <unistd.h>.
-   Copyright (C) 2003-2009 Free Software Foundation, Inc.
+   Copyright (C) 2003-2010 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
@@ -61,10 +61,8 @@
 # include <io.h>
 #endif
 
-#if ((@GNULIB_WRITE@ && @REPLACE_WRITE@ && @GNULIB_UNISTD_H_SIGPIPE@)   \
-     || (@GNULIB_READLINK@ && (!@HAVE_READLINK@ || @REPLACE_READLINK@)) \
-     || (@GNULIB_READLINKAT@ && !@HAVE_READLINKAT@) \
-     || defined GNULIB_POSIXCHECK)
+#if (@GNULIB_WRITE@ || @GNULIB_READLINK@ || @GNULIB_READLINKAT@ \
+     || @GNULIB_PREAD@ || defined GNULIB_POSIXCHECK)
 /* Get ssize_t.  */
 # include <sys/types.h>
 #endif
@@ -116,10 +114,10 @@
 # endif
 #endif
 
-/* The definition of GL_LINK_WARNING is copied here.  */
-
 /* The definition of _GL_ARG_NONNULL is copied here.  */
 
+/* The definition of _GL_WARN_ON_USE is copied here.  */
+
 
 /* OS/2 EMX lacks these macros.  */
 #ifndef STDIN_FILENO
@@ -164,11 +162,11 @@ extern int chown (const char *file, uid_t uid, gid_t gid)
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef chown
-# define chown(f,u,g) \
-    (GL_LINK_WARNING ("chown fails to follow symlinks on some systems and " \
-                      "doesn't treat a uid or gid of -1 on some systems - " \
-                      "use gnulib module chown for portability"), \
-     chown (f, u, g))
+# if HAVE_RAW_DECL_CHOWN
+_GL_WARN_ON_USE (chown, "chown fails to follow symlinks on some systems and "
+                 "doesn't treat a uid or gid of -1 on some systems - "
+                 "use gnulib module chown for portability");
+# endif
 #endif
 
 
@@ -184,10 +182,9 @@ extern int close (int);
 # define close close_used_without_requesting_gnulib_module_close
 #elif defined GNULIB_POSIXCHECK
 # undef close
-# define close(f) \
-    (GL_LINK_WARNING ("close does not portably work on sockets - " \
-                      "use gnulib module close for portability"), \
-     close (f))
+/* Assume close is always declared.  */
+_GL_WARN_ON_USE (close, "close does not portably work on sockets - "
+                 "use gnulib module close for portability");
 #endif
 
 
@@ -211,10 +208,10 @@ extern int dup2 (int oldfd, int newfd);
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef dup2
-# define dup2(o,n) \
-    (GL_LINK_WARNING ("dup2 is unportable - " \
-                      "use gnulib module dup2 for portability"), \
-     dup2 (o, n))
+# if HAVE_RAW_DECL_DUP2
+_GL_WARN_ON_USE (dup2, "dup2 is unportable - "
+                 "use gnulib module dup2 for portability");
+# endif
 #endif
 
 
@@ -233,10 +230,10 @@ extern int dup2 (int oldfd, int newfd);
 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))
+# if HAVE_RAW_DECL_DUP3
+_GL_WARN_ON_USE (dup3, "dup3 is unportable - "
+                 "use gnulib module dup3 for portability");
+# endif
 #endif
 
 
@@ -252,11 +249,17 @@ extern char **environ;
 #  endif
 # endif
 #elif defined GNULIB_POSIXCHECK
-# undef environ
-# define environ \
-    (GL_LINK_WARNING ("environ is unportable - " \
-                      "use gnulib module environ for portability"), \
-     environ)
+# if HAVE_RAW_DECL_ENVIRON
+static inline char ***
+rpl_environ (void)
+{
+  return &environ;
+}
+_GL_WARN_ON_USE (rpl_environ, "environ is unportable - "
+                 "use gnulib module environ for portability");
+#  undef environ
+#  define environ (*rpl_environ ())
+# endif
 #endif
 
 
@@ -268,10 +271,10 @@ extern int euidaccess (const char *filename, int mode) _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef euidaccess
-# define euidaccess(f,m) \
-    (GL_LINK_WARNING ("euidaccess is unportable - " \
-                      "use gnulib module euidaccess for portability"), \
-     euidaccess (f, m))
+# if HAVE_RAW_DECL_EUIDACCESS
+_GL_WARN_ON_USE (euidaccess, "euidaccess is unportable - "
+                 "use gnulib module euidaccess for portability");
+# endif
 #endif
 
 
@@ -282,10 +285,10 @@ extern 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))
+# if HAVE_RAW_DECL_FACCESSAT
+_GL_WARN_ON_USE (faccessat, "faccessat is not portable - "
+                 "use gnulib module faccessat for portability");
+# endif
 #endif
 
 
@@ -308,10 +311,10 @@ extern const char *_gl_directory_name (int fd);
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef fchdir
-# define fchdir(f) \
-    (GL_LINK_WARNING ("fchdir is unportable - " \
-                      "use gnulib module fchdir for portability"), \
-     fchdir (f))
+# if HAVE_RAW_DECL_FCHDIR
+_GL_WARN_ON_USE (fchdir, "fchdir is unportable - "
+                 "use gnulib module fchdir for portability");
+# endif
 #endif
 
 
@@ -326,10 +329,10 @@ extern int fchownat (int fd, char const *file, uid_t owner, gid_t group, int fla
 # 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))
+# if HAVE_RAW_DECL_FCHOWNAT
+_GL_WARN_ON_USE (fchownat, "fchownat is not portable - "
+                 "use gnulib module openat for portability");
+# endif
 #endif
 
 
@@ -343,10 +346,10 @@ extern int fsync (int fd);
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef fsync
-# define fsync(fd) \
-    (GL_LINK_WARNING ("fsync is unportable - " \
-                      "use gnulib module fsync for portability"), \
-     fsync (fd))
+# if HAVE_RAW_DECL_FSYNC
+_GL_WARN_ON_USE (fsync, "fsync is unportable - "
+                 "use gnulib module fsync for portability");
+# endif
 #endif
 
 
@@ -360,10 +363,10 @@ extern int ftruncate (int fd, off_t length);
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef ftruncate
-# define ftruncate(f,l) \
-    (GL_LINK_WARNING ("ftruncate is unportable - " \
-                      "use gnulib module ftruncate for portability"), \
-     ftruncate (f, l))
+# if HAVE_RAW_DECL_FTRUNCATE
+_GL_WARN_ON_USE (ftruncate, "ftruncate is unportable - "
+                 "use gnulib module ftruncate for portability");
+# endif
 #endif
 
 
@@ -384,10 +387,10 @@ extern char * getcwd (char *buf, size_t size);
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef getcwd
-# define getcwd(b,s) \
-    (GL_LINK_WARNING ("getcwd is unportable - " \
-                      "use gnulib module getcwd for portability"), \
-     getcwd (b, s))
+# if HAVE_RAW_DECL_GETCWD
+_GL_WARN_ON_USE (getcwd, "getcwd is unportable - "
+                 "use gnulib module getcwd for portability");
+# endif
 #endif
 
 
@@ -407,10 +410,10 @@ extern int getdomainname(char *name, size_t len) _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef getdomainname
-# define getdomainname(n,l) \
-    (GL_LINK_WARNING ("getdomainname is unportable - " \
-                      "use gnulib module getdomainname for portability"), \
-     getdomainname (n, l))
+# if HAVE_RAW_DECL_GETDOMAINNAME
+_GL_WARN_ON_USE (getdomainname, "getdomainname is unportable - "
+                 "use gnulib module getdomainname for portability");
+# endif
 #endif
 
 
@@ -422,10 +425,10 @@ extern int getdtablesize (void);
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef getdtablesize
-# define getdtablesize() \
-    (GL_LINK_WARNING ("getdtablesize is unportable - " \
-                      "use gnulib module getdtablesize for portability"), \
-     getdtablesize ())
+# if HAVE_RAW_DECL_GETDTABLESIZE
+_GL_WARN_ON_USE (getdtablesize, "getdtablesize is unportable - "
+                 "use gnulib module getdtablesize for portability");
+# endif
 #endif
 
 
@@ -444,10 +447,10 @@ int getgroups (int n, gid_t *groups);
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef getgroups
-# define getgroups(n,g)                                                 \
-    (GL_LINK_WARNING ("getgroups is unportable - "                      \
-                      "use gnulib module getgroups for portability"),   \
-     getgroups (n, g))
+# if HAVE_RAW_DECL_GETGROUPS
+_GL_WARN_ON_USE (getgroups, "getgroups is unportable - "
+                 "use gnulib module getgroups for portability");
+# endif
 #endif
 
 
@@ -471,10 +474,33 @@ extern int gethostname(char *name, size_t len) _GL_ARG_NONNULL ((1));
 # define gethostname gethostname_used_without_requesting_gnulib_module_gethostname
 #elif defined GNULIB_POSIXCHECK
 # undef gethostname
-# define gethostname(n,l) \
-    (GL_LINK_WARNING ("gethostname is unportable - " \
-                      "use gnulib module gethostname for portability"), \
-     gethostname (n, l))
+# if HAVE_RAW_DECL_GETHOSTNAME
+_GL_WARN_ON_USE (gethostname, "gethostname is unportable - "
+                 "use gnulib module gethostname for portability");
+# endif
+#endif
+
+
+#if @GNULIB_GETLOGIN@
+/* Returns the user's login name, or NULL if it cannot be found.  Upon error,
+   returns NULL with errno set.
+
+   See <http://www.opengroup.org/susv3xsh/getlogin.html>.
+
+   Most programs don't need to use this function, because the information is
+   available through environment variables:
+     ${LOGNAME-$USER}        on Unix platforms,
+     $USERNAME               on native Windows platforms.
+ */
+# if !@HAVE_GETLOGIN@
+extern char *getlogin (void);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef getlogin
+# if HAVE_RAW_DECL_GETLOGIN
+_GL_WARN_ON_USE (getlogin, "getlogin is unportable - "
+                 "use gnulib module getlogin for portability");
+# endif
 #endif
 
 
@@ -487,16 +513,21 @@ extern int gethostname(char *name, size_t len) _GL_ARG_NONNULL ((1));
    provided (this case is hopefully rare but is left open by the POSIX spec).
 
    See <http://www.opengroup.org/susv3xsh/getlogin.html>.
+
+   Most programs don't need to use this function, because the information is
+   available through environment variables:
+     ${LOGNAME-$USER}        on Unix platforms,
+     $USERNAME               on native Windows platforms.
  */
 # if !@HAVE_DECL_GETLOGIN_R@
 extern int getlogin_r (char *name, size_t size) _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef getlogin_r
-# define getlogin_r(n,s) \
-    (GL_LINK_WARNING ("getlogin_r is unportable - " \
-                      "use gnulib module getlogin_r for portability"), \
-     getlogin_r (n, s))
+# if HAVE_RAW_DECL_GETLOGIN_R
+_GL_WARN_ON_USE (getlogin_r, "getlogin_r is unportable - "
+                 "use gnulib module getlogin_r for portability");
+# endif
 #endif
 
 
@@ -551,10 +582,10 @@ extern int getpagesize (void);
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef getpagesize
-# define getpagesize() \
-    (GL_LINK_WARNING ("getpagesize is unportable - " \
-                      "use gnulib module getpagesize for portability"), \
-     getpagesize ())
+# if HAVE_RAW_DECL_GETPAGESIZE
+_GL_WARN_ON_USE (getpagesize, "getpagesize is unportable - "
+                 "use gnulib module getpagesize for portability");
+# endif
 #endif
 
 
@@ -571,20 +602,20 @@ extern void endusershell (void);
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef getusershell
-# define getusershell() \
-    (GL_LINK_WARNING ("getusershell is unportable - " \
-                      "use gnulib module getusershell for portability"), \
-     getusershell ())
+# if HAVE_RAW_DECL_GETUSERSHELL
+_GL_WARN_ON_USE (getusershell, "getusershell is unportable - "
+                 "use gnulib module getusershell for portability");
+# endif
 # undef setusershell
-# define setusershell() \
-    (GL_LINK_WARNING ("setusershell is unportable - " \
-                      "use gnulib module getusershell for portability"), \
-     setusershell ())
+# if HAVE_RAW_DECL_SETUSERSHELL
+_GL_WARN_ON_USE (setusershell, "setusershell is unportable - "
+                 "use gnulib module getusershell for portability");
+# endif
 # undef endusershell
-# define endusershell() \
-    (GL_LINK_WARNING ("endusershell is unportable - " \
-                      "use gnulib module getusershell for portability"), \
-     endusershell ())
+# if HAVE_RAW_DECL_ENDUSERSHELL
+_GL_WARN_ON_USE (endusershell, "endusershell is unportable - "
+                 "use gnulib module getusershell for portability");
+# endif
 #endif
 
 
@@ -604,10 +635,10 @@ extern int lchown (char const *file, uid_t owner, gid_t group)
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef lchown
-# define lchown(f,u,g) \
-    (GL_LINK_WARNING ("lchown is unportable to pre-POSIX.1-2001 " \
-                      "systems - use gnulib module lchown for portability"), \
-     lchown (f, u, g))
+# if HAVE_RAW_DECL_LCHOWN
+_GL_WARN_ON_USE (lchown, "lchown is unportable to pre-POSIX.1-2001 systems - "
+                 "use gnulib module lchown for portability");
+# endif
 #endif
 
 
@@ -625,10 +656,10 @@ extern int link (const char *path1, const char *path2)
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef link
-# define link(path1,path2) \
-    (GL_LINK_WARNING ("link is unportable - " \
-                      "use gnulib module link for portability"), \
-     link (path1, path2))
+# if HAVE_RAW_DECL_LINK
+_GL_WARN_ON_USE (link, "link is unportable - "
+                 "use gnulib module link for portability");
+# endif
 #endif
 
 #if @GNULIB_LINKAT@
@@ -646,10 +677,10 @@ extern int linkat (int fd1, const char *path1, int fd2, const char *path2,
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef linkat
-# define link(f1,path1,f2,path2,f)              \
-    (GL_LINK_WARNING ("linkat is unportable - " \
-                      "use gnulib module linkat for portability"), \
-     linkat (f1, path1, f2, path2,f))
+# if HAVE_RAW_DECL_LINKAT
+_GL_WARN_ON_USE (linkat, "linkat is unportable - "
+                 "use gnulib module linkat for portability");
+# endif
 #endif
 
 #if @GNULIB_LSEEK@
@@ -663,10 +694,10 @@ extern int linkat (int fd1, const char *path1, int fd2, const char *path2,
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef lseek
-# define lseek(f,o,w) \
-    (GL_LINK_WARNING ("lseek does not fail with ESPIPE on pipes on some " \
-                      "systems - use gnulib module lseek for portability"), \
-     lseek (f, o, w))
+# if HAVE_RAW_DECL_LSEEK
+_GL_WARN_ON_USE (lseek, "lseek does not fail with ESPIPE on pipes on some "
+                 "systems - use gnulib module lseek for portability");
+# endif
 #endif
 
 
@@ -685,10 +716,10 @@ extern int linkat (int fd1, const char *path1, int fd2, const char *path2,
 extern int pipe2 (int fd[2], int flags) _GL_ARG_NONNULL ((1));
 #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))
+# if HAVE_RAW_DECL_PIPE2
+_GL_WARN_ON_USE (pipe2, "pipe2 is unportable - "
+                 "use gnulib module pipe2 for portability");
+# endif
 #endif
 
 
@@ -706,10 +737,10 @@ extern int pipe2 (int fd[2], int flags) _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef pread
-# define pread(f,b,s,o)                        \
-    (GL_LINK_WARNING ("pread is unportable - " \
-                      "use gnulib module pread for portability"), \
-     pread (f, b, s, o))
+# if HAVE_RAW_DECL_PREAD
+_GL_WARN_ON_USE (pread, "pread is unportable - "
+                 "use gnulib module pread for portability");
+# endif
 #endif
 
 
@@ -728,10 +759,10 @@ extern ssize_t readlink (const char *file, char *buf, size_t bufsize)
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef readlink
-# define readlink(f,b,s) \
-    (GL_LINK_WARNING ("readlink is unportable - " \
-                      "use gnulib module readlink for portability"), \
-     readlink (f, b, s))
+# if HAVE_RAW_DECL_READLINK
+_GL_WARN_ON_USE (readlink, "readlink is unportable - "
+                 "use gnulib module readlink for portability");
+# endif
 #endif
 
 
@@ -742,10 +773,10 @@ extern 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))
+# if HAVE_RAW_DECL_READLINKAT
+_GL_WARN_ON_USE (readlinkat, "readlinkat is not portable - "
+                 "use gnulib module symlinkat for portability");
+# endif
 #endif
 
 
@@ -757,10 +788,10 @@ extern int rmdir (char const *name) _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef rmdir
-# define rmdir(n) \
-    (GL_LINK_WARNING ("rmdir is unportable - " \
-                      "use gnulib module rmdir for portability"), \
-     rmdir (n))
+# if HAVE_RAW_DECL_RMDIR
+_GL_WARN_ON_USE (rmdir, "rmdir is unportable - "
+                 "use gnulib module rmdir for portability");
+# endif
 #endif
 
 
@@ -778,10 +809,10 @@ extern unsigned int sleep (unsigned int n);
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef sleep
-# define sleep(n) \
-    (GL_LINK_WARNING ("sleep is unportable - " \
-                      "use gnulib module sleep for portability"), \
-     sleep (n))
+# if HAVE_RAW_DECL_SLEEP
+_GL_WARN_ON_USE (sleep, "sleep is unportable - "
+                 "use gnulib module sleep for portability");
+# endif
 #endif
 
 
@@ -796,10 +827,10 @@ extern int symlink (char const *contents, char const *file)
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef symlink
-# define symlink(c,n)                        \
-    (GL_LINK_WARNING ("symlink is not portable - " \
-                      "use gnulib module symlink for portability"), \
-     symlink (c, n))
+# if HAVE_RAW_DECL_SYMLINK
+_GL_WARN_ON_USE (symlink, "symlink is not portable - "
+                 "use gnulib module symlink for portability");
+# endif
 #endif
 
 
@@ -810,10 +841,10 @@ extern 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))
+# if HAVE_RAW_DECL_SYMLINKAT
+_GL_WARN_ON_USE (symlinkat, "symlinkat is not portable - "
+                 "use gnulib module symlinkat for portability");
+# endif
 #endif
 
 
@@ -825,10 +856,10 @@ extern int unlink (char const *file) _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef unlink
-# define unlink(n)                         \
-    (GL_LINK_WARNING ("unlink is not portable - " \
-                      "use gnulib module unlink for portability"), \
-     unlink (n))
+# if HAVE_RAW_DECL_UNLINK
+_GL_WARN_ON_USE (unlink, "unlink is not portable - "
+                 "use gnulib module unlink for portability");
+# endif
 #endif
 
 
@@ -842,10 +873,10 @@ extern int unlinkat (int fd, char const *file, int flag) _GL_ARG_NONNULL ((2));
 # 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))
+# if HAVE_RAW_DECL_UNLINKAT
+_GL_WARN_ON_USE (unlinkat, "unlinkat is not portable - "
+                 "use gnulib module openat for portability");
+# endif
 #endif
 
 
@@ -863,10 +894,10 @@ extern int usleep (useconds_t n);
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef usleep
-# define usleep(n) \
-    (GL_LINK_WARNING ("usleep is unportable - " \
-                      "use gnulib module usleep for portability"), \
-     usleep (n))
+# if HAVE_RAW_DECL_USLEEP
+_GL_WARN_ON_USE (usleep, "usleep is unportable - "
+                 "use gnulib module usleep for portability");
+# endif
 #endif
 
 
diff --git a/libmissing/vasnprintf.c b/libmissing/vasnprintf.c
index e218500..3d7955b 100644
--- a/libmissing/vasnprintf.c
+++ b/libmissing/vasnprintf.c
@@ -1,5 +1,5 @@
 /* vsprintf with automatic memory allocation.
-   Copyright (C) 1999, 2002-2009 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002-2010 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
@@ -2367,7 +2367,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                     {
                       /* Use only as many wide characters as needed to produce
                          at most PRECISION bytes, from the left.  */
-#  if HAVE_WCRTOMB
+#  if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
                       mbstate_t state;
                       memset (&state, '\0', sizeof (mbstate_t));
 #  endif
@@ -2381,7 +2381,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                           if (*arg_end == 0)
                             /* Found the terminating null wide character.  */
                             break;
-#  if HAVE_WCRTOMB
+#  if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
                           count = wcrtomb (cbuf, *arg_end, &state);
 #  else
                           count = wctomb (cbuf, *arg_end);
@@ -2412,7 +2412,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                     {
                       /* Use the entire string, and count the number of
                          bytes.  */
-#  if HAVE_WCRTOMB
+#  if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
                       mbstate_t state;
                       memset (&state, '\0', sizeof (mbstate_t));
 #  endif
@@ -2426,7 +2426,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                           if (*arg_end == 0)
                             /* Found the terminating null wide character.  */
                             break;
-#  if HAVE_WCRTOMB
+#  if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
                           count = wcrtomb (cbuf, *arg_end, &state);
 #  else
                           count = wctomb (cbuf, *arg_end);
@@ -2464,7 +2464,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                   {
                     TCHAR_T *tmpptr = tmpsrc;
                     size_t remaining;
-#   if HAVE_WCRTOMB
+#   if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
                     mbstate_t state;
                     memset (&state, '\0', sizeof (mbstate_t));
 #   endif
@@ -2475,7 +2475,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
 
                         if (*arg == 0)
                           abort ();
-#   if HAVE_WCRTOMB
+#   if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
                         count = wcrtomb (cbuf, *arg, &state);
 #   else
                         count = wctomb (cbuf, *arg);
@@ -2545,7 +2545,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                     {
                       /* We know the number of bytes in advance.  */
                       size_t remaining;
-#   if HAVE_WCRTOMB
+#   if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
                       mbstate_t state;
                       memset (&state, '\0', sizeof (mbstate_t));
 #   endif
@@ -2557,7 +2557,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
 
                           if (*arg == 0)
                             abort ();
-#   if HAVE_WCRTOMB
+#   if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
                           count = wcrtomb (cbuf, *arg, &state);
 #   else
                           count = wctomb (cbuf, *arg);
@@ -2575,7 +2575,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                     }
                   else
                     {
-#   if HAVE_WCRTOMB
+#   if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
                       mbstate_t state;
                       memset (&state, '\0', sizeof (mbstate_t));
 #   endif
@@ -2586,7 +2586,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
 
                           if (*arg == 0)
                             abort ();
-#   if HAVE_WCRTOMB
+#   if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
                           count = wcrtomb (cbuf, *arg, &state);
 #   else
                           count = wctomb (cbuf, *arg);
diff --git a/libmissing/vasnprintf.h b/libmissing/vasnprintf.h
index 5676091..b55faf5 100644
--- a/libmissing/vasnprintf.h
+++ b/libmissing/vasnprintf.h
@@ -1,5 +1,5 @@
 /* vsprintf with automatic memory allocation.
-   Copyright (C) 2002-2004, 2007-2009 Free Software Foundation, Inc.
+   Copyright (C) 2002-2004, 2007-2010 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
@@ -25,15 +25,14 @@
 #include <stddef.h>
 
 #ifndef __attribute__
-/* This feature is available in gcc versions 2.5 and later.  */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
-#  define __attribute__(Spec) /* empty */
-# endif
-/* The __-protected variants of `format' and `printf' attributes
-   are accepted by gcc versions 2.6.4 (effectively 2.7) and later.  */
+/* The __attribute__ feature is available in gcc versions 2.5 and later.
+   The __-protected variants of the attributes 'format' and 'printf' are
+   accepted by gcc versions 2.6.4 (effectively 2.7) and later.
+   We enable __attribute__ only if these are supported too, because
+   gnulib and libintl do '#define printf __printf__' when they override
+   the 'printf' function.  */
 # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
-#  define __format__ format
-#  define __printf__ printf
+#  define __attribute__(Spec)   /* empty */
 # endif
 #endif
 
diff --git a/libmissing/verify.h b/libmissing/verify.h
index 6bf0506..7773c79 100644
--- a/libmissing/verify.h
+++ b/libmissing/verify.h
@@ -1,6 +1,6 @@
 /* Compile-time assert-like macros.
 
-   Copyright (C) 2005-2006, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2005-2006, 2009-2010 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
diff --git a/libmissing/w32sock.h b/libmissing/w32sock.h
index 2220474..bc0845c 100644
--- a/libmissing/w32sock.h
+++ b/libmissing/w32sock.h
@@ -1,6 +1,6 @@
 /* w32sock.h --- internal auxilliary functions for Windows socket functions
 
-   Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
diff --git a/libmissing/wchar.in.h b/libmissing/wchar.in.h
index b0cf255..4fb02cd 100644
--- a/libmissing/wchar.in.h
+++ b/libmissing/wchar.in.h
@@ -1,6 +1,6 @@
 /* A substitute for ISO C99 <wchar.h>, for platforms that have issues.
 
-   Copyright (C) 2007-2009 Free Software Foundation, Inc.
+   Copyright (C) 2007-2010 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
@@ -30,9 +30,9 @@
 @PRAGMA_SYSTEM_HEADER@
 #endif
 
-#if defined __need_mbstate_t || (defined __hpux && ((defined _INTTYPES_INCLUDED && !defined strtoimax) || defined _GL_JUST_INCLUDE_SYSTEM_WCHAR_H)) || defined _GL_ALREADY_INCLUDING_WCHAR_H
+#if defined __need_mbstate_t || defined __need_wint_t || (defined __hpux && ((defined _INTTYPES_INCLUDED && !defined strtoimax) || defined _GL_JUST_INCLUDE_SYSTEM_WCHAR_H)) || defined _GL_ALREADY_INCLUDING_WCHAR_H
 /* Special invocation convention:
-   - Inside uClibc header files.
+   - Inside glibc and uClibc header files.
    - On HP-UX 11.00 we have a sequence of nested includes
      <wchar.h> -> <stdlib.h> -> <stdint.h>, and the latter includes <wchar.h>,
      once indirectly <stdint.h> -> <sys/types.h> -> <inttypes.h> -> <wchar.h>
@@ -55,10 +55,13 @@
 /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
    <wchar.h>.
    BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
-   included before <wchar.h>.  */
-#include <stddef.h>
-#include <stdio.h>
-#include <time.h>
+   included before <wchar.h>.
+   But avoid namespace pollution on glibc systems.  */
+#ifndef __GLIBC__
+# include <stddef.h>
+# include <stdio.h>
+# include <time.h>
+#endif
 
 /* Include the original <wchar.h> if it exists.
    Some builds of uClibc lack it.  */
@@ -72,10 +75,10 @@
 #ifndef _GL_WCHAR_H
 #define _GL_WCHAR_H
 
-/* The definition of GL_LINK_WARNING is copied here.  */
-
 /* The definition of _GL_ARG_NONNULL is copied here.  */
 
+/* The definition of _GL_WARN_ON_USE is copied here.  */
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -112,10 +115,10 @@ extern wint_t btowc (int c);
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef btowc
-# define btowc(c) \
-    (GL_LINK_WARNING ("btowc is unportable - " \
-                      "use gnulib module btowc for portability"), \
-     btowc (c))
+# if HAVE_RAW_DECL_BTOWC
+_GL_WARN_ON_USE (btowc, "btowc is unportable - "
+                 "use gnulib module btowc for portability");
+# endif
 #endif
 
 
@@ -131,10 +134,10 @@ extern int wctob (wint_t wc);
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef wctob
-# define wctob(w) \
-    (GL_LINK_WARNING ("wctob is unportable - " \
-                      "use gnulib module wctob for portability"), \
-     wctob (w))
+# if HAVE_RAW_DECL_WCTOB
+_GL_WARN_ON_USE (wctob, "wctob is unportable - "
+                 "use gnulib module wctob for portability");
+# endif
 #endif
 
 
@@ -149,10 +152,10 @@ extern int mbsinit (const mbstate_t *ps);
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef mbsinit
-# define mbsinit(p) \
-    (GL_LINK_WARNING ("mbsinit is unportable - " \
-                      "use gnulib module mbsinit for portability"), \
-     mbsinit (p))
+# if HAVE_RAW_DECL_MBSINIT
+_GL_WARN_ON_USE (mbsinit, "mbsinit is unportable - "
+                 "use gnulib module mbsinit for portability");
+# endif
 #endif
 
 
@@ -167,10 +170,10 @@ extern size_t mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps);
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef mbrtowc
-# define mbrtowc(w,s,n,p) \
-    (GL_LINK_WARNING ("mbrtowc is unportable - " \
-                      "use gnulib module mbrtowc for portability"), \
-     mbrtowc (w, s, n, p))
+# if HAVE_RAW_DECL_MBRTOWC
+_GL_WARN_ON_USE (mbrtowc, "mbrtowc is unportable - "
+                 "use gnulib module mbrtowc for portability");
+# endif
 #endif
 
 
@@ -185,10 +188,10 @@ extern size_t mbrlen (const char *s, size_t n, mbstate_t *ps);
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef mbrlen
-# define mbrlen(s,n,p) \
-    (GL_LINK_WARNING ("mbrlen is unportable - " \
-                      "use gnulib module mbrlen for portability"), \
-     mbrlen (s, n, p))
+# if HAVE_RAW_DECL_MBRLEN
+_GL_WARN_ON_USE (mbrlen, "mbrlen is unportable - "
+                 "use gnulib module mbrlen for portability");
+# endif
 #endif
 
 
@@ -204,10 +207,10 @@ extern size_t mbsrtowcs (wchar_t *dest, const char **srcp, size_t len, mbstate_t
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef mbsrtowcs
-# define mbsrtowcs(d,s,l,p) \
-    (GL_LINK_WARNING ("mbsrtowcs is unportable - " \
-                      "use gnulib module mbsrtowcs for portability"), \
-     mbsrtowcs (d, s, l, p))
+# if HAVE_RAW_DECL_MBSRTOWCS
+_GL_WARN_ON_USE (mbsrtowcs, "mbsrtowcs is unportable - "
+                 "use gnulib module mbsrtowcs for portability");
+# endif
 #endif
 
 
@@ -223,10 +226,10 @@ extern size_t mbsnrtowcs (wchar_t *dest, const char **srcp, size_t srclen, size_
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef mbsnrtowcs
-# define mbsnrtowcs(d,s,n,l,p) \
-    (GL_LINK_WARNING ("mbsnrtowcs is unportable - " \
-                      "use gnulib module mbsnrtowcs for portability"), \
-     mbsnrtowcs (d, s, n, l, p))
+# if HAVE_RAW_DECL_MBSNRTOWCS
+_GL_WARN_ON_USE (mbsnrtowcs, "mbsnrtowcs is unportable - "
+                 "use gnulib module mbsnrtowcs for portability");
+# endif
 #endif
 
 
@@ -241,10 +244,10 @@ extern size_t wcrtomb (char *s, wchar_t wc, mbstate_t *ps);
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef wcrtomb
-# define wcrtomb(s,w,p) \
-    (GL_LINK_WARNING ("wcrtomb is unportable - " \
-                      "use gnulib module wcrtomb for portability"), \
-     wcrtomb (s, w, p))
+# if HAVE_RAW_DECL_WCRTOMB
+_GL_WARN_ON_USE (wcrtomb, "wcrtomb is unportable - "
+                 "use gnulib module wcrtomb for portability");
+# endif
 #endif
 
 
@@ -260,10 +263,10 @@ extern size_t wcsrtombs (char *dest, const wchar_t **srcp, size_t len, mbstate_t
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef wcsrtombs
-# define wcsrtombs(d,s,l,p) \
-    (GL_LINK_WARNING ("wcsrtombs is unportable - " \
-                      "use gnulib module wcsrtombs for portability"), \
-     wcsrtombs (d, s, l, p))
+# if HAVE_RAW_DECL_WCSRTOMBS
+_GL_WARN_ON_USE (wcsrtombs, "wcsrtombs is unportable - "
+                 "use gnulib module wcsrtombs for portability");
+# endif
 #endif
 
 
@@ -279,10 +282,10 @@ extern size_t wcsnrtombs (char *dest, const wchar_t **srcp, size_t srclen, size_
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef wcsnrtombs
-# define wcsnrtombs(d,s,n,l,p) \
-    (GL_LINK_WARNING ("wcsnrtombs is unportable - " \
-                      "use gnulib module wcsnrtombs for portability"), \
-     wcsnrtombs (d, s, n, l, p))
+# if HAVE_RAW_DECL_WCSNRTOMBS
+_GL_WARN_ON_USE (wcsnrtombs, "wcsnrtombs is unportable - "
+                 "use gnulib module wcsnrtombs for portability");
+# endif
 #endif
 
 
@@ -300,10 +303,10 @@ extern int wcwidth (int /* actually wchar_t */);
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef wcwidth
-# define wcwidth(w) \
-    (GL_LINK_WARNING ("wcwidth is unportable - " \
-                      "use gnulib module wcwidth for portability"), \
-     wcwidth (w))
+# if HAVE_RAW_DECL_WCWIDTH
+_GL_WARN_ON_USE (wcwidth, "wcwidth is unportable - "
+                 "use gnulib module wcwidth for portability");
+# endif
 #endif
 
 
diff --git a/libmissing/wctype.in.h b/libmissing/wctype.in.h
index 622f092..8c56d05 100644
--- a/libmissing/wctype.in.h
+++ b/libmissing/wctype.in.h
@@ -1,6 +1,6 @@
 /* A substitute for ISO C99 <wctype.h>, for platforms that lack it.
 
-   Copyright (C) 2006-2009 Free Software Foundation, Inc.
+   Copyright (C) 2006-2010 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
@@ -62,6 +62,10 @@
 # endif
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* FreeBSD 4.4 to 4.11 has <wctype.h> but lacks the functions.
    Linux libc5 has <wctype.h> and the functions but they are broken.
    Assume all 12 functions are implemented the same way, or not at all.  */
@@ -72,38 +76,38 @@
    refer to system functions like _iswctype that are not in the
    standard C library.  Rather than try to get ancient buggy
    implementations like this to work, just disable them.  */
-#  undef iswalnum
-#  undef iswalpha
-#  undef iswblank
-#  undef iswcntrl
-#  undef iswdigit
-#  undef iswgraph
-#  undef iswlower
-#  undef iswprint
-#  undef iswpunct
-#  undef iswspace
-#  undef iswupper
-#  undef iswxdigit
-#  undef towlower
-#  undef towupper
+# undef iswalnum
+# undef iswalpha
+# undef iswblank
+# undef iswcntrl
+# undef iswdigit
+# undef iswgraph
+# undef iswlower
+# undef iswprint
+# undef iswpunct
+# 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@
-#   define iswalnum rpl_iswalnum
-#   define iswalpha rpl_iswalpha
-#   define iswblank rpl_iswblank
-#   define iswcntrl rpl_iswcntrl
-#   define iswdigit rpl_iswdigit
-#   define iswgraph rpl_iswgraph
-#   define iswlower rpl_iswlower
-#   define iswprint rpl_iswprint
-#   define iswpunct rpl_iswpunct
-#   define iswspace rpl_iswspace
-#   define iswupper rpl_iswupper
-#   define iswxdigit rpl_iswxdigit
-#   define towlower rpl_towlower
-#   define towupper rpl_towupper
-#  endif
+# if @REPLACE_ISWCNTRL@
+#  define iswalnum rpl_iswalnum
+#  define iswalpha rpl_iswalpha
+#  define iswblank rpl_iswblank
+#  define iswcntrl rpl_iswcntrl
+#  define iswdigit rpl_iswdigit
+#  define iswgraph rpl_iswgraph
+#  define iswlower rpl_iswlower
+#  define iswprint rpl_iswprint
+#  define iswpunct rpl_iswpunct
+#  define iswspace rpl_iswspace
+#  define iswupper rpl_iswupper
+#  define iswxdigit rpl_iswxdigit
+#  define towlower rpl_towlower
+#  define towupper rpl_towupper
+# endif
 
 static inline int
 iswalnum (wint_t wc)
@@ -194,9 +198,9 @@ towupper (wint_t wc)
   return (wc >= 'a' && wc <= 'z' ? wc - 'a' + 'A' : wc);
 }
 
-# endif /* ! HAVE_ISWCNTRL */
+#endif /* ! HAVE_ISWCNTRL || REPLACE_ISWCNTRL */
 
-# if defined __MINGW32__
+#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
@@ -216,16 +220,20 @@ rpl_towlower (wint_t wc)
 {
   return (wint_t) (wchar_t) towlower (wc);
 }
-#  define towlower rpl_towlower
+# define towlower rpl_towlower
 
 static inline wint_t
 rpl_towupper (wint_t wc)
 {
   return (wint_t) (wchar_t) towupper (wc);
 }
-#  define towupper rpl_towupper
+# define towupper rpl_towupper
 
-# endif
+#endif /* __MINGW32__ */
+
+#ifdef __cplusplus
+}
+#endif
 
 #endif /* _GL_WCTYPE_H */
 #endif /* _GL_WCTYPE_H */
diff --git a/libmissing/xsize.h b/libmissing/xsize.h
index 258d043..3382280 100644
--- a/libmissing/xsize.h
+++ b/libmissing/xsize.h
@@ -1,6 +1,6 @@
 /* xsize.h -- Checked size_t computations.
 
-   Copyright (C) 2003, 2008, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2008, 2009, 2010 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
diff --git a/src/Makefile.am b/src/Makefile.am
index 55de579..5bc9312 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -4,7 +4,7 @@ AM_CPPFLAGS = -I$(srcdir)/include/ -I$(top_srcdir)/libmissing -I$(top_builddir)/
 AM_CFLAGS = @GLOBAL_CFLAGS@
 
 bin_PROGRAMS = prelude-lml
-prelude_lml_LDADD = @LIBPRELUDE_LIBS@ @PCRE_LIBS@ @ICU_LIBS@ $(top_builddir)/libev/libev.la $(top_builddir)/libmissing/libmissing.la
+prelude_lml_LDADD = @LIBPRELUDE_LIBS@ @PCRE_LIBS@ @ICU_LIBS@ $(top_builddir)/libev/libev.la $(top_builddir)/libmissing/libmissing.la $(GETADDRINFO_LIB) $(HOSTENT_LIB) $(INET_NTOP_LIB) $(LIBSOCKET) $(LTLIBICONV) $(LTLIBINTL) $(SERVENT_LIB)
 prelude_lml_LDFLAGS = @LIBPRELUDE_LDFLAGS@ -export-dynamic \
         "-dlopen" $(top_builddir)/plugins/debug/debug.la \
         "-dlopen" $(top_builddir)/plugins/pcre/pcre.la
diff --git a/warn-on-use.h b/warn-on-use.h
new file mode 100644
index 0000000..b314d36
--- /dev/null
+++ b/warn-on-use.h
@@ -0,0 +1,75 @@
+/* A C macro for emitting warnings if a function is used.
+   Copyright (C) 2010 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
+   Lesser 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/>.  */
+
+/* _GL_WARN_ON_USE(function, "literal string") issues a declaration
+   for FUNCTION which will then trigger a compiler warning containing
+   the text of "literal string" anywhere that function is called, if
+   supported by the compiler.  If the compiler does not support this
+   feature, the macro expands to an unused extern declaration.
+
+   This macro is useful for marking a function as a potential
+   portability trap, with the intent that "literal string" include
+   instructions on the replacement function that should be used
+   instead.  However, one of the reasons that a function is a
+   portability trap is if it has the wrong signature.  Declaring
+   FUNCTION with a different signature in C is a compilation error, so
+   this macro must use the same type as any existing declaration so
+   that programs that avoid the problematic FUNCTION do not fail to
+   compile merely because they included a header that poisoned the
+   function.  But this implies that _GL_WARN_ON_USE is only safe to
+   use if FUNCTION is known to already have a declaration.  Use of
+   this macro implies that there must not be any other macro hiding
+   the declaration of FUNCTION; but undefining FUNCTION first is part
+   of the poisoning process anyway (although for symbols that are
+   provided only via a macro, the result is a compilation error rather
+   than a warning containing "literal string").  Also note that in
+   C++, it is only safe to use if FUNCTION has no overloads.
+
+   For an example, it is possible to poison 'getline' by:
+   - adding a call to gl_WARN_ON_USE_PREPARE([[#include <stdio.h>]],
+     [getline]) in configure.ac, which potentially defines
+     HAVE_RAW_DECL_GETLINE
+   - adding this code to a header that wraps the system <stdio.h>:
+     #undef getline
+     #if HAVE_RAW_DECL_GETLINE
+     _GL_WARN_ON_USE (getline, "getline is required by POSIX 2008, but"
+       "not universally present; use the gnulib module getline");
+     #endif
+
+   It is not possible to directly poison global variables.  But it is
+   possible to write a wrapper accessor function, and poison that
+   (less common usage, like &environ, will cause a compilation error
+   rather than issue the nice warning, but the end result of informing
+   the developer about their portability problem is still achieved):
+   #if HAVE_RAW_DECL_ENVIRON
+   static inline char ***rpl_environ (void) { return &environ; }
+   _GL_WARN_ON_USE (rpl_environ, "environ is not always properly declared");
+   # undef environ
+   # define environ (*rpl_environ ())
+   #endif
+   */
+#ifndef _GL_WARN_ON_USE
+
+# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
+/* A compiler attribute is available in gcc versions 4.3.0 and later.  */
+#  define _GL_WARN_ON_USE(function, message) \
+extern __typeof__ (function) function __attribute__ ((__warning__ (message)))
+
+# else /* Unsupported.  */
+#  define _GL_WARN_ON_USE(function, message) \
+extern int _gl_warn_on_use
+# endif
+#endif
_______________________________________________
Prelude-cvslog site list
[email protected]
http://lists.prelude-ids.org/mailman/listinfo/prelude-cvslog