diff options
Diffstat (limited to 'libc')
40 files changed, 505 insertions, 366 deletions
diff --git a/libc/inet/ntop.c b/libc/inet/ntop.c index 0181a415c..30dde6f9c 100644 --- a/libc/inet/ntop.c +++ b/libc/inet/ntop.c @@ -105,7 +105,7 @@ inet_ntop6(const u_char *src, char *dst, size_t size) * to use pointer overlays. All the world's not a VAX. */ char tmp[sizeof ("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")], *tp; - struct { int base, len; } best, cur; + struct { int base, len; } best = { 0, 0 }, cur = { 0, 0 }; u_int words[8]; int i; diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c index 31e63810b..fffe4281c 100644 --- a/libc/inet/resolv.c +++ b/libc/inet/resolv.c @@ -2178,7 +2178,6 @@ int gethostbyname_r(const char *name, return i; } libc_hidden_def(gethostbyname_r) -link_warning(gethostbyname_r, "gethostbyname_r is obsolescent, use getnameinfo() instead."); #endif /* L_gethostbyname_r */ @@ -2496,7 +2495,6 @@ int gethostbyaddr_r(const void *addr, socklen_t addrlen, #undef in6 } libc_hidden_def(gethostbyaddr_r) -link_warning(gethostbyaddr_r, "gethostbyaddr_r is obsolescent, use getaddrinfo() instead."); #endif /* L_gethostbyaddr_r */ @@ -2616,7 +2614,6 @@ struct hostent *gethostbyname(const char *name) #endif } libc_hidden_def(gethostbyname) -link_warning(gethostbyname, "gethostbyname is obsolescent, use getnameinfo() instead."); #endif /* L_gethostbyname */ @@ -2638,7 +2635,6 @@ struct hostent *gethostbyaddr(const void *addr, socklen_t len, int type) return hp; } libc_hidden_def(gethostbyaddr) -link_warning(gethostbyaddr, "gethostbyaddr is obsolescent, use getaddrinfo() instead."); #endif /* L_gethostbyaddr */ diff --git a/libc/misc/regex/regex_internal.c b/libc/misc/regex/regex_internal.c index f9412d663..c74c6a0c3 100644 --- a/libc/misc/regex/regex_internal.c +++ b/libc/misc/regex/regex_internal.c @@ -650,15 +650,8 @@ re_string_reconstruct (re_string_t *pstr, int idx, int eflags) mbstate_t cur_state; wchar_t wc2; int mlen = raw + pstr->len - p; - unsigned char buf[6]; size_t mbclen; - if (BE (pstr->trans != NULL, 0)) - { - int i = mlen < 6 ? mlen : 6; - while (--i >= 0) - buf[i] = pstr->trans[p[i]]; - } /* XXX Don't use mbrtowc, we know which conversion to use (UTF-8 -> UCS4). */ memset (&cur_state, 0, sizeof (cur_state)); diff --git a/libc/signal/siggetmask.c b/libc/signal/siggetmask.c index ce8f40289..c05a53c48 100644 --- a/libc/signal/siggetmask.c +++ b/libc/signal/siggetmask.c @@ -24,6 +24,3 @@ siggetmask (void) { return sigblock (0); } - -link_warning (siggetmask, - "warning: `siggetmask' is obsolete; `sigprocmask' is best") diff --git a/libc/stdio/__fpending.c b/libc/stdio/__fpending.c index a7fe05463..e7e33e80a 100644 --- a/libc/stdio/__fpending.c +++ b/libc/stdio/__fpending.c @@ -18,13 +18,6 @@ * convert wide chars to their multibyte encodings and buffer _those_. */ -#ifdef __UCLIBC_HAS_WCHAR__ -#warning Note: Unlike the glibc version, this __fpending returns bytes in buffer for wide streams too! - -link_warning(__fpending, "This version of __fpending returns bytes remaining in buffer for both narrow and wide streams. glibc's version returns wide chars in buffer for the wide stream case.") - -#endif - size_t __fpending(register FILE * __restrict stream) { __STDIO_STREAM_VALIDATE(stream); diff --git a/libc/stdio/_scanf.c b/libc/stdio/_scanf.c index 6ecb3cb1e..d48fd1267 100644 --- a/libc/stdio/_scanf.c +++ b/libc/stdio/_scanf.c @@ -553,9 +553,8 @@ enum { /**********************************************************************/ #ifdef L_vfwscanf -/* FIXME: "warning: the right operand of ">" changes sign when promoted" */ -#if WINT_MIN > EOF -#error Unfortunately, we currently need wint_t to be able to store EOF. Sorry. +#if WINT_MIN > WEOF +#error Unfortunately, we currently need wint_t to be able to store WEOF. Sorry. #endif #define W_EOF WEOF #define Wint wint_t @@ -1144,7 +1143,7 @@ int VFSCANF (FILE *__restrict fp, const Wchar *__restrict format, va_list arg) unsigned char buf[MAX_DIGITS+2]; #ifdef L_vfscanf unsigned char scanset[UCHAR_MAX + 1]; - unsigned char invert; /* Careful! Meaning changes. */ + unsigned char invert = 0; /* Careful! Meaning changes. */ #endif /* L_vfscanf */ unsigned char fail; unsigned char zero_conversions = 1; diff --git a/libc/stdio/_stdio.c b/libc/stdio/_stdio.c index 388a2117c..ee247a5fd 100644 --- a/libc/stdio/_stdio.c +++ b/libc/stdio/_stdio.c @@ -195,7 +195,6 @@ void _stdio_term(void) * chain might be corrupt due to a partial store. */ STDIO_INIT_MUTEX(_stdio_openlist_add_lock); -#warning check #ifdef __STDIO_BUFFERS STDIO_INIT_MUTEX(_stdio_openlist_del_lock); #endif diff --git a/libc/stdio/fflush.c b/libc/stdio/fflush.c index d9104a42f..cf0356a38 100644 --- a/libc/stdio/fflush.c +++ b/libc/stdio/fflush.c @@ -97,8 +97,6 @@ int fflush_unlocked(register FILE *stream) while(stream) { /* We only care about currently writing streams and do not want to * block trying to obtain mutexes on non-writing streams. */ -#warning fix for nonatomic -#warning unnecessary check if no threads if (__STDIO_STREAM_IS_WRITING(stream)) { /* ONLY IF ATOMIC!!! */ __MY_STDIO_THREADLOCK(stream); /* Need to check again once we have the lock. */ diff --git a/libc/stdio/gets.c b/libc/stdio/gets.c index 515e966d1..9f4b751a1 100644 --- a/libc/stdio/gets.c +++ b/libc/stdio/gets.c @@ -7,8 +7,6 @@ #include "_stdio.h" -link_warning(gets, "the 'gets' function is dangerous and should not be used.") - /* UNSAFE FUNCTION -- do not bother optimizing */ /* disable macro, force actual function call */ diff --git a/libc/stdio/popen.c b/libc/stdio/popen.c index 40a6ddac1..e1b1d4038 100644 --- a/libc/stdio/popen.c +++ b/libc/stdio/popen.c @@ -124,8 +124,6 @@ FILE *popen(const char *command, const char *modes) return NULL; } -#warning is pclose correct wrt the new mutex semantics? - int pclose(FILE *stream) { struct popen_list_item *p; diff --git a/libc/stdio/tempnam.c b/libc/stdio/tempnam.c index 74bb26ed5..5ef199ef4 100644 --- a/libc/stdio/tempnam.c +++ b/libc/stdio/tempnam.c @@ -40,5 +40,3 @@ tempnam (const char *dir, const char *pfx) return strdup (buf); } - -link_warning (tempnam, "the use of OBSOLESCENT `tempnam' is discouraged, use `mkstemp'") diff --git a/libc/stdio/tmpnam.c b/libc/stdio/tmpnam.c index ffed862c1..52997d365 100644 --- a/libc/stdio/tmpnam.c +++ b/libc/stdio/tmpnam.c @@ -48,5 +48,3 @@ tmpnam (char *s) return s; } - -link_warning (tmpnam, "the use of `tmpnam' is dangerous, better use `mkstemp'") diff --git a/libc/stdio/tmpnam_r.c b/libc/stdio/tmpnam_r.c index bfd60a437..3cc48b094 100644 --- a/libc/stdio/tmpnam_r.c +++ b/libc/stdio/tmpnam_r.c @@ -32,4 +32,3 @@ char * tmpnam_r (char *s) return s; } -link_warning (tmpnam_r, "the use of OBSOLESCENT `tmpnam_r' is discouraged, use `mkstemp'") diff --git a/libc/stdlib/malloc/realloc.c b/libc/stdlib/malloc/realloc.c index 8de00665f..8d55289c5 100644 --- a/libc/stdlib/malloc/realloc.c +++ b/libc/stdlib/malloc/realloc.c @@ -30,7 +30,7 @@ realloc (void *mem, size_t new_size) if (! new_size) { free (mem); - return malloc (new_size); + return NULL; } if (! mem) return malloc (new_size); diff --git a/libc/stdlib/mktemp.c b/libc/stdlib/mktemp.c index 1ff93da3c..403596645 100644 --- a/libc/stdlib/mktemp.c +++ b/libc/stdlib/mktemp.c @@ -30,5 +30,3 @@ char *mktemp(char *template) return template; } - -link_warning(mktemp, "the use of `mktemp' is dangerous, better use `mkstemp'") diff --git a/libc/stdlib/system.c b/libc/stdlib/system.c index 3ef9a8b1c..8a6734db7 100644 --- a/libc/stdlib/system.c +++ b/libc/stdlib/system.c @@ -20,11 +20,7 @@ extern __typeof(system) __libc_system; #if !defined __UCLIBC_HAS_THREADS_NATIVE__ -/* uClinux-2.0 has vfork, but Linux 2.0 doesn't */ #include <sys/syscall.h> -#ifndef __NR_vfork -# define vfork fork -#endif int __libc_system(const char *command) { @@ -91,9 +87,6 @@ libc_hidden_proto(waitpid) #elif defined __sparc__ # define FORK() \ INLINE_CLONE_SYSCALL (CLONE_PARENT_SETTID | SIGCHLD, 0, &pid, NULL, NULL) -#elif defined __s390__ -# define FORK() \ - INLINE_SYSCALL (clone, 3, 0, CLONE_PARENT_SETTID | SIGCHLD, &pid) #else # define FORK() \ INLINE_SYSCALL (clone, 3, CLONE_PARENT_SETTID | SIGCHLD, 0, &pid) diff --git a/libc/string/sys_errlist.c b/libc/string/sys_errlist.c index 17ed4d62c..682ff0e7e 100644 --- a/libc/string/sys_errlist.c +++ b/libc/string/sys_errlist.c @@ -12,8 +12,6 @@ extern const char _string_syserrmsgs[] attribute_hidden; #ifdef __UCLIBC_HAS_SYS_ERRLIST__ -link_warning(_sys_errlist, "sys_nerr and sys_errlist are obsolete and uClibc support for them (in at least some configurations) will probably be unavailable in the near future.") - const char *const sys_errlist[] = { [0] = _string_syserrmsgs + 0, [EPERM] = _string_syserrmsgs + 8, diff --git a/libc/sysdeps/linux/arm/bits/syscalls.h b/libc/sysdeps/linux/arm/bits/syscalls.h index 5544ca652..e447a7b2d 100644 --- a/libc/sysdeps/linux/arm/bits/syscalls.h +++ b/libc/sysdeps/linux/arm/bits/syscalls.h @@ -43,41 +43,7 @@ }) \ ) -#if !defined(__thumb__) -#if defined(__ARM_EABI__) -#define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \ -(__extension__ \ - ({unsigned int __internal_sys_result; \ - { \ - register int __a1 __asm__ ("r0"), _nr __asm__ ("r7"); \ - LOAD_ARGS_##nr (args) \ - _nr = (name); \ - __asm__ __volatile__ ("swi 0x0 @ syscall " #name \ - : "=r" (__a1) \ - : "r" (_nr) ASM_ARGS_##nr \ - : "memory"); \ - __internal_sys_result = __a1; \ - } \ - (int) __internal_sys_result; }) \ -) -#else /* defined(__ARM_EABI__) */ - -#define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \ -(__extension__ \ - ({ unsigned int __internal_sys_result; \ - { \ - register int __a1 __asm__ ("a1"); \ - LOAD_ARGS_##nr (args) \ - __asm__ __volatile__ ("swi %1 @ syscall " #name \ - : "=r" (__a1) \ - : "i" (name) ASM_ARGS_##nr \ - : "memory"); \ - __internal_sys_result = __a1; \ - } \ - (int) __internal_sys_result; }) \ -) -#endif -#else /* !defined(__thumb__) */ +#if defined(__thumb__) /* We can't use push/pop inside the asm because that breaks unwinding (ie. thread cancellation). */ @@ -101,7 +67,23 @@ } \ (int) __internal_sys_result; }) \ ) -#endif /*!defined(__thumb__)*/ +#else /* ARM */ +#define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \ +(__extension__ \ + ({unsigned int __internal_sys_result; \ + { \ + register int __a1 __asm__ ("r0"), _nr __asm__ ("r7"); \ + LOAD_ARGS_##nr (args) \ + _nr = (name); \ + __asm__ __volatile__ ("swi 0x0 @ syscall " #name \ + : "=r" (__a1) \ + : "r" (_nr) ASM_ARGS_##nr \ + : "memory"); \ + __internal_sys_result = __a1; \ + } \ + (int) __internal_sys_result; }) \ +) +#endif #define INTERNAL_SYSCALL_ERROR_P(val, err) \ ((unsigned int) (val) >= 0xfffff001u) @@ -138,12 +120,13 @@ LOAD_ARGS_5 (a1, a2, a3, a4, a5) \ register int __v2 __asm__ ("v2") = __v2tmp; #define ASM_ARGS_6 ASM_ARGS_5, "r" (__v2) +#ifndef __thumb__ #define LOAD_ARGS_7(a1, a2, a3, a4, a5, a6, a7) \ int __v3tmp = (int) (a7); \ LOAD_ARGS_6 (a1, a2, a3, a4, a5, a6) \ register int __v3 __asm__ ("v3") = __v3tmp; #define ASM_ARGS_7 ASM_ARGS_6, "r" (__v3) - +#endif #endif /* __ASSEMBLER__ */ #endif /* _BITS_SYSCALLS_H */ diff --git a/libc/sysdeps/linux/arm/clone.S b/libc/sysdeps/linux/arm/clone.S index 03cd10e62..d1c9239da 100644 --- a/libc/sysdeps/linux/arm/clone.S +++ b/libc/sysdeps/linux/arm/clone.S @@ -19,6 +19,7 @@ /* clone() is even more special than fork() as it mucks with stacks and invokes a function in the right context after its all over. */ +#include <sysdep.h> #define _ERRNO_H #include <features.h> #include <bits/errno.h> @@ -26,6 +27,13 @@ #include <bits/arm_asm.h> #include <bits/arm_bx.h> +#if defined __UCLIBC_HAS_THREADS__ && !defined __LINUXTHREADS_OLD__ +#include <sysdep-cancel.h> +#endif + +#define CLONE_VM 0x00000100 +#define CLONE_THREAD 0x00010000 + #if defined(__NR_clone) /* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg); */ @@ -52,23 +60,22 @@ __clone: @ get flags mov r0, r2 @ new sp is already in r1 - @ load remaining arguments off the stack - stmfd sp!, {r4} - ldr r2, [sp, #4] - ldr r3, [sp, #8] - ldr r4, [sp, #12] DO_CALL (clone) movs a1, a1 blt __error - ldmnefd sp!, {r4} beq 1f bx lr 1: @ pick the function arg and call address off the stack and execute ldr r0, [sp, #4] +#if defined(__USE_BX__) ldr r1, [sp] bl 2f @ blx r1 +#else + mov lr, pc + ldr pc, [sp] +#endif @ and we are done, passing the return value through r0 bl HIDDEN_JUMPTARGET(_exit) @@ -87,6 +94,8 @@ __error: .pool #else __clone: +.fnstart +.cantunwind @ sanity check args cmp r0, #0 IT(te, ne) @@ -95,32 +104,58 @@ __clone: beq __error @ insert the args onto the new stack - sub r1, r1, #8 - str r3, [r1, #4] - @ save the function pointer as the 0th element - str r0, [r1] + str r3, [r1, #-4]! + str r0, [r1, #-4]! @ do the system call @ get flags mov r0, r2 +#ifdef RESET_PID + mov ip, r2 +#endif @ new sp is already in r1 - @ load remaining arguments off the stack - stmfd sp!, {r4} - ldr r2, [sp, #4] - ldr r3, [sp, #8] - ldr r4, [sp, #12] - DO_CALL (clone) - movs a1, a1 - IT(t, ne) - ldmnefd sp!, {r4} + push {r4, r7} + cfi_adjust_cfa_offset (8) + cfi_rel_offset (r4, 0) + cfi_rel_offset (r7, 4) + ldr r2, [sp, #8] + ldr r3, [sp, #12] + ldr r4, [sp, #16] + ldr r7, =SYS_ify(clone) + swi 0x0 + cfi_endproc + cmp r0, #0 + beq 1f + pop {r4, r7} blt __error - IT(t, ne) #if defined(__USE_BX__) bxne lr #else movne pc, lr #endif + cfi_startproc +.fnend +PSEUDO_END (__clone) + +1: + .fnstart + .cantunwind +#ifdef RESET_PID + tst ip, #CLONE_THREAD + bne 3f + GET_TLS (lr) + mov r1, r0 + tst ip, #CLONE_VM + ldr r7, =SYS_ify(getpid) + ite ne + movne r0, #-1 + swieq 0x0 + NEGOFF_ADJ_BASE (r1, TID_OFFSET) + str r0, NEGOFF_OFF1 (r1, TID_OFFSET) + str r0, NEGOFF_OFF2 (r1, PID_OFFSET, TID_OFFSET) +3: +#endif @ pick the function arg and call address off the stack and execute ldr r0, [sp, #4] mov lr, pc diff --git a/libc/sysdeps/linux/arm/sysdep.h b/libc/sysdeps/linux/arm/sysdep.h index 64f40407e..2d0a9cc41 100644 --- a/libc/sysdeps/linux/arm/sysdep.h +++ b/libc/sysdeps/linux/arm/sysdep.h @@ -213,6 +213,42 @@ __local_syscall_error: \ sees the right arguments. */ +#if __ARM_ARCH > 6 || defined (__ARM_ARCH_6K__) || defined (__ARM_ARCH_6ZK__) +# define ARCH_HAS_HARD_TP +#endif + +# ifdef __thumb2__ +# define NEGOFF_ADJ_BASE(R, OFF) add R, R, $OFF +# define NEGOFF_ADJ_BASE2(D, S, OFF) add D, S, $OFF +# define NEGOFF_OFF1(R, OFF) [R] +# define NEGOFF_OFF2(R, OFFA, OFFB) [R, $((OFFA) - (OFFB))] +# else +# define NEGOFF_ADJ_BASE(R, OFF) +# define NEGOFF_ADJ_BASE2(D, S, OFF) mov D, S +# define NEGOFF_OFF1(R, OFF) [R, $OFF] +# define NEGOFF_OFF2(R, OFFA, OFFB) [R, $OFFA] +# endif + +# ifdef ARCH_HAS_HARD_TP +/* If the cpu has cp15 available, use it. */ +# define GET_TLS(TMP) mrc p15, 0, r0, c13, c0, 3 +# else +/* At this generic level we have no tricks to pull. Call the ABI routine. */ +# define GET_TLS(TMP) \ + push { r1, r2, r3, lr }; \ + cfi_remember_state; \ + cfi_adjust_cfa_offset (16); \ + cfi_rel_offset (r1, 0); \ + cfi_rel_offset (r2, 4); \ + cfi_rel_offset (r3, 8); \ + cfi_rel_offset (lr, 12); \ + bl __aeabi_read_tp; \ + pop { r1, r2, r3, lr }; \ + cfi_restore_state +# endif /* ARCH_HAS_HARD_TP */ + + + #undef DO_CALL #if defined(__ARM_EABI__) diff --git a/libc/sysdeps/linux/common/bits/mathcalls.h b/libc/sysdeps/linux/common/bits/mathcalls.h index 9bebb5190..3d7e34fa2 100644 --- a/libc/sysdeps/linux/common/bits/mathcalls.h +++ b/libc/sysdeps/linux/common/bits/mathcalls.h @@ -291,7 +291,9 @@ __END_NAMESPACE_C99 #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* True gamma function. */ +# ifndef _Mdouble_is_float_ __MATHCALLI (tgamma,, (_Mdouble_)) +# endif __END_NAMESPACE_C99 #endif @@ -322,7 +324,9 @@ __MATHCALLX (nextafter,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)) libm_hidden_proto(nextafterl) # endif # if defined __USE_ISOC99 && !defined __LDBL_COMPAT +# ifndef _Mdouble_is_float_ __MATHCALLX (nexttoward,, (_Mdouble_ __x, long double __y), (__const__)) +# endif # endif /* Return the remainder of integer divison X / Y with infinite precision. */ @@ -339,11 +343,15 @@ __MATHDECLI (int,ilogb,, (_Mdouble_ __x)) #ifdef __USE_ISOC99 /* Return X times (2 to the Nth power). */ +# ifndef _Mdouble_is_float_ __MATHCALLI (scalbln,, (_Mdouble_ __x, long int __n)) +# endif /* Round X to integral value in floating-point format using current rounding direction, but do not raise inexact exception. */ +# ifndef _Mdouble_is_float_ __MATHCALLI (nearbyint,, (_Mdouble_ __x)) +# endif /* Round X to nearest integral value, rounding halfway cases away from zero. */ @@ -356,7 +364,9 @@ __MATHCALLX (trunc,, (_Mdouble_ __x), (__const__)) /* Compute remainder of X and Y and put in *QUO a value with sign of x/y and magnitude congruent `mod 2^n' to the magnitude of the integral quotient x/y, with n >= 3. */ +# ifndef _Mdouble_is_float_ __MATHCALLI (remquo,, (_Mdouble_ __x, _Mdouble_ __y, int *__quo)) +# endif /* Conversion functions. */ @@ -373,13 +383,19 @@ __MATHDECLI (long long int,llround,, (_Mdouble_ __x)) /* Return positive difference between X and Y. */ +# ifndef _Mdouble_is_float_ __MATHCALLI (fdim,, (_Mdouble_ __x, _Mdouble_ __y)) +# endif /* Return maximum numeric value from X and Y. */ +# ifndef _Mdouble_is_float_ __MATHCALLI (fmax,, (_Mdouble_ __x, _Mdouble_ __y)) +# endif /* Return minimum numeric value from X and Y. */ +# ifndef _Mdouble_is_float_ __MATHCALLI (fmin,, (_Mdouble_ __x, _Mdouble_ __y)) +# endif /* Classify given number. */ @@ -390,7 +406,9 @@ __MATHDECL_PRIV (int, signbit,, (_Mdouble_ __value), (__const__)) /* Multiply-add function computed as a ternary operation. */ +# ifndef _Mdouble_is_float_ __MATHCALLI (fma,, (_Mdouble_ __x, _Mdouble_ __y, _Mdouble_ __z)) +# endif #endif /* Use ISO C99. */ #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 diff --git a/libc/sysdeps/linux/common/bits/uClibc_fpmax.h b/libc/sysdeps/linux/common/bits/uClibc_fpmax.h index bbea1ae9d..b7dcee1d3 100644 --- a/libc/sysdeps/linux/common/bits/uClibc_fpmax.h +++ b/libc/sysdeps/linux/common/bits/uClibc_fpmax.h @@ -68,10 +68,6 @@ typedef float __fpmax_t; #ifndef DECIMAL_DIG -#ifdef L___strtofpmax -/* Emit warning only once. */ -#warning DECIMAL_DIG is not defined! If you are using gcc, it may not be defining __STDC_VERSION__ as it should. -#endif #if !defined(FLT_RADIX) || (FLT_RADIX != 2) #error unable to compensate for missing DECIMAL_DIG! #endif diff --git a/libc/sysdeps/linux/common/fstatat64.c b/libc/sysdeps/linux/common/fstatat64.c index 015f57d13..711521a6a 100644 --- a/libc/sysdeps/linux/common/fstatat64.c +++ b/libc/sysdeps/linux/common/fstatat64.c @@ -10,10 +10,18 @@ #include <bits/wordsize.h> #include <sys/syscall.h> +#if defined __mips__ +# include <sgidefs.h> +#endif + /* 64bit ports tend to favor newfstatat() */ #if __WORDSIZE == 64 && defined __NR_newfstatat # define __NR_fstatat64 __NR_newfstatat #endif +/* mips N32 ABI use newfstatat(), too */ +#if defined __mips__ && _MIPS_SIM == _ABIN32 +# define __NR_fstatat64 __NR_newfstatat +#endif #ifdef __NR_fstatat64 # include <sys/stat.h> diff --git a/libc/sysdeps/linux/common/setreuid.c b/libc/sysdeps/linux/common/setreuid.c index a9eea6dc4..583a987c0 100644 --- a/libc/sysdeps/linux/common/setreuid.c +++ b/libc/sysdeps/linux/common/setreuid.c @@ -37,4 +37,4 @@ int setreuid(uid_t ruid, uid_t euid) } #endif -libc_hidden_def(setreuid) +libc_hidden_weak(setreuid) diff --git a/libc/sysdeps/linux/common/sync_file_range.c b/libc/sysdeps/linux/common/sync_file_range.c index db797de62..52bc9d7af 100644 --- a/libc/sysdeps/linux/common/sync_file_range.c +++ b/libc/sysdeps/linux/common/sync_file_range.c @@ -24,6 +24,9 @@ static int __NC(sync_file_range)(int fd, off64_t offset, off64_t nbytes, unsigne |