summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux/common')
-rw-r--r--libc/sysdeps/linux/common/bits/mathcalls.h18
-rw-r--r--libc/sysdeps/linux/common/bits/uClibc_fpmax.h4
-rw-r--r--libc/sysdeps/linux/common/fstatat64.c8
-rw-r--r--libc/sysdeps/linux/common/setregid.c2
-rw-r--r--libc/sysdeps/linux/common/setresgid.c4
-rw-r--r--libc/sysdeps/linux/common/setresuid.c4
-rw-r--r--libc/sysdeps/linux/common/setreuid.c2
-rw-r--r--libc/sysdeps/linux/common/sync_file_range.c3
-rw-r--r--libc/sysdeps/linux/common/utime.c1
-rw-r--r--libc/sysdeps/linux/common/xstatconv.c27
10 files changed, 53 insertions, 20 deletions
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/setregid.c b/libc/sysdeps/linux/common/setregid.c
index 15d590a68..aaa729379 100644
--- a/libc/sysdeps/linux/common/setregid.c
+++ b/libc/sysdeps/linux/common/setregid.c
@@ -37,4 +37,4 @@ int setregid(gid_t rgid, gid_t egid)
}
#endif
-libc_hidden_def(setregid)
+libc_hidden_weak(setregid)
diff --git a/libc/sysdeps/linux/common/setresgid.c b/libc/sysdeps/linux/common/setresgid.c
index 95decc29e..b6d1647db 100644
--- a/libc/sysdeps/linux/common/setresgid.c
+++ b/libc/sysdeps/linux/common/setresgid.c
@@ -16,7 +16,7 @@
# define __NR_setresgid __NR_setresgid32
_syscall3(int, setresgid, gid_t, rgid, gid_t, egid, gid_t, sgid)
-libc_hidden_def(setresgid)
+libc_hidden_weak(setresgid)
#elif defined(__NR_setresgid)
@@ -34,7 +34,7 @@ int setresgid(gid_t rgid, gid_t egid, gid_t sgid)
}
return (__syscall_setresgid(rgid, egid, sgid));
}
-libc_hidden_def(setresgid)
+libc_hidden_weak(setresgid)
#endif
diff --git a/libc/sysdeps/linux/common/setresuid.c b/libc/sysdeps/linux/common/setresuid.c
index 022ccfe64..a2a218332 100644
--- a/libc/sysdeps/linux/common/setresuid.c
+++ b/libc/sysdeps/linux/common/setresuid.c
@@ -16,7 +16,7 @@
# define __NR_setresuid __NR_setresuid32
_syscall3(int, setresuid, uid_t, ruid, uid_t, euid, uid_t, suid)
-libc_hidden_def(setresuid)
+libc_hidden_weak(setresuid)
#elif defined(__NR_setresuid)
@@ -34,7 +34,7 @@ int setresuid(uid_t ruid, uid_t euid, uid_t suid)
}
return (__syscall_setresuid(ruid, euid, suid));
}
-libc_hidden_def(setresuid)
+libc_hidden_weak(setresuid)
#endif
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
{
# if defined __powerpc__ && __WORDSIZE == 64
return INLINE_SYSCALL(sync_file_range, 4, fd, flags, offset, nbytes);
+# elif defined __arm__ && defined __thumb__
+ return INLINE_SYSCALL(sync_file_range, 6, fd,
+ OFF64_HI_LO(offset), OFF64_HI_LO(nbytes), flags);
# elif (defined __mips__ && _MIPS_SIM == _ABIO32) || \
(defined(__UCLIBC_SYSCALL_ALIGN_64BIT__) && !(defined(__powerpc__) || defined(__xtensa__)))
/* arch with 64-bit data in even reg alignment #2: [arcv2/others-in-future]
diff --git a/libc/sysdeps/linux/common/utime.c b/libc/sysdeps/linux/common/utime.c
index 886d23a49..a2ce8a5d5 100644
--- a/libc/sysdeps/linux/common/utime.c
+++ b/libc/sysdeps/linux/common/utime.c
@@ -54,6 +54,5 @@ int utime(const char *file, const struct utimbuf *times)
#if (defined __NR_utimensat && !defined __NR_utime) || \
defined __NR_utime || defined __NR_utimes
-link_warning(utime, "the use of OBSOLESCENT `utime' is discouraged, use `utimes'")
libc_hidden_def(utime)
#endif
diff --git a/libc/sysdeps/linux/common/xstatconv.c b/libc/sysdeps/linux/common/xstatconv.c
index 7edc42a81..a21579c41 100644
--- a/libc/sysdeps/linux/common/xstatconv.c
+++ b/libc/sysdeps/linux/common/xstatconv.c
@@ -37,9 +37,12 @@ void __xstat_conv(struct kernel_stat *kbuf, struct stat *buf)
buf->st_size = kbuf->st_size;
buf->st_blksize = kbuf->st_blksize;
buf->st_blocks = kbuf->st_blocks;
- buf->st_atim = kbuf->st_atim;
- buf->st_mtim = kbuf->st_mtim;
- buf->st_ctim = kbuf->st_ctim;
+ buf->st_atim.tv_sec = kbuf->st_atim.tv_sec;
+ buf->st_atim.tv_nsec = kbuf->st_atim.tv_nsec;
+ buf->st_mtim.tv_sec = kbuf->st_mtim.tv_sec;
+ buf->st_mtim.tv_nsec = kbuf->st_mtim.tv_nsec;
+ buf->st_ctim.tv_sec = kbuf->st_ctim.tv_sec;
+ buf->st_ctim.tv_nsec = kbuf->st_ctim.tv_nsec;
}
void __xstat32_conv(struct kernel_stat64 *kbuf, struct stat *buf)
@@ -56,9 +59,12 @@ void __xstat32_conv(struct kernel_stat64 *kbuf, struct stat *buf)
buf->st_size = kbuf->st_size;
buf->st_blksize = kbuf->st_blksize;
buf->st_blocks = kbuf->st_blocks;
- buf->st_atim = kbuf->st_atim;
- buf->st_mtim = kbuf->st_mtim;
- buf->st_ctim = kbuf->st_ctim;
+ buf->st_atim.tv_sec = kbuf->st_atim.tv_sec;
+ buf->st_atim.tv_nsec = kbuf->st_atim.tv_nsec;
+ buf->st_mtim.tv_sec = kbuf->st_mtim.tv_sec;
+ buf->st_mtim.tv_nsec = kbuf->st_mtim.tv_nsec;
+ buf->st_ctim.tv_sec = kbuf->st_ctim.tv_sec;
+ buf->st_ctim.tv_nsec = kbuf->st_ctim.tv_nsec;
}
#ifdef __UCLIBC_HAS_LFS__
@@ -80,9 +86,12 @@ void __xstat64_conv(struct kernel_stat64 *kbuf, struct stat64 *buf)
buf->st_size = kbuf->st_size;
buf->st_blksize = kbuf->st_blksize;
buf->st_blocks = kbuf->st_blocks;
- buf->st_atim = kbuf->st_atim;
- buf->st_mtim = kbuf->st_mtim;
- buf->st_ctim = kbuf->st_ctim;
+ buf->st_atim.tv_sec = kbuf->st_atim.tv_sec;
+ buf->st_atim.tv_nsec = kbuf->st_atim.tv_nsec;
+ buf->st_mtim.tv_sec = kbuf->st_mtim.tv_sec;
+ buf->st_mtim.tv_nsec = kbuf->st_mtim.tv_nsec;
+ buf->st_ctim.tv_sec = kbuf->st_ctim.tv_sec;
+ buf->st_ctim.tv_nsec = kbuf->st_ctim.tv_nsec;
}
#endif /* __UCLIBC_HAS_LFS__ */