strerror: allow user hook to comply with POSIX rules

* libc/string/strerror.c (strerror): Split body into...
(_strerror_r): ...new reentrant function.
* libc/string/u_strerr.c (_user_strerror): Update signature.
* libc/include/stdio.h (_strerror_r): New prototype.
* libc/posix/collate.c (__collate_err): Adjust callers.
* libc/stdio/perror.c (_perror_r): Likewise.
* libc/string/strerror_r.c (strerror_r): Likewise.
* libc/string/xpg_strerror_r.c (__xpg_strerror_r): Likewise.
This commit is contained in:
Eric Blake
2011-05-25 18:41:10 +00:00
parent 6215837523
commit 4805b60ccf
8 changed files with 73 additions and 27 deletions

View File

@ -1,8 +1,10 @@
#include <_ansi.h>
char *
_DEFUN(_user_strerror, (errnum),
int errnum)
_DEFUN(_user_strerror, (errnum, internal, errptr),
int errnum _AND
int internal _AND
int *errptr)
{
return 0;
}