Browse Source

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@
OPENBSD_5_4
guenther 11 years ago
parent
commit
7f8533a86d
2 changed files with 15 additions and 4 deletions
  1. +12
    -1
      src/include/time.h
  2. +3
    -3
      src/include/unistd.h

+ 12
- 1
src/include/time.h View File

@ -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);


+ 3
- 3
src/include/unistd.h View File

@ -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)


Loading…
Cancel
Save