about summary refs log tree commit diff
path: root/src/time/clock_getcpuclockid.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2011-02-19 12:43:56 -0500
committerRich Felker <dalias@aerifal.cx>2011-02-19 12:43:56 -0500
commit4b1244a0bfec55bc4cad91ff157997929f106215 (patch)
tree62c43bf546b567ceaefede18d860721bdc52bb6a /src/time/clock_getcpuclockid.c
parent19eb13b9a4cf2f787f60b6e2a6d26a6cd7d3ffd2 (diff)
downloadmusl-4b1244a0bfec55bc4cad91ff157997929f106215.tar.gz
musl-4b1244a0bfec55bc4cad91ff157997929f106215.tar.xz
musl-4b1244a0bfec55bc4cad91ff157997929f106215.zip
implement the remaining clock_* interfaces
Diffstat (limited to 'src/time/clock_getcpuclockid.c')
-rw-r--r--src/time/clock_getcpuclockid.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/time/clock_getcpuclockid.c b/src/time/clock_getcpuclockid.c
new file mode 100644
index 00000000..723840b0
--- /dev/null
+++ b/src/time/clock_getcpuclockid.c
@@ -0,0 +1,11 @@
+#include <time.h>
+#include <errno.h>
+#include <unistd.h>
+#include "syscall.h"
+
+int clock_getcpuclockid(pid_t pid, clockid_t *clk)
+{
+	if (pid && pid != getpid()) return EPERM;
+	*clk = CLOCK_PROCESS_CPUTIME_ID;
+	return 0;
+}