summaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/kernel-posix-cpu-timers.h
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2005-04-27 11:31:41 +0000
committerJakub Jelinek <jakub@redhat.com>2005-04-27 11:31:41 +0000
commit35278cc7d7fe81e01bb092e76b775c169e7e85f6 (patch)
tree6ec42ab959998df5c0182183807ee2b9efc4cc91 /sysdeps/unix/sysv/linux/kernel-posix-cpu-timers.h
parent536db0d3b5efac042be3bf1d6f99f9c418f76255 (diff)
Updated to fedora-glibc-20050427T1043
Diffstat (limited to 'sysdeps/unix/sysv/linux/kernel-posix-cpu-timers.h')
-rw-r--r--sysdeps/unix/sysv/linux/kernel-posix-cpu-timers.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/linux/kernel-posix-cpu-timers.h b/sysdeps/unix/sysv/linux/kernel-posix-cpu-timers.h
new file mode 100644
index 0000000000..164a90ddeb
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/kernel-posix-cpu-timers.h
@@ -0,0 +1,18 @@
+/* Parameters for the Linux kernel ABI for CPU clocks. */
+
+#define CPUCLOCK_PID(clock) ((pid_t) ~((clock) >> 3))
+#define CPUCLOCK_PERTHREAD(clock) \
+ (((clock) & (clockid_t) CPUCLOCK_PERTHREAD_MASK) != 0)
+#define CPUCLOCK_PID_MASK 7
+#define CPUCLOCK_PERTHREAD_MASK 4
+#define CPUCLOCK_WHICH(clock) ((clock) & (clockid_t) CPUCLOCK_CLOCK_MASK)
+#define CPUCLOCK_CLOCK_MASK 3
+#define CPUCLOCK_PROF 0
+#define CPUCLOCK_VIRT 1
+#define CPUCLOCK_SCHED 2
+#define CPUCLOCK_MAX 3
+
+#define MAKE_PROCESS_CPUCLOCK(pid, clock) \
+ ((~(clockid_t) (pid) << 3) | (clockid_t) (clock))
+#define MAKE_THREAD_CPUCLOCK(tid, clock) \
+ MAKE_PROCESS_CPUCLOCK((tid), (clock) | CPUCLOCK_PERTHREAD_MASK)