about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/clock_nanosleep.c
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2022-08-30 09:08:02 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2022-10-20 10:19:08 -0300
commit9b5e138f2bbd032da858a4ad5bb51ed99d6f89b6 (patch)
treed61137c94c8088bde747b0b6c741c35e0ed22f1a /sysdeps/unix/sysv/linux/clock_nanosleep.c
parent643a2d01399188192e0da234581034f77c892054 (diff)
downloadglibc-9b5e138f2bbd032da858a4ad5bb51ed99d6f89b6.tar.gz
glibc-9b5e138f2bbd032da858a4ad5bb51ed99d6f89b6.tar.xz
glibc-9b5e138f2bbd032da858a4ad5bb51ed99d6f89b6.zip
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 <arjun@redhat.com>
Diffstat (limited to 'sysdeps/unix/sysv/linux/clock_nanosleep.c')
-rw-r--r--sysdeps/unix/sysv/linux/clock_nanosleep.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sysdeps/unix/sysv/linux/clock_nanosleep.c b/sysdeps/unix/sysv/linux/clock_nanosleep.c
index befe6ecb8c..e610fd4e8d 100644
--- a/sysdeps/unix/sysv/linux/clock_nanosleep.c
+++ b/sysdeps/unix/sysv/linux/clock_nanosleep.c
@@ -34,7 +34,7 @@ __clock_nanosleep_time64 (clockid_t clock_id, int flags,
   if (clock_id == CLOCK_THREAD_CPUTIME_ID)
     return EINVAL;
   if (clock_id == CLOCK_PROCESS_CPUTIME_ID)
-    clock_id = MAKE_PROCESS_CPUCLOCK (0, CPUCLOCK_SCHED);
+    clock_id = PROCESS_CLOCK;
 
   /* If the call is interrupted by a signal handler or encounters an error,
      it returns a positive value similar to errno.  */