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 --- nptl/pthread_getcpuclockid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nptl') 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; -- cgit 1.4.1