From e1da54e513f973c6073eef5f076e589b679b0736 Mon Sep 17 00:00:00 2001 From: Bernard Xiong Date: Sat, 23 Dec 2017 23:58:18 +0800 Subject: [PATCH] [pthreads] Add CLOCK_CPUTIME_ID/CLOCK_MONOTONIC clock_id --- components/libc/pthreads/pthread.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/components/libc/pthreads/pthread.h b/components/libc/pthreads/pthread.h index 35fa817c0f..81af885981 100644 --- a/components/libc/pthreads/pthread.h +++ b/components/libc/pthreads/pthread.h @@ -307,7 +307,20 @@ struct sigevent #define NANOSECOND_PER_TICK (NANOSECOND_PER_SECOND / RT_TICK_PER_SECOND) #ifndef CLOCK_REALTIME -#define CLOCK_REALTIME 0 +#define CLOCK_REALTIME 1 +#endif + +#define CLOCK_CPUTIME_ID 2 + +#ifndef CLOCK_PROCESS_CPUTIME_ID +#define CLOCK_PROCESS_CPUTIME_ID CLOCK_CPUTIME_ID +#endif +#ifndef CLOCK_THREAD_CPUTIME_ID +#define CLOCK_THREAD_CPUTIME_ID CLOCK_CPUTIME_ID +#endif + +#ifndef CLOCK_MONOTONIC +#define CLOCK_MONOTONIC 4 #endif int clock_getres (clockid_t clockid, struct timespec *res); -- GitLab