m4/strerror.m4


Log

Author Commit Date CI Message
Bruno Haible 7f7051f6 2012-05-05T11:37:49 strerror: Avoid "guessing no" when cross-compiling to glibc systems. * m4/strerror.m4 (gl_FUNC_STRERROR): Require AC_CANONICAL_HOST. When cross-compiling to a glibc platform, set gl_cv_func_working_strerror to "guessing yes". (gl_FUNC_STRERROR_0): Require AC_CANONICAL_HOST. When cross-compiling to a glibc platform, set gl_cv_func_strerror_0_works to "guessing yes".
Jim Meyering 1602f0af 2012-01-01T10:04:58 maint: update all copyright year number ranges Run "make update-copyright".
Eric Blake c7487319 2011-06-21T08:50:51 strerror_r: fix OpenBSD behavior on 0 OpenBSD treats strerror_r(0,,) as a success, but with a message "Undefined error: 0"; while this is distinct from strerror_r(-1,,) returning "Unknown error: -1", it does not imply success. Meanwhile, if buf is short enough for ERANGE, then we can't use strstr to look for "Unknown" or "Undefined" in the resulting message, like we had been doing for strerror(). Fix this by shifting the burden - now the strerror-override code guarantees that 0 will have an override when needed. * lib/strerror-override.c (strerror_override): Also override 0 when needed. * lib/strerror-override.h (strerror_override): Likewise. * lib/strerror.c (strerror): Simplify, now that 0 override is done earlier. * lib/strerror_r.c (strerror_r): Likewise. * m4/strerror.m4 (gl_FUNC_STRERROR): Split detection of 0 behavior... (gl_FUNC_STRERROR_0): ...into new macro. * m4/strerror_r.m4 (gl_FUNC_STRERROR_R): Replace strerror_r if 0 is overridden. (gl_FUNC_STRERROR_R_WORKS): Avoid extra tests if 0 is broken. * modules/strerror-override (Files): Add strerror.m4. (configure.ac): Also provide override for 0 when needed. * doc/posix-functions/strerror.texi (strerror): Document this. * doc/posix-functions/perror.texi (perror): Likewise. Signed-off-by: Eric Blake <eblake@redhat.com>
Eric Blake 79d4e75d 2011-06-07T20:49:04 strerror_r-posix: fix on MacOS MacOS X 10.5 strerror(0) is "Unknown error: 0", which is not distinguished from "Unknown error: -1" for out-of-range. Worse, strerror_r(0,,) is "Undefined error: 0", although strerror_r for all other out-of-range values matches strerror. * m4/strerror.m4 (gl_FUNC_STRERROR): Flush out MacOS bug. * m4/strerror_r.m4 (gl_FUNC_STRERROR_R_WORKS): Likewise, and fix logic bug. * lib/strerror_r.c (strerror_r): Fix the bug. * lib/strerror.c (strerror): Likewise. * doc/posix-functions/strerror_r.texi (strerror_r): Document the problem. * doc/posix-functions/strerror.texi (strerror): Likewise. * doc/posix-functions/perror.texi (perror): Likewise. * tests/test-strerror.c (main): Enhance test. * tests/test-strerror_r.c (main): Likewise. Signed-off-by: Eric Blake <eblake@redhat.com>
Eric Blake 0447b703 2011-06-08T05:12:15 strerror: simplify replacement Only strerror-override depends on winsock2.h; our strerror.c file does not. This also fixes mingw strerror_r-posix use of winsock2.h via strerror-override. Since we assume C89 which guarantees a declaration for sterror, we don't need to repeat that check. * m4/strerror.m4 (gl_PREREQ_STRERROR): Delete. * modules/strerror (configure.ac): No prereqs needed here... * modules/strerror-override (configure.ac): ...but this needs it. (Files): Add file for needed prereq macro. Signed-off-by: Eric Blake <eblake@redhat.com>
Bruno Haible 3bc888d2 2011-06-08T12:27:31 strerror_r-posix: Tweaks. * m4/strerror.m4 (gl_FUNC_STRERROR): Omit the code that tests gl_cv_func_strerror_r_works if gl_FUNC_STRERROR_R_WORKS is not present. * m4/strerror_r.m4 (gl_FUNC_STRERROR_R_WORKS): Fix AC_CACHE_CHECK message. Move gl_HEADER_STRING_H_DEFAULTS invocation from here... (gl_FUNC_STRERROR_R): ... to here. (gl_PREREQ_STRERROR_R): Test for __xpg_strerror_r.
Eric Blake 4018d9e0 2011-06-06T17:59:01 strerror_r-posix: work around cygwin 1.7.9 Cygwin __xpg_strerror_r clobbers strerror, until cygwin 1.7.10; in this case, we must replace strerror, but there was nothing in strerror.m4 finding fault with cygwin's native strerror. Solve this by splitting strerror_r.m4 into two parts, one for probing for the strerror_r bug, and one for replacing strerror_r based on the presence of bugs unrelated to signature issues; that way, the 'strerror' module in isolation will not replace strerror, but if strerror_r is in use for any other reason, then the two use separate buffers. Note that cygwin's strerror is thread-safe while the gnulib replacement is not; but this is no worse than any other platform where strerror is not thread-safe; in a single-threaded program, the difference is not observable, and in a multi-threaded program, you really shouldn't be using strerror in the first place. Also note that this ends up replacing glibc 2.13 strerror as it deems __xpg_strerror_r broken on that platform, which isn't technically necessary for strerror, but doesn't hurt too much. Meanwhile, glibc 2.14 fixed __xpg_strerror_r, and strerror is not replaced in that scenario. * m4/strerror_r.m4 (gl_FUNC_STRERROR_R): Split... (gl_FUNC_STRERROR_R_WORKS): ...into new macro, to detect Cygwin bug without replacing strerror_r. * m4/strerror.m4 (gl_FUNC_STRERROR): Replace strerror if strerror_r is buggy, but without requiring strerror_r compilation. * doc/posix-functions/strerror_r.texi (strerror_r): Fix docs. Signed-off-by: Eric Blake <eblake@redhat.com>
Bruno Haible b47aace9 2011-05-22T13:19:32 strerror: Move AC_LIBOBJ invocations to module description. * m4/strerror.m4 (gl_FUNC_STRERROR): Move AC_LIBOBJ and gl_PREREQ_STRERROR invocations from here... * modules/strerror (configure.ac): ... to here.
Bruno Haible 886f8503 2011-05-21T23:35:46 relocatable-prog-wrapper: Assume strerror() exists. * modules/relocatable-prog-wrapper (Files): Remove lib/strerror.c, m4/strerror.m4. (configure.ac): Don't invoke gl_FUNC_STRERROR_SEPARATE. * lib/relocwrapper.c: Remove mention of strerror module. * lib/strerror.c: Assume REPLACE_STRERROR is 1. * m4/strerror.m4 (gl_FUNC_STRERROR_SEPARATE): Remove macro. (gl_FUNC_STRERROR): Inline it here. Don't define REPLACE_STRERROR as a C macro.
Eric Blake 1608fbc0 2011-05-18T18:16:59 strerror: enforce POSIX ruling on strerror(0) http://austingroupbugs.net/view.php?id=382 requires that strerror(0) succeed, but FreeBSD reports "Unknown error: 0" and fails with EINVAL. * m4/strerror.m4 (gl_FUNC_STRERROR_SEPARATE): Expose BSD bug. * m4/strerror_r.m4 (gl_FUNC_STRERROR_R): Likewise. * lib/strerror_r.c (rpl_strerror_r): Work around it. * doc/posix-functions/strerror.texi (strerror): Document it. * doc/posix-functions/strerror_r.texi (strerror_r): Likewise. * tests/test-strerror.c (main): Strengthen test. * tests/test-strerror_r.c (main): Likewise. Signed-off-by: Eric Blake <eblake@redhat.com>
Jim Meyering d60f3b0c 2011-01-01T20:17:23 maint: update almost all copyright ranges to include 2011 Run the new "make update-copyright" rule.
Jim Meyering b2e2010c 2010-01-01T10:31:12 update nearly all FSF copyright year lists to include 2010 Use the same procedure as for 2009, outlined in http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/20081
Jim Meyering 3030c5b5 2009-12-28T10:50:36 update nearly all FSF copyright year lists to include 2009 The files named by the following are exempted: grep -v '^#' config/srclist.txt|grep -v '^$' \ | while read src dst; do test -f "$dst" && { echo "$dst"; continue; } test -d "$dst" || continue echo "$dst"/$(basename "$src") done > exempt git ls-files tests/unictype >> exempt In the remaining files, convert to all-interval notation if - there is already at least one year interval like 2000-2003 - the file is maintained by me - the file is in lib/uni*/, where that style already prevails Otherwise, use update-copyright's default.
Bruno Haible 6c560a52 2008-09-14T04:18:44 Extend strerror to cover the added errno values.
Bruno Haible b6d1202a 2008-04-15T01:52:03 Fix underquoting of AC_LANG_PROGRAM arguments.
Eric Blake 14ba51b4 2007-12-04T08:35:02 * m4/strerror.m4: Bump version number. Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake e103c665 2007-12-03T16:49:30 Fix strerror module on Solaris 7. * m4/strerror.m4 (gl_FUNC_STRERROR_SEPARATE): Ensure REPLACE_STRERROR is initialized before this macro. Signed-off-by: Eric Blake <ebb9@byu.net>
Eric Blake 95d0bce5 2007-10-11T16:10:24 Don't claim strerror is broken on Interix. * doc/functions/strerror.texi (strerror): Known broken systems are now Solaris 8, and not Interix. * m4/strerror.m4 (gl_FUNC_STRERROR_SEPARATE): No longer filter out Interix on cross-compile. Reported by Martin Koeppe in http://lists.gnu.org/archive/html/bug-gnulib/2007-10/msg00005.html. Signed-off-by: Eric Blake <ebb9@byu.net>
Paul Eggert 73f48e6f 2007-10-11T14:43:30 Simplify and modernize strerror substitute, partly to fix Solaris 8 bug. * lib/strerror.c: Include <string.h> always, to test interface, and to remove the need for the dummy. Include intprops.h to compute width instead of doing it ourselves and missing a CHAR_BIT declaration, which broke tar 1.19 on Solaris 8. (strerror): Define it to return NULL if there's no system strerror. (rpl_strerror): Use INT_STRLEN_BOUND to compute bound. Omit !HAVE_STRERROR code. We don't need to worry about supporting ancient pre-strerror Unix systems well any more. Saying "unknown system error" is enough. * lib/string.in.h (strerror): Simplify the ifdef to reflect the simpler strerror.c implementation. * m4/strerror.m4 (gl_FUNC_STRERROR_SEPARATE, gl_PREREQ_STDERROR): Simplify the tests to reflect the simpler strerror implementation. * modules/strerror (Depends-on): Add intprops.
Eric Blake d5d3e86d 2007-09-25T10:40:16 Fix strerror on Interix. * lib/string_.h (strerror): Declare replacement. * doc/functions/strerror.texi (strerror): Document the Interix shortcoming. * modules/string (Makefile.am): Support new hooks. * m4/string_h.m4 (gl_HEADER_STRING_H_DEFAULTS): Add new hooks. * m4/strerror.m4 (gl_FUNC_STRERROR): Defer to gl_FUNC_STRERROR_SEPARATE. (gl_FUNC_STRERROR_SEPARATE): Check for Interix bug. * lib/strerror.c (rpl_strerror): Provide replacement. * modules/strerror (Depends-on): Add string. (configure.ac): Detect use of module. * tests/test-strerror.c: New file. * modules/strerror-tests: New test module. * modules/argp (Depends-on): Add strerror. * modules/error (Depends-on): Likewise. Reported by Martin Koeppe. Signed-off-by: Eric Blake <ebb9@byu.net>
Bruno Haible 8badccbd 2007-03-03T19:53:01 Make it possible to compile strerror.c separately, unconditionally.
Paul Eggert 44d7c1c1 2005-01-23T08:06:57 Use an all-permissive copyright notice, recommended by RMS.
Bruno Haible ff85e378 2003-05-30T13:12:15 Add gettext release stamp.
Bruno Haible 53b8fa05 2002-12-31T13:42:06 An autoconf macro for its associated module.