diff options
Diffstat (limited to 'libc/misc')
-rw-r--r-- | libc/misc/ftw/ftw.c | 1 | ||||
-rw-r--r-- | libc/misc/internals/__uClibc_main.c | 3 | ||||
-rw-r--r-- | libc/misc/locale/locale.c | 4 | ||||
-rw-r--r-- | libc/misc/search/tsearch.c | 3 | ||||
-rw-r--r-- | libc/misc/time/time.c | 18 | ||||
-rw-r--r-- | libc/misc/utmp/utent.c | 7 | ||||
-rw-r--r-- | libc/misc/wchar/wchar.c | 32 | ||||
-rw-r--r-- | libc/misc/wchar/wstdio.c | 2 | ||||
-rw-r--r-- | libc/misc/wordexp/wordexp.c | 1 |
9 files changed, 47 insertions, 24 deletions
diff --git a/libc/misc/ftw/ftw.c b/libc/misc/ftw/ftw.c index cf410ba02..48b385c19 100644 --- a/libc/misc/ftw/ftw.c +++ b/libc/misc/ftw/ftw.c @@ -19,6 +19,7 @@ 02111-1307 USA. */ #define mempcpy __libc_mempcpy +#define tsearch __tsearch #define _GNU_SOURCE #include <features.h> diff --git a/libc/misc/internals/__uClibc_main.c b/libc/misc/internals/__uClibc_main.c index 8685f5a94..2db8b078a 100644 --- a/libc/misc/internals/__uClibc_main.c +++ b/libc/misc/internals/__uClibc_main.c @@ -13,6 +13,9 @@ * avoided in the static library case. */ +#define getgid __getgid +#define getegid __getegid + #define _ERRNO_H #include <features.h> #include <unistd.h> diff --git a/libc/misc/locale/locale.c b/libc/misc/locale/locale.c index da62b04ce..f46dabc2d 100644 --- a/libc/misc/locale/locale.c +++ b/libc/misc/locale/locale.c @@ -1415,8 +1415,8 @@ __locale_t weak_function __curlocale_set(__locale_t newloc) #define Cc2wc_ROW_LEN __LOCALE_DATA_Cc2wc_ROW_LEN extern size_t _wchar_utf8sntowcs(wchar_t *__restrict pwc, size_t wn, - const char **__restrict src, size_t n, - mbstate_t *ps, int allow_continuation); + const char **__restrict src, size_t n, + mbstate_t *ps, int allow_continuation) attribute_hidden; int __locale_mbrtowc_l(wchar_t *__restrict dst, const char *__restrict src, diff --git a/libc/misc/search/tsearch.c b/libc/misc/search/tsearch.c index 72abcee7b..1da6b571e 100644 --- a/libc/misc/search/tsearch.c +++ b/libc/misc/search/tsearch.c @@ -51,7 +51,7 @@ register node **rootp; address of tree root int (*compar)(); ordering function */ -void *tsearch(__const void *key, void **vrootp, __compar_fn_t compar) +void attribute_hidden *__tsearch(__const void *key, void **vrootp, __compar_fn_t compar) { register node *q; register node **rootp = (node **) vrootp; @@ -77,6 +77,7 @@ void *tsearch(__const void *key, void **vrootp, __compar_fn_t compar) } return (q); } +strong_alias(__tsearch,tsearch) #endif #ifdef L_tfind diff --git a/libc/misc/time/time.c b/libc/misc/time/time.c index 67add6845..e1e86db91 100644 --- a/libc/misc/time/time.c +++ b/libc/misc/time/time.c @@ -131,6 +131,7 @@ #define _uintmaxtostr __libc__uintmaxtostr #define strnlen __strnlen +#define memcpy __memcpy #define _GNU_SOURCE #include <stdio.h> @@ -224,15 +225,21 @@ extern struct tm *__time_localtime_tzi(const time_t *__restrict timer, extern time_t _time_mktime_tzi(struct tm *timeptr, int store_on_success, rule_struct *tzi) attribute_hidden; +extern char *__asctime (__const struct tm *__tp) attribute_hidden; + +extern char *__asctime_r (__const struct tm *__restrict __tp, + char *__restrict __buf) attribute_hidden; + /**********************************************************************/ #ifdef L_asctime static char __time_str[26]; -char *asctime(const struct tm *__restrict ptm) +char attribute_hidden *__asctime(const struct tm *ptm) { - return asctime_r(ptm, __time_str); + return __asctime_r(ptm, __time_str); } +strong_alias(__asctime,asctime) #endif /**********************************************************************/ @@ -300,7 +307,7 @@ static const unsigned char at_data[] = { ' ', '?', '?', '?', '?', '\n', 0 }; -char *asctime_r(register const struct tm *__restrict ptm, +char attribute_hidden *__asctime_r(register const struct tm *__restrict ptm, register char *__restrict buffer) { int tmp; @@ -374,6 +381,7 @@ char *asctime_r(register const struct tm *__restrict ptm, return buffer - 8; } +strong_alias(__asctime_r,asctime_r) #endif /**********************************************************************/ @@ -448,7 +456,7 @@ clock_t clock(void) char *ctime(const time_t *clock) { /* ANSI/ISO/SUSv3 say that ctime is equivalent to the following. */ - return asctime(localtime(clock)); + return __asctime(localtime(clock)); } #endif @@ -459,7 +467,7 @@ char *ctime_r(const time_t *clock, char *buf) { struct tm xtm; - return asctime_r(localtime_r(clock, &xtm), buf); + return __asctime_r(localtime_r(clock, &xtm), buf); } #endif diff --git a/libc/misc/utmp/utent.c b/libc/misc/utmp/utent.c index c1d8d6fa2..1cb0b79b2 100644 --- a/libc/misc/utmp/utent.c +++ b/libc/misc/utmp/utent.c @@ -108,7 +108,7 @@ struct utmp *getutent(void) } /* Locking is done in __getutent */ -struct utmp *getutid (const struct utmp *utmp_entry) +struct utmp attribute_hidden *__getutid (const struct utmp *utmp_entry) { struct utmp *lutmp; @@ -133,6 +133,7 @@ struct utmp *getutid (const struct utmp *utmp_entry) return NULL; } +strong_alias(__getutid,getutid) /* Locking is done in __getutent */ struct utmp *getutline(const struct utmp *utmp_entry) @@ -150,6 +151,8 @@ struct utmp *getutline(const struct utmp *utmp_entry) return NULL; } +extern struct utmp *getutid (__const struct utmp *__id) attribute_hidden; + struct utmp *pututline (const struct utmp *utmp_entry) { LOCK; @@ -157,7 +160,7 @@ struct utmp *pututline (const struct utmp *utmp_entry) the file pointer where they want it, everything will work out. */ lseek(static_fd, (off_t) - sizeof(struct utmp), SEEK_CUR); - if (getutid(utmp_entry) != NULL) { + if (__getutid(utmp_entry) != NULL) { lseek(static_fd, (off_t) - sizeof(struct utmp), SEEK_CUR); if (write(static_fd, utmp_entry, sizeof(struct utmp)) != sizeof(struct utmp)) return NULL; diff --git a/libc/misc/wchar/wchar.c b/libc/misc/wchar/wchar.c index 25f8efa7b..055900827 100644 --- a/libc/misc/wchar/wchar.c +++ b/libc/misc/wchar/wchar.c @@ -176,11 +176,11 @@ extern size_t __wcrtomb (char *__restrict __s, wchar_t __wc, /* Implementation-specific work functions. */ extern size_t _wchar_utf8sntowcs(wchar_t *__restrict pwc, size_t wn, - const char **__restrict src, size_t n, - mbstate_t *ps, int allow_continuation); + const char **__restrict src, size_t n, + mbstate_t *ps, int allow_continuation) attribute_hidden; extern size_t _wchar_wcsntoutf8s(char *__restrict s, size_t n, - const wchar_t **__restrict src, size_t wn); + const wchar_t **__restrict src, size_t wn) attribute_hidden; /* glibc extensions. */ @@ -271,15 +271,13 @@ int mbsinit(const mbstate_t *ps) /**********************************************************************/ #ifdef L_mbrlen -size_t __mbrlen(const char *__restrict s, size_t n, mbstate_t *__restrict ps) +size_t attribute_hidden __mbrlen(const char *__restrict s, size_t n, mbstate_t *__restrict ps) { static mbstate_t mbstate; /* Rely on bss 0-init. */ return __mbrtowc(NULL, s, n, (ps != NULL) ? ps : &mbstate); } - -size_t mbrlen(const char *__restrict s, size_t n, mbstate_t *__restrict ps) - __attribute__ ((__weak__, __alias__("__mbrlen"))); +strong_alias(__mbrlen,mbrlen) #endif /**********************************************************************/ @@ -372,7 +370,7 @@ strong_alias(__wcrtomb,wcrtomb) /**********************************************************************/ #ifdef L_mbsrtowcs -size_t mbsrtowcs(wchar_t *__restrict dst, const char **__restrict src, +size_t attribute_hidden __mbsrtowcs(wchar_t *__restrict dst, const char **__restrict src, size_t len, mbstate_t *__restrict ps) { static mbstate_t mbstate; /* Rely on bss 0-init. */ @@ -380,6 +378,7 @@ size_t mbsrtowcs(wchar_t *__restrict dst, const char **__restrict src, return __mbsnrtowcs(dst, src, SIZE_MAX, len, ((ps != NULL) ? ps : &mbstate)); } +strong_alias(__mbsrtowcs,mbsrtowcs) #endif /**********************************************************************/ @@ -389,11 +388,12 @@ size_t mbsrtowcs(wchar_t *__restrict dst, const char **__restrict src, * TODO: Check for valid state anyway? */ -size_t wcsrtombs(char *__restrict dst, const wchar_t **__restrict src, +size_t attribute_hidden __wcsrtombs(char *__restrict dst, const wchar_t **__restrict src, size_t len, mbstate_t *__restrict ps) { return __wcsnrtombs(dst, src, SIZE_MAX, len, ps); } +strong_alias(__wcsrtombs,wcsrtombs) #endif /**********************************************************************/ @@ -410,7 +410,7 @@ size_t wcsrtombs(char *__restrict dst, const wchar_t **__restrict src, #endif #endif -size_t _wchar_utf8sntowcs(wchar_t *__restrict pwc, size_t wn, +size_t attribute_hidden _wchar_utf8sntowcs(wchar_t *__restrict pwc, size_t wn, const char **__restrict src, size_t n, mbstate_t *ps, int allow_continuation) { @@ -581,7 +581,7 @@ size_t _wchar_utf8sntowcs(wchar_t *__restrict pwc, size_t wn, /**********************************************************************/ #ifdef L__wchar_wcsntoutf8s -size_t _wchar_wcsntoutf8s(char *__restrict s, size_t n, +size_t attribute_hidden _wchar_wcsntoutf8s(char *__restrict s, size_t n, const wchar_t **__restrict src, size_t wn) { register char *p; @@ -1034,7 +1034,7 @@ static const signed char new_wtbl[] = { 0, 2, 1, 2, 1, 0, 1, }; -int wcswidth(const wchar_t *pwcs, size_t n) +int attribute_hidden __wcswidth(const wchar_t *pwcs, size_t n) { int h, l, m, count; wchar_t wc; @@ -1131,7 +1131,7 @@ int wcswidth(const wchar_t *pwcs, size_t n) #else /* __UCLIBC_HAS_LOCALE__ */ -int wcswidth(const wchar_t *pwcs, size_t n) +int attribute_hidden __wcswidth(const wchar_t *pwcs, size_t n) { int count; wchar_t wc; @@ -1154,13 +1154,17 @@ int wcswidth(const wchar_t *pwcs, size_t n) #endif /* __UCLIBC_HAS_LOCALE__ */ +strong_alias(__wcswidth,wcswidth) + #endif /**********************************************************************/ #ifdef L_wcwidth +extern int __wcswidth (__const wchar_t *__s, size_t __n) attribute_hidden; + int wcwidth(wchar_t wc) { - return wcswidth(&wc, 1); + return __wcswidth(&wc, 1); } #endif diff --git a/libc/misc/wchar/wstdio.c b/libc/misc/wchar/wstdio.c index 55acc7187..6d4c2732f 100644 --- a/libc/misc/wchar/wstdio.c +++ b/libc/misc/wchar/wstdio.c @@ -50,6 +50,8 @@ */ #define wcslen __wcslen +#define wcsrtombs __wcsrtombs +#define mbrtowc __mbrtowc #define _GNU_SOURCE #include <stdio.h> diff --git a/libc/misc/wordexp/wordexp.c b/libc/misc/wordexp/wordexp.c index 979723524..da20ad0a4 100644 --- a/libc/misc/wordexp/wordexp.c +++ b/libc/misc/wordexp/wordexp.c @@ -22,6 +22,7 @@ #define mempcpy __libc_mempcpy #define strndup __strndup #define strspn __strspn +#define unsetenv __unsetenv #define _GNU_SOURCE #include <sys/cdefs.h> |