summaryrefslogtreecommitdiff
path: root/libpthread/nptl/sysdeps
diff options
context:
space:
mode:
authorDmitry Chestnykh <dm.chestnykh@gmail.com>2024-04-12 19:27:50 +0300
committerWaldemar Brodkorb <wbx@openadk.org>2024-04-13 08:34:24 +0200
commit48591e2a259d84247ae38f050bd58e6f7450bb77 (patch)
treeb743e57b6449cff2bc165bc6c2d83d3cf0b67246 /libpthread/nptl/sysdeps
parent70eea5e0f753483dccaabf2ac7ce5b6ef7e8e851 (diff)
Provide fixups for riscv32.
- Use TIME64 by default for rv32, usage of 32-bit time leads to a lot of incompatibilities with linux kernel 6.6.x and later versions. - Add some other corrections to use proper system calls on riscv32 platform. Signed-off-by: Dmitry Chestnykh <dm.chestnykh@gmail.com>
Diffstat (limited to 'libpthread/nptl/sysdeps')
-rw-r--r--libpthread/nptl/sysdeps/unix/sysv/linux/timer_gettime.c2
-rw-r--r--libpthread/nptl/sysdeps/unix/sysv/linux/timer_routines.c5
-rw-r--r--libpthread/nptl/sysdeps/unix/sysv/linux/timer_settime.c2
3 files changed, 7 insertions, 2 deletions
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/timer_gettime.c b/libpthread/nptl/sysdeps/unix/sysv/linux/timer_gettime.c
index 220df0c37..fccda6976 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/timer_gettime.c
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/timer_gettime.c
@@ -24,7 +24,7 @@
#include "kernel-posix-timers.h"
-#ifdef __NR_timer_gettime
+#if defined(__NR_timer_gettime) || defined(__NR_timer_gettime64)
# ifndef __ASSUME_POSIX_TIMERS
static int compat_timer_gettime (timer_t timerid, struct itimerspec *value);
# define timer_gettime static compat_timer_gettime
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/timer_routines.c b/libpthread/nptl/sysdeps/unix/sysv/linux/timer_routines.c
index 60f2a724c..8c828fbb1 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/timer_routines.c
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/timer_routines.c
@@ -90,8 +90,13 @@ timer_helper_thread (void *arg)
/* XXX The size argument hopefully will have to be changed to the
real size of the user-level sigset_t. */
+#if defined(__NR_rt_sigtimedwait_time64) && defined(__UCLIBC_USE_TIME64__)
+ int result = INLINE_SYSCALL (rt_sigtimedwait_time64, 4, &ss, &si, NULL,
+ _NSIG / 8);
+#else
int result = INLINE_SYSCALL (rt_sigtimedwait, 4, &ss, &si, NULL,
_NSIG / 8);
+#endif
LIBC_CANCEL_RESET (oldtype);
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/timer_settime.c b/libpthread/nptl/sysdeps/unix/sysv/linux/timer_settime.c
index 1cccf57cb..fca839d64 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/timer_settime.c
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/timer_settime.c
@@ -27,7 +27,7 @@
#include "internal/time64_helpers.h"
#endif
-#ifdef __NR_timer_settime
+#if defined(__NR_timer_settime) || defined(__NR_timer_settime64)
# ifndef __ASSUME_POSIX_TIMERS
static int compat_timer_settime (timer_t timerid, int flags,
const struct itimerspec *value,