about summary refs log tree commit diff
path: root/nptl
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 /nptl
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 'nptl')
-rw-r--r--nptl/pthread_getcpuclockid.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/nptl/pthread_getcpuclockid.c b/nptl/pthread_getcpuclockid.c
index 344bd6560e..b8bf09f550 100644
--- a/nptl/pthread_getcpuclockid.c
+++ b/nptl/pthread_getcpuclockid.c
@@ -35,7 +35,7 @@ __pthread_getcpuclockid (pthread_t threadid, clockid_t *clockid)
 
   /* The clockid_t value is a simple computation from the TID.  */
 
-  const clockid_t tidclock = MAKE_THREAD_CPUCLOCK (pd->tid, CPUCLOCK_SCHED);
+  const clockid_t tidclock = make_thread_cpuclock (pd->tid, CPUCLOCK_SCHED);
 
   *clockid = tidclock;
   return 0;