From 9b5e138f2bbd032da858a4ad5bb51ed99d6f89b6 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Tue, 30 Aug 2022 09:08:02 -0300 Subject: linux: Avoid shifting a negative signed on POSIX timer interface The current macros uses pid as signed value, which triggers a compiler warning for process and thread timers. Replace MAKE_PROCESS_CPUCLOCK with static inline function that expects the pid as unsigned. These are similar to what Linux does internally. Checked on x86_64-linux-gnu. Reviewed-by: Arjun Shankar --- sysdeps/unix/sysv/linux/timer_create.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sysdeps/unix/sysv/linux/timer_create.c') diff --git a/sysdeps/unix/sysv/linux/timer_create.c b/sysdeps/unix/sysv/linux/timer_create.c index a8b2a41d9e..290324a7ea 100644 --- a/sysdeps/unix/sysv/linux/timer_create.c +++ b/sysdeps/unix/sysv/linux/timer_create.c @@ -33,9 +33,9 @@ ___timer_create (clockid_t clock_id, struct sigevent *evp, timer_t *timerid) { { clockid_t syscall_clockid = (clock_id == CLOCK_PROCESS_CPUTIME_ID - ? MAKE_PROCESS_CPUCLOCK (0, CPUCLOCK_SCHED) + ? PROCESS_CLOCK : clock_id == CLOCK_THREAD_CPUTIME_ID - ? MAKE_THREAD_CPUCLOCK (0, CPUCLOCK_SCHED) + ? THREAD_CLOCK : clock_id); /* If the user wants notification via a thread we need to handle -- cgit v1.2.3