From af0172162f7c653cad6a11ed1c1a5459bc154465 Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Sat, 14 Jan 2006 00:58:03 +0000 Subject: hidden_def/hidden_proto: convert all users (I hope) termios split, add some missing headers, other jump relocs removed --- libc/string/__xpg_strerror_r.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'libc/string/__xpg_strerror_r.c') diff --git a/libc/string/__xpg_strerror_r.c b/libc/string/__xpg_strerror_r.c index 40e114224..6059cbcbd 100644 --- a/libc/string/__xpg_strerror_r.c +++ b/libc/string/__xpg_strerror_r.c @@ -8,9 +8,14 @@ #define _GNU_SOURCE #include #include +#include #include #include "_syserrmsg.h" +libc_hidden_proto(__xpg_strerror_r) +libc_hidden_proto(memcpy) +libc_hidden_proto(strlen) + #ifdef __UCLIBC_HAS_ERRNO_MESSAGES__ extern const char _string_syserrmsgs[] attribute_hidden; @@ -154,8 +159,7 @@ static const unsigned char estridx[] = { #endif -/* __xpg_strerror_r is used in header */ -int attribute_hidden __xpg_strerror_r_internal(int errnum, char *strerrbuf, size_t buflen) +int __xpg_strerror_r(int errnum, char *strerrbuf, size_t buflen) { register char *s; int i, retval; @@ -207,20 +211,20 @@ int attribute_hidden __xpg_strerror_r_internal(int errnum, char *strerrbuf, size #endif /* __UCLIBC_HAS_ERRNO_MESSAGES__ */ s = _int10tostr(buf+sizeof(buf)-1, errnum) - sizeof(unknown); - __memcpy(s, unknown, sizeof(unknown)); + memcpy(s, unknown, sizeof(unknown)); GOT_MESG: if (!strerrbuf) { /* SUSv3 */ buflen = 0; } - i = __strlen(s) + 1; + i = strlen(s) + 1; if (i > buflen) { i = buflen; retval = ERANGE; } if (i) { - __memcpy(strerrbuf, s, i); + memcpy(strerrbuf, s, i); strerrbuf[i-1] = 0; /* In case buf was too small. */ } @@ -233,7 +237,7 @@ int attribute_hidden __xpg_strerror_r_internal(int errnum, char *strerrbuf, size #else /* __UCLIBC_HAS_ERRNO_MESSAGES__ */ -int attribute_hidden __xpg_strerror_r_internal(int errnum, char *strerrbuf, size_t buflen) +int __xpg_strerror_r(int errnum, char *strerrbuf, size_t buflen) { register char *s; int i, retval; @@ -243,7 +247,7 @@ int attribute_hidden __xpg_strerror_r_internal(int errnum, char *strerrbuf, size }; s = _int10tostr(buf+sizeof(buf)-1, errnum) - sizeof(unknown); - __memcpy(s, unknown, sizeof(unknown)); + memcpy(s, unknown, sizeof(unknown)); if (!strerrbuf) { /* SUSv3 */ buflen = 0; @@ -259,7 +263,7 @@ int attribute_hidden __xpg_strerror_r_internal(int errnum, char *strerrbuf, size } if (i) { - __memcpy(strerrbuf, s, i); + memcpy(strerrbuf, s, i); strerrbuf[i-1] = 0; /* In case buf was too small. */ } @@ -269,5 +273,4 @@ int attribute_hidden __xpg_strerror_r_internal(int errnum, char *strerrbuf, size } #endif /* __UCLIBC_HAS_ERRNO_MESSAGES__ */ - -strong_alias(__xpg_strerror_r_internal,__xpg_strerror_r) +libc_hidden_def(__xpg_strerror_r) -- cgit v1.2.3