summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2013-06-17 19:11:55 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2013-06-17 19:11:55 +0000
commit407e1f7584c8aaaf7209611a864ba04253685690 (patch)
tree0b2da6aa5f947080312c01f7e306c4f4bffe39b8 /include
parent22db4b2e9c63b9f500b2d0f99d94107b5a600444 (diff)
Add support for the _POSIX_CPUTIME and _POSIX_THREAD_CPUTIME options,
including CLOCK_{PROCESS,THREAD}_CPUTIME_ID constants and {clock,pthread}_getcpuclockid() functions. Worked out at t2k13 with help from tedu@ and matthew@ and testing by aja@ ok matthew@
Diffstat (limited to 'include')
-rw-r--r--include/time.h13
-rw-r--r--include/unistd.h6
2 files changed, 15 insertions, 4 deletions
diff --git a/include/time.h b/include/time.h
index 95e01b712e0..537d9eaa0fc 100644
--- a/include/time.h
+++ b/include/time.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: time.h,v 1.24 2013/04/02 05:16:14 guenther Exp $ */
+/* $OpenBSD: time.h,v 1.25 2013/06/17 19:11:54 guenther Exp $ */
/* $NetBSD: time.h,v 1.9 1994/10/26 00:56:35 cgd Exp $ */
/*
@@ -101,6 +101,13 @@ typedef __timer_t timer_t;
#endif
#endif
+#if __POSIX_VISIBLE >= 200112
+#ifndef _PID_T_DEFINED_
+#define _PID_T_DEFINED_
+typedef __pid_t pid_t;
+#endif
+#endif
+
struct tm {
int tm_sec; /* seconds after the minute [0-60] */
int tm_min; /* minutes after the hour [0-59] */
@@ -154,6 +161,10 @@ int clock_settime(clockid_t, const struct timespec *);
int nanosleep(const struct timespec *, struct timespec *);
#endif
+#if __POSIX_VISIBLE >= 200112
+int clock_getcpuclockid(pid_t, clockid_t *);
+#endif
+
#if __BSD_VISIBLE
char *timezone(int, int);
void tzsetwall(void);
diff --git a/include/unistd.h b/include/unistd.h
index 0604d44407f..1c402512d2a 100644
--- a/include/unistd.h
+++ b/include/unistd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: unistd.h,v 1.78 2013/06/04 23:01:07 brad Exp $ */
+/* $OpenBSD: unistd.h,v 1.79 2013/06/17 19:11:54 guenther Exp $ */
/* $NetBSD: unistd.h,v 1.26.4.1 1996/05/28 02:31:51 mrg Exp $ */
/*-
@@ -66,7 +66,7 @@
#define _POSIX_BARRIERS 200112L
#define _POSIX_CHOWN_RESTRICTED 1
#define _POSIX_CLOCK_SELECTION (-1)
-#define _POSIX_CPUTIME (-1)
+#define _POSIX_CPUTIME 200809L
#define _POSIX_FSYNC 200112L
#define _POSIX_IPV6 0
#define _POSIX_JOB_CONTROL 1
@@ -93,7 +93,7 @@
#define _POSIX_SYNCHRONIZED_IO (-1)
#define _POSIX_THREAD_ATTR_STACKADDR 200112L
#define _POSIX_THREAD_ATTR_STACKSIZE 200112L
-#define _POSIX_THREAD_CPUTIME (-1)
+#define _POSIX_THREAD_CPUTIME 200809L
#define _POSIX_THREAD_PRIO_INHERIT (-1)
#define _POSIX_THREAD_PRIO_PROTECT (-1)
#define _POSIX_THREAD_PRIORITY_SCHEDULING (-1)