diff options
Diffstat (limited to 'libc/misc')
29 files changed, 141 insertions, 93 deletions
diff --git a/libc/misc/dirent/closedir.c b/libc/misc/dirent/closedir.c index 25c424566..8066b5861 100644 --- a/libc/misc/dirent/closedir.c +++ b/libc/misc/dirent/closedir.c @@ -4,8 +4,7 @@ #include <unistd.h> #include "dirstream.h" - -int closedir(DIR * dir) +int attribute_hidden __closedir(DIR * dir) { int fd; @@ -27,3 +26,4 @@ int closedir(DIR * dir) free(dir); return __close(fd); } +strong_alias(__closedir,closedir) diff --git a/libc/misc/dirent/dirfd.c b/libc/misc/dirent/dirfd.c index b658b5a9c..48e955450 100644 --- a/libc/misc/dirent/dirfd.c +++ b/libc/misc/dirent/dirfd.c @@ -2,7 +2,7 @@ #include <errno.h> #include "dirstream.h" -int dirfd(DIR * dir) +int attribute_hidden __dirfd(DIR * dir) { if (!dir || dir->dd_fd == -1) { __set_errno(EBADF); @@ -11,3 +11,4 @@ int dirfd(DIR * dir) return dir->dd_fd; } +strong_alias(__dirfd,dirfd) diff --git a/libc/misc/dirent/opendir.c b/libc/misc/dirent/opendir.c index fd14213a5..5c9762f85 100644 --- a/libc/misc/dirent/opendir.c +++ b/libc/misc/dirent/opendir.c @@ -11,7 +11,7 @@ /* opendir just makes an open() call - it return NULL if it fails * (open sets errno), otherwise it returns a DIR * pointer. */ -DIR *opendir(const char *name) +DIR attribute_hidden *__opendir(const char *name) { int fd; struct stat statbuf; @@ -54,3 +54,4 @@ DIR *opendir(const char *name) __pthread_mutex_init(&(ptr->dd_lock), NULL); return ptr; } +strong_alias(__opendir,opendir) diff --git a/libc/misc/dirent/scandir.c b/libc/misc/dirent/scandir.c index e80df58dc..cc76bed5e 100644 --- a/libc/misc/dirent/scandir.c +++ b/libc/misc/dirent/scandir.c @@ -21,6 +21,8 @@ */ #define qsort __qsort +#define opendir __opendir +#define closedir __closedir #include <dirent.h> #include <stdio.h> diff --git a/libc/misc/dirent/scandir64.c b/libc/misc/dirent/scandir64.c index 46b6d5cef..377f55fe6 100644 --- a/libc/misc/dirent/scandir64.c +++ b/libc/misc/dirent/scandir64.c @@ -21,6 +21,8 @@ */ #define qsort __qsort +#define opendir __opendir +#define closedir __closedir #include <features.h> #ifdef __UCLIBC_HAS_LFS__ diff --git a/libc/misc/error/err.c b/libc/misc/error/err.c index 0d0637148..922cd8aba 100644 --- a/libc/misc/error/err.c +++ b/libc/misc/error/err.c @@ -5,6 +5,8 @@ * Dedicated to Toni. See uClibc/DEDICATION.mjn3 for details. */ +#define vfprintf __vfprintf + #define _GNU_SOURCE #include <stdio.h> #include <stdlib.h> @@ -34,7 +36,7 @@ static void vwarn_work(const char *format, va_list args, int showerr) f = fmt + 11; /* At 11. */ if (showerr) { f -= 4; /* At 7. */ - __xpg_strerror_r(errno, buf, sizeof(buf)); + __xpg_strerror_r_internal(errno, buf, sizeof(buf)); } __STDIO_AUTO_THREADLOCK(stderr); @@ -49,62 +51,70 @@ static void vwarn_work(const char *format, va_list args, int showerr) __STDIO_AUTO_THREADUNLOCK(stderr); } -extern void warn(const char *format, ...) +void attribute_hidden __vwarn(const char *format, va_list args) +{ + vwarn_work(format, args, 1); +} +strong_alias(__vwarn,vwarn) + +void warn(const char *format, ...) { va_list args; va_start(args, format); - vwarn(format, args); + __vwarn(format, args); va_end(args); } -extern void vwarn(const char *format, va_list args) +void attribute_hidden __vwarnx(const char *format, va_list args) { - vwarn_work(format, args, 1); + vwarn_work(format, args, 0); } +strong_alias(__vwarnx,vwarnx) -extern void warnx(const char *format, ...) +void warnx(const char *format, ...) { va_list args; va_start(args, format); - vwarnx(format, args); + __vwarnx(format, args); va_end(args); } -extern void vwarnx(const char *format, va_list args) +void attribute_hidden __verr(int status, const char *format, va_list args) { - vwarn_work(format, args, 0); + __vwarn(format, args); + exit(status); } +strong_alias(__verr,verr) -extern void err(int status, const char *format, ...) +void attribute_noreturn err(int status, const char *format, ...) { va_list args; va_start(args, format); - verr(status, format, args); + __verr(status, format, args); /* This should get optimized away. We'll leave it now for safety. */ - va_end(args); + /* The loop is added only to keep gcc happy. */ + while(1) + va_end(args); } -extern void verr(int status, const char *format, va_list args) +void attribute_hidden __verrx(int status, const char *format, va_list args) { - vwarn(format, args); + __vwarnx(format, args); exit(status); } +strong_alias(__verrx,verrx) -extern void errx(int status, const char *format, ...) +void attribute_noreturn errx(int status, const char *format, ...) { va_list args; va_start(args, format); - verrx(status, format, args); + __verrx(status, format, args); /* This should get optimized away. We'll leave it now for safety. */ - va_end(args); -} - -extern void verrx(int status, const char *format, va_list args) -{ - vwarnx(format, args); - exit(status); + /* The loop is added only to keep gcc happy. */ + while(1) + va_end(args); } diff --git a/libc/misc/error/error.c b/libc/misc/error/error.c index 0a19e3923..5427e9568 100644 --- a/libc/misc/error/error.c +++ b/libc/misc/error/error.c @@ -23,6 +23,7 @@ /* Adjusted slightly by Erik Andersen <andersen@uclibc.org> */ #define strerror __strerror +#define vfprintf __vfprintf #include <stdio.h> #include <stdarg.h> diff --git a/libc/misc/fnmatch/fnmatch.c b/libc/misc/fnmatch/fnmatch.c index 11bb3a112..e0d9daa87 100644 --- a/libc/misc/fnmatch/fnmatch.c +++ b/libc/misc/fnmatch/fnmatch.c @@ -49,16 +49,9 @@ Cambridge, MA 02139, USA. */ # define ISUPPER(c) (ISASCII (c) && isupper (c)) -# ifndef errno -extern int errno; -# endif - /* Match STRING against the filename pattern PATTERN, returning zero if it matches, nonzero if not. */ -int fnmatch(pattern, string, flags) -const char *pattern; -const char *string; -int flags; +int attribute_hidden __fnmatch(const char *pattern, const char *string, int flags) { register const char *p = pattern, *n = string; register char c; @@ -124,7 +117,7 @@ int flags; c1 = FOLD(c1); for (--p; *n != '\0'; ++n) if ((c == '[' || FOLD(*n) == c1) && - fnmatch(p, n, flags & ~FNM_PERIOD) == 0) + __fnmatch(p, n, flags & ~FNM_PERIOD) == 0) return 0; return FNM_NOMATCH; } @@ -228,5 +221,5 @@ int flags; # undef FOLD } - +strong_alias(__fnmatch,fnmatch) #endif /* _LIBC or not __GNU_LIBRARY__. */ diff --git a/libc/misc/ftw/ftw.c b/libc/misc/ftw/ftw.c index 09a87e4be..30009def9 100644 --- a/libc/misc/ftw/ftw.c +++ b/libc/misc/ftw/ftw.c @@ -25,8 +25,13 @@ #define stpcpy __stpcpy #define tsearch __tsearch #define tdestroy __tdestroy +#define tfind __tfind #define fchdir __fchdir +#define chdir __chdir +#define dirfd __dirfd #define getcwd __getcwd +#define opendir __opendir +#define closedir __closedir #define _GNU_SOURCE #include <features.h> diff --git a/libc/misc/glob/glob.c b/libc/misc/glob/glob.c index 3fc20dbc2..d4a0b67ca 100644 --- a/libc/misc/glob/glob.c +++ b/libc/misc/glob/glob.c @@ -18,6 +18,7 @@ Cambridge, MA 02139, USA. */ #define strrchr __strrchr #define strcoll __strcoll #define qsort __qsort +#define fnmatch __fnmatch #include <features.h> #include <stdlib.h> @@ -32,6 +33,9 @@ Cambridge, MA 02139, USA. */ #define _GNU_SOURCE #include <glob.h> +extern DIR *__opendir (__const char *__name) __nonnull ((1)) attribute_hidden; +extern int __closedir (DIR *__dirp) __nonnull ((1)) attribute_hidden; + extern __ptr_t (*__glob_opendir_hook) __P ((const char *directory)); extern void (*__glob_closedir_hook) __P ((__ptr_t stream)); extern const char *(*__glob_readdir_hook) __P ((__ptr_t stream)); @@ -397,7 +401,7 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob) int meta; stream = (__glob_opendir_hook ? (*__glob_opendir_hook) (directory) - : (__ptr_t) opendir (directory)); + : (__ptr_t) __opendir (directory)); if (stream == NULL) { if ((errfunc != NULL && (*errfunc) (directory, errno)) || @@ -497,7 +501,7 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob) if (__glob_closedir_hook) (*__glob_closedir_hook) (stream); else - (void) closedir ((DIR *) stream); + (void) __closedir ((DIR *) stream); errno = save; } return nfound == 0 ? GLOB_NOMATCH : 0; @@ -508,7 +512,7 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob) if (__glob_closedir_hook) (*__glob_closedir_hook) (stream); else - (void) closedir ((DIR *) stream); + (void) __closedir ((DIR *) stream); errno = save; } while (names != NULL) diff --git a/libc/misc/internals/__uClibc_main.c b/libc/misc/internals/__uClibc_main.c index cd3b1b061..618fad74c 100644 --- a/libc/misc/internals/__uClibc_main.c +++ b/libc/misc/internals/__uClibc_main.c @@ -236,19 +236,6 @@ __uClibc_main(int (*main)(int, char **, char **), int argc, aux_dat += 2; } -#if !defined(SHARED) && defined(__UCLIBC_HAS_THREADS_NATIVE__) - { - extern void _dl_aux_init (ElfW(auxv_t) *av); - - /* - * Before we can make any pthread calls, we have to do some - * some TLS setup. This call may do more in the future. - */ - if (likely(_dl_aux_init != NULL)) - _dl_aux_init(auxvt); - } -#endif - /* We need to initialize uClibc. If we are dynamically linked this * may have already been completed by the shared lib loader. We call * __uClibc_init() regardless, to be sure the right thing happens. */ diff --git a/libc/misc/internals/errno.c b/libc/misc/internals/errno.c index 05acb7ea9..f2424eae0 100644 --- a/libc/misc/internals/errno.c +++ b/libc/misc/internals/errno.c @@ -1,15 +1,14 @@ #include <features.h> #undef errno -#ifdef __UCLIBC_HAS_THREADS_NATIVE__ -#include <tls.h> -extern int errno; -extern __thread int _h_errno; -int _errno = 0; -__thread int _h_errno; -#else extern int errno; extern int h_errno; + +#if 0 +/* Unfortunately, this doesn't work... */ +int h_errno __attribute__ ((section (".bss"))) = 0; +int errno __attribute__ ((section (".bss"))) = 0; +#else int _errno = 0; int _h_errno = 0; #endif diff --git a/libc/misc/internals/static.c b/libc/misc/internals/static.c deleted file mode 100644 index cd39ffdd7..000000000 --- a/libc/misc/internals/static.c +++ /dev/null @@ -1,4 +0,0 @@ -#include <stddef.h> - -/* Force static libraries to know about ... */ -void *__libc_stack_end=NULL; diff --git a/libc/misc/internals/tempname.c b/libc/misc/internals/tempname.c index 99a8ac0d8..fae3687ad 100644 --- a/libc/misc/internals/tempname.c +++ b/libc/misc/internals/tempname.c @@ -32,6 +32,8 @@ */ #define open64 __open64 +#define mkdir __mkdir +#define gettimeofday __gettimeofday #include <stddef.h> #include <stdint.h> @@ -61,8 +63,8 @@ static int direxists (const char *dir) for use with mk[s]temp. Will fail (-1) if DIR is non-null and doesn't exist, none of the searched dirs exists, or there's not enough space in TMPL. */ -int attribute_hidden __path_search (char *tmpl, size_t tmpl_len, const char *dir, - const char *pfx, int try_tmpdir) +int attribute_hidden ___path_search (char *tmpl, size_t tmpl_len, const char *dir, + const char *pfx /*, int try_tmpdir*/) { //const char *d; size_t dlen, plen; @@ -116,7 +118,7 @@ int attribute_hidden __path_search (char *tmpl, size_t tmpl_len, const char *dir return -1; } - sprintf (tmpl, "%.*s/%.*sXXXXXX", (int) dlen, dir, (int) plen, pfx); + __sprintf (tmpl, "%.*s/%.*sXXXXXX", (int) dlen, dir, (int) plen, pfx); return 0; } @@ -141,7 +143,7 @@ static unsigned int fillrand(unsigned char *buf, unsigned int len) static void brain_damaged_fillrand(unsigned char *buf, unsigned int len) { - int i, k; + unsigned int i, k; struct timeval tv; uint32_t high, low, rh; static uint64_t value; @@ -180,8 +182,8 @@ static void brain_damaged_fillrand(unsigned char *buf, unsigned int len) int attribute_hidden __gen_tempname (char *tmpl, int kind) { char *XXXXXX; - unsigned int k; - int len, i, count, fd, save_errno = errno; + unsigned int i, k; + int len, count, fd, save_errno = errno; unsigned char randomness[6]; len = __strlen (tmpl); diff --git a/libc/misc/internals/tempname.h b/libc/misc/internals/tempname.h index dfe9399ca..80a6cf7c1 100644 --- a/libc/misc/internals/tempname.h +++ b/libc/misc/internals/tempname.h @@ -3,8 +3,12 @@ #define __need_size_t #include <stddef.h> -extern int __path_search (char *tmpl, size_t tmpl_len, const char *dir, - const char *pfx, int try_tmpdir) attribute_hidden; + +/* Disable support for $TMPDIR */ +extern int ___path_search (char *tmpl, size_t tmpl_len, const char *dir, + const char *pfx /*, int try_tmpdir */) attribute_hidden; +#define __path_search(tmpl, tmpl_len, dir, pfx, try_tmpdir) ___path_search(tmpl, tmpl_len, dir, pfx) + extern int __gen_tempname (char *__tmpl, int __kind) attribute_hidden; /* The __kind argument to __gen_tempname may be one of: */ diff --git a/libc/misc/locale/locale.c b/libc/misc/locale/locale.c index b73ffa3dd..bf0628ee1 100644 --- a/libc/misc/locale/locale.c +++ b/libc/misc/locale/locale.c @@ -1002,7 +1002,7 @@ static const unsigned char nl_data[C_LC_ALL + 1 + 90 + 320] = { ']', '\x00', '^', '[', 'n', 'N', ']', '\x00', }; -char *nl_langinfo(nl_item item) +char attribute_hidden *__nl_langinfo(nl_item item) { unsigned int c; unsigned int i; @@ -1015,21 +1015,25 @@ char *nl_langinfo(nl_item item) } return (char *) cat_start; /* Conveniently, this is the empty string. */ } +strong_alias(__nl_langinfo,nl_langinfo) #else /* __LOCALE_C_ONLY */ #if defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE) -char *nl_langinfo(nl_item item) +extern char *__nl_langinfo_l (nl_item __item, __locale_t l) attribute_hidden; + +char attribute_hidden *__nl_langinfo(nl_item item) { return __nl_langinfo_l(item, __UCLIBC_CURLOCALE); } +strong_alias(__nl_langinfo,nl_langinfo) #else /* defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE) */ static const char empty[] = ""; -char *__XL(nl_langinfo)(nl_item item __LOCALE_PARAM ) +char attribute_hidden *__UCXL(nl_langinfo)(nl_item item __LOCALE_PARAM ) { unsigned int c = _NL_ITEM_CATEGORY(item); unsigned int i = _NL_ITEM_INDEX(item); @@ -1041,6 +1045,7 @@ char *__XL(nl_langinfo)(nl_item item __LOCALE_PARAM ) return (char *) empty; } +__UCXL_ALIAS(nl_langinfo) #endif /* defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE) */ diff --git a/libc/misc/mntent/mntent.c b/libc/misc/mntent/mntent.c index 81575a679..7e9febb1f 100644 --- a/libc/misc/mntent/mntent.c +++ b/libc/misc/mntent/mntent.c @@ -1,5 +1,6 @@ #define strtok_r __strtok_r #define strstr __strstr +#define atoi __atoi #include <stdio.h> #include <stdlib.h> diff --git a/libc/misc/regex/regex_old.c b/libc/misc/regex/regex_old.c index 1f9d37780..6bb319acd 100644 --- a/libc/misc/regex/regex_old.c +++ b/libc/misc/regex/regex_old.c @@ -31,8 +31,10 @@ #define mbrtowc __mbrtowc #define wcrtomb __wcrtomb #define wcscoll __wcscoll +#define wctype __wctype #define iswctype __iswctype #define iswalnum __iswalnum +#define printf __printf /* To exclude some unwanted junk.... */ #undef _LIBC @@ -5166,7 +5168,7 @@ PREFIX(re_search_2) (bufp, string1, size1, string2, size2, startpos, range, wchar_t *wcs_string1 = NULL, *wcs_string2 = NULL; /* We need the size of wchar_t buffers correspond to csize1, csize2. */ int wcs_size1 = 0, wcs_size2 = 0; - /* offset buffer for optimizatoin. See convert_mbs_to_wc. */ + /* offset buffer for optimization. See convert_mbs_to_wc. */ int *mbs_offset1 = NULL, *mbs_offset2 = NULL; /* They hold whether each wchar_t is binary data or not. */ char *is_binary = NULL; @@ -5696,7 +5698,7 @@ wcs_re_match_2_internal (bufp, cstring1, csize1, cstring2, csize2, pos, wchar_t *string1, *string2; /* We need the size of wchar_t buffers correspond to csize1, csize2. */ int size1, size2; - /* offset buffer for optimizatoin. See convert_mbs_to_wc. */ + /* offset buffer for optimization. See convert_mbs_to_wc. */ int *mbs_offset1, *mbs_offset2; #else /* BYTE */ static int diff --git a/libc/misc/regex/regexec.c b/libc/misc/regex/regexec.c index ab654f705..e8e2946b4 100644 --- a/libc/misc/regex/regexec.c +++ b/libc/misc/regex/regexec.c @@ -385,7 +385,7 @@ re_search_2_stub (bufp, string1, length1, string2, length2, start, range, regs, if (BE (s == NULL, 0)) return -2; -#ifdef _LIBC +#if defined _LIBC || defined __UCLIBC__ memcpy (__mempcpy (s, string1, length1), string2, length2); #else memcpy (s, string1, length1); diff --git a/libc/misc/search/lsearch.c b/libc/misc/search/lsearch.c index 4bc45ca36..4071cf1ab 100644 --- a/libc/misc/search/lsearch.c +++ b/libc/misc/search/lsearch.c @@ -14,7 +14,7 @@ #ifdef L_lfind -void *lfind(const void *key, const void *base, size_t *nmemb, +void attribute_hidden *__lfind(const void *key, const void *base, size_t *nmemb, size_t size, int (*compar)(const void *, const void *)) { register int n = *nmemb; @@ -26,17 +26,21 @@ void *lfind(const void *key, const void *base, size_t *nmemb, } return (NULL); } +strong_alias(__lfind,lfind) #endif #ifdef L_lsearch +extern void *__lfind (__const void *__key, __const void *__base, + size_t *__nmemb, size_t __size, __compar_fn_t __compar) attribute_hidden; + void *lsearch(const void *key, void *base, size_t *nmemb, size_t size, int (*compar)(const void *, const void *)) { register char *p; - if ((p = lfind(key, base, nmemb, size, compar)) == NULL) { + if ((p = __lfind(key, base, nmemb, size, compar)) == NULL) { p = __memcpy((base + (size * (*nmemb))), key, size); ++(*nmemb); } diff --git a/libc/misc/search/tsearch.c b/libc/misc/search/tsearch.c index 93a2c678f..58f16ab79 100644 --- a/libc/misc/search/tsearch.c +++ b/libc/misc/search/tsearch.c @@ -81,7 +81,7 @@ strong_alias(__tsearch,tsearch) #endif #ifdef L_tfind -void *tfind(__const void *key, void * __const *vrootp, __compar_fn_t compar) +void attribute_hidden *__tfind(__const void *key, void * __const *vrootp, __compar_fn_t compar) { register node **rootp = (node **) vrootp; @@ -99,6 +99,7 @@ void *tfind(__const void *key, void * __const *vrootp, __compar_fn_t compar) } return NULL; } +strong_alias(__tfind,tfind) #endif #ifdef L_tdelete diff --git a/libc/misc/sysvipc/ipc.h b/libc/misc/sysvipc/ipc.h index c1d4e76c5..105232fea 100644 --- a/libc/misc/sysvipc/ipc.h +++ b/libc/misc/sysvipc/ipc.h @@ -8,7 +8,7 @@ /* The actual system call: all functions are multiplexed by this. */ extern int __syscall_ipc __P((unsigned int __call, int __first, int __second, - int __third, void *__ptr)); + int __third, void *__ptr)) attribute_hidden; /* The codes for the functions to use the multiplexer `__syscall_ipc'. */ diff --git a/libc/misc/time/ftime.c b/libc/misc/time/ftime.c index 24789c9eb..904763241 100644 --- a/libc/misc/time/ftime.c +++ b/libc/misc/time/ftime.c @@ -16,6 +16,8 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#define gettimeofday __gettimeofday + #include <sys/timeb.h> #include <sys/time.h> diff --git a/libc/misc/time/time.c b/libc/misc/time/time.c index 59b3ef641..fac85638e 100644 --- a/libc/misc/time/time.c +++ b/libc/misc/time/time.c @@ -130,6 +130,7 @@ */ #define strnlen __strnlen +#define gettimeofday __gettimeofday #define _GNU_SOURCE #include <stdio.h> @@ -147,8 +148,17 @@ extern void __tzset (void) __THROW attribute_hidden; +extern long int __strtol (__const char *__restrict __nptr, + char **__restrict __endptr, int __base) + __THROW __nonnull ((1)) __wur attribute_hidden; + +extern char *__nl_langinfo (nl_item __item) __THROW attribute_hidden; + #ifdef __UCLIBC_HAS_XLOCALE__ #include <xlocale.h> +extern long int __strtol_l (__const char *__restrict __nptr, + char **__restrict __endptr, int __base, + __locale_t __loc) __THROW __nonnull ((1, 4)) __wur attribute_hidden; extern int __strncasecmp_l (__const char *__s1, __const char *__s2, size_t __n, __locale_t __loc) __THROW __attribute_pure__ __nonnull ((1, 2, 4)) attribute_hidden; @@ -160,6 +170,8 @@ extern size_t __strftime_l (char *__restrict __s, size_t __maxsize, extern char *__strptime_l (__const char *__restrict __s, __const char *__restrict __fmt, struct tm *__tp, __locale_t __loc) __THROW attribute_hidden; + +extern char *__nl_langinfo_l (nl_item __item, __locale_t l) attribute_hidden; #endif #ifndef __isleap @@ -266,7 +278,7 @@ strong_alias(__asctime,asctime) * }; * static char result[26]; * - * sprintf(result, "%.3s %.3s%3d %.2d:%.2d:%.2d %d\n", + * __sprintf(result, "%.3s %.3s%3d %.2d:%.2d:%.2d %d\n", * wday_name[timeptr->tm_wday], * mon_name[timeptr->tm_mon], * timeptr->tm_mday, timeptr->tm_hour, @@ -1044,7 +1056,7 @@ size_t attribute_hidden __UCXL(strftime)(char *__restrict s, size_t maxsize, + (code & 7); #ifdef ENABLE_ERA_CODE if ((mod & NO_E_MOD) /* Actually, this means E modifier present. */ - && (*(o = __XL(nl_langinfo)(_NL_ITEM(LC_TIME, + && (*(o = __UCXL(nl_langinfo)(_NL_ITEM(LC_TIME, (int)(((unsigned char *)p)[4])) __LOCALE_ARG ))) @@ -1053,7 +1065,7 @@ size_t attribute_hidden __UCXL(strftime)(char *__restrict s, size_t maxsize, goto LOOP; } #endif - p = __XL(nl_langinfo)(_NL_ITEM(LC_TIME, + p = __UCXL(nl_langinfo)(_NL_ITEM(LC_TIME, (int)(*((unsigned char *)p))) __LOCALE_ARG ); @@ -1230,7 +1242,7 @@ size_t attribute_hidden __UCXL(strftime)(char *__restrict s, size_t maxsize, if ((code & MASK_SPEC) == STRING_SPEC) { o_count = SIZE_MAX; field_val += spec[STRINGS_NL_ITEM_START + (code & 0xf)]; - o = __XL(nl_langinfo)(_NL_ITEM(LC_TIME, field_val) __LOCALE_ARG ); + o = __UCXL(nl_langinfo)(_NL_ITEM(LC_TIME, field_val) __LOCALE_ARG ); } else { o_count = ((i >> 1) & 3) + 1; o = buf + o_count; @@ -1491,7 +1503,7 @@ char attribute_hidden *__UCXL(strptime)(const char *__restrict buf, const char * + (code & 7); #ifdef ENABLE_ERA_CODE if ((mod & NO_E_MOD) /* Actually, this means E modifier present. */ - && (*(o = __XL(nl_langinfo)(_NL_ITEM(LC_TIME, + && (*(o = __UCXL(nl_langinfo)(_NL_ITEM(LC_TIME, (int)(((unsigned char *)p)[4])) __LOCALE_ARG ))) @@ -1500,7 +1512,7 @@ char attribute_hidden *__UCXL(strptime)(const char *__restrict buf, const char * goto LOOP; } #endif - p = __XL(nl_langinfo)(_NL_ITEM(LC_TIME, + p = __UCXL(nl_langinfo)(_NL_ITEM(LC_TIME, (int)(*((unsigned char *)p))) __LOCALE_ARG ); goto LOOP; @@ -1515,7 +1527,7 @@ char attribute_hidden *__UCXL(strptime)(const char *__restrict buf, const char * /* Go backwards to check full names before abreviations. */ do { --j; - o = __XL(nl_langinfo)(i+j __LOCALE_ARG); + o = __UCXL(nl_langinfo)(i+j __LOCALE_ARG); if (!__UCXL(strncasecmp)(buf,o,__strlen(o) __LOCALE_ARG) && *o) { do { /* Found a match. */ ++buf; @@ -1544,9 +1556,9 @@ char attribute_hidden *__UCXL(strptime)(const char *__restrict buf, const char * __set_errno(0); if (!ISSPACE(*buf)) { /* Signal an error if whitespace. */ #ifdef TIME_T_IS_UNSIGNED - t = __XL(strtoul)(buf, &o, 10 __LOCALE_ARG); + t = __UCXL(strtoul)(buf, &o, 10 __LOCALE_ARG); #else - t = __XL(strtol)(buf, &o, 10 __LOCALE_ARG); + t = __UCXL(strtol)(buf, &o, 10 __LOCALE_ARG); #endif } if ((o == buf) || errno) { /* Not a number or overflow. */ diff --git a/libc/misc/ttyent/getttyent.c b/libc/misc/ttyent/getttyent.c index 04f511921..8e104733c 100644 --- a/libc/misc/ttyent/getttyent.c +++ b/libc/misc/ttyent/getttyent.c @@ -28,6 +28,7 @@ */ #define __fsetlocking __fsetlocking_internal +#define rewind __rewind #define _GNU_SOURCE #include <features.h> diff --git a/libc/misc/utmp/wtent.c b/libc/misc/utmp/wtent.c index 0900ef379..bfedeaa70 100644 --- a/libc/misc/utmp/wtent.c +++ b/libc/misc/utmp/wtent.c @@ -17,6 +17,8 @@ * write to the Free Software Foundation, Inc., 675 Mass Ave, * Cambridge, MA 02139, USA. */ +#define gettimeofday __gettimeofday + #include <string.h> #include <sys/time.h> #include <time.h> diff --git a/libc/misc/wchar/wchar.c b/libc/misc/wchar/wchar.c index 1a16fc9d6..0d7d8371a 100644 --- a/libc/misc/wchar/wchar.c +++ b/libc/misc/wchar/wchar.c @@ -98,6 +98,10 @@ * Manuel */ +#define vfprintf __vfprintf +#define fread __fread +#define fwrite __fwrite + #define _GNU_SOURCE #define _ISOC99_SOURCE #include <errno.h> diff --git a/libc/misc/wctype/wctype.c b/libc/misc/wctype/wctype.c index 77d7572da..8ef373205 100644 --- a/libc/misc/wctype/wctype.c +++ b/libc/misc/wctype/wctype.c @@ -48,7 +48,7 @@ extern wctype_t __wctype (__const char *__property) attribute_hidden; #include <xlocale.h> extern wint_t __towlower_l(wint_t __wc, __locale_t __locale) __THROW; extern wint_t __towupper_l(wint_t __wc, __locale_t __locale) __THROW; -//extern int __iswctype_l(wint_t __wc, wctype_t __desc, __locale_t __locale) __THROW attribute_hidden; +extern int __iswctype_l(wint_t __wc, wctype_t __desc, __locale_t __locale) __THROW attribute_hidden; extern wint_t __towctrans_l(wint_t __wc, wctrans_t __desc, __locale_t __locale) __THROW; #endif /* __UCLIBC_HAS_XLOCALE__ */ diff --git a/libc/misc/wordexp/wordexp.c b/libc/misc/wordexp/wordexp.c index d8bf785d3..e76d6a63a 100644 --- a/libc/misc/wordexp/wordexp.c +++ b/libc/misc/wordexp/wordexp.c @@ -31,6 +31,13 @@ #define getpwuid_r __getpwuid_r #define execve __execve #define dup2 __dup2 +#define atoi __atoi +#define fnmatch __fnmatch +#define pipe __pipe +#if 0 +#define glob __glob +#define globfree __globfree +#endif #define _GNU_SOURCE #include <sys/cdefs.h> @@ -503,7 +510,7 @@ static int eval_expr(char *expr, long int *result); static char *_itoa(unsigned long long int value, char *buflim) { - sprintf(buflim, "%llu", value); + __sprintf(buflim, "%llu", value); return buflim; } |