* m4/strsignal.m4 (gl_FUNC_STRSIGNAL): Also check in <unistd.h>.
* lib/string.in.h (includes): Likewise.
* doc/posix-functions/strsignal.texi (strsignal): Document the
bug.
Reported by Nelson H. F. Beebe.
Signed-off-by: Eric Blake <eblake@redhat.com>
2010-09-09 Eric Blake <eblake@redhat.com>
+ strsignal: work around NetBSD bug
+ * m4/strsignal.m4 (gl_FUNC_STRSIGNAL): Also check in <unistd.h>.
+ * lib/string.in.h (includes): Likewise.
+ * doc/posix-functions/strsignal.texi (strsignal): Document the
+ bug.
+ Reported by Nelson H. F. Beebe.
+
gnulib-tool: work with NetBSD /bin/sh
* gnulib-tool (func_cache_var, func_cache_lookup_module)
(func_get_description, func_get_comment, func_get_status)
This function does not return a string for out-of-range numbers on
some platforms:
Solaris, AIX 5.1.
+
+@item
+This function is declared in @code{unistd.h} instead of
+@code{string.h} on some platforms:
+NetBSD 5.0.
@end itemize
Portability problems not fixed by Gnulib:
# define _GL_ATTRIBUTE_PURE /* empty */
#endif
+/* NetBSD 5.0 declares strsignal in <unistd.h>, not in <string.h>. */
+/* But avoid namespace pollution on glibc systems. */
+#if (@GNULIB_STRSIGNAL@ || defined GNULIB_POSIXCHECK) \
+ && ! defined __GLIBC__
+# include <unistd.h>
+#endif
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
-# strsignal.m4 serial 3
+# strsignal.m4 serial 4
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,
[AC_RUN_IFELSE(
[AC_LANG_PROGRAM(
[[#include <string.h>
+#include <unistd.h> /* NetBSD 5.0 declares it in wrong header. */
]],
[[char *s = strsignal (-1);
return !(s != (char *) 0 && s != (char *) -1);]])],