Back to index

glibc  2.9
kernel-posix-cpu-timers.h
Go to the documentation of this file.
00001 /* Parameters for the Linux kernel ABI for CPU clocks.  */
00002 
00003 #define CPUCLOCK_PID(clock)        ((pid_t) ~((clock) >> 3))
00004 #define CPUCLOCK_PERTHREAD(clock) \
00005        (((clock) & (clockid_t) CPUCLOCK_PERTHREAD_MASK) != 0)
00006 #define CPUCLOCK_PID_MASK   7
00007 #define CPUCLOCK_PERTHREAD_MASK    4
00008 #define CPUCLOCK_WHICH(clock)      ((clock) & (clockid_t) CPUCLOCK_CLOCK_MASK)
00009 #define CPUCLOCK_CLOCK_MASK 3
00010 #define CPUCLOCK_PROF              0
00011 #define CPUCLOCK_VIRT              1
00012 #define CPUCLOCK_SCHED             2
00013 #define CPUCLOCK_MAX        3
00014 
00015 #define MAKE_PROCESS_CPUCLOCK(pid, clock) \
00016        ((~(clockid_t) (pid) << 3) | (clockid_t) (clock))
00017 #define MAKE_THREAD_CPUCLOCK(tid, clock) \
00018        MAKE_PROCESS_CPUCLOCK((tid), (clock) | CPUCLOCK_PERTHREAD_MASK)