Mercurial > hg > octave-nkf > gnulib-hg
view lib/areadlink.h @ 14853:bdc85db78f47
strerror: drop strerror_r dependency
Since the errno module is responsible for introducing replacement
errno values, it should also be responsible for translating those
new values into strings. And by moving the replacements into a
file managed by the errno, we can then break the dependency between
strerror and strerror_r, so that strerror no longer drags in
multi-threading modules required by strerror_r.
Tested on glibc with:
gl_cv_header_errno_h_complete=no gl_cv_func_working_strerror=no \
gl_cv_func_strerror_r_works=no ./gnulib-tool --with-tests \
--test strerror strerror_r-posix
* lib/strerror_r.c (strerror_r): Move gnulib replacement strings...
* lib/strerror-override.c (strerror_override): ...to new file.
* lib/strerror-override.h: Add prototype.
* lib/strerror-impl.h: Delete.
* lib/strerror.c (strerror): New implementation.
* modules/errno (Files): Add new files.
(configure.ac): Compile new file as appropriate.
* modules/strerror (Files): Drop unused file.
(Depends-on): Drop strerror_r-posix.
* MODULES.html.sh: Document strerror_r-posix.
Requested by Sam Steingold.
Signed-off-by: Eric Blake <eblake@redhat.com>
author | Eric Blake <eblake@redhat.com> |
---|---|
date | Tue, 24 May 2011 15:33:49 -0600 |
parents | 97fc9a21a8fb |
children | 8250f2777afc |
line wrap: on
line source
/* Read symbolic links without size limitation. Copyright (C) 2001, 2003-2004, 2007, 2009-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ /* Written by Jim Meyering <jim@meyering.net> */ #include <stddef.h> extern char *areadlink (char const *filename); extern char *areadlink_with_size (char const *filename, size_t size_hint); #if GNULIB_AREADLINKAT extern char *areadlinkat (int fd, char const *filename); #endif #if GNULIB_AREADLINKAT_WITH_SIZE extern char *areadlinkat_with_size (int fd, char const *filename, size_t size_hint); #endif