diff options
author | 2012-03-06 11:38:26 +0000 | |
---|---|---|
committer | 2012-03-06 11:38:26 +0000 | |
commit | 4869696d63a295e296127757b79ecd902068dccc (patch) | |
tree | 55647994fb907ab862c50854a7ff89c69a953d49 | |
parent | Fill in default values for rtableid/onrdomain/prio when creating PF rules, (diff) | |
download | wireguard-openbsd-4869696d63a295e296127757b79ecd902068dccc.tar.xz wireguard-openbsd-4869696d63a295e296127757b79ecd902068dccc.zip |
Add the _POSIX_MONOTONIC_CLOCK symbol and the sysconf(3)
_SC_MONOTONIC_CLOCK variable.
from Brad
No libc minor crank needed, as no API has been changed, per se (deraadt).
ports bulk testing by landry@
small man rewording from thib@
ok millert@ otto@ deraadt@
-rw-r--r-- | lib/libc/gen/sysconf.3 | 7 | ||||
-rw-r--r-- | lib/libc/gen/sysconf.c | 4 | ||||
-rw-r--r-- | sys/sys/unistd.h | 5 |
3 files changed, 12 insertions, 4 deletions
diff --git a/lib/libc/gen/sysconf.3 b/lib/libc/gen/sysconf.3 index 801461ee7f4..b4a0711f3b4 100644 --- a/lib/libc/gen/sysconf.3 +++ b/lib/libc/gen/sysconf.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: sysconf.3,v 1.28 2010/10/28 02:06:00 deraadt Exp $ +.\" $OpenBSD: sysconf.3,v 1.29 2012/03/06 11:38:26 ajacoutot Exp $ .\" .\" Copyright (c) 1993 .\" The Regents of the University of California. All rights reserved. @@ -27,7 +27,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd $Mdocdate: October 28 2010 $ +.Dd $Mdocdate: March 6 2012 $ .Dt SYSCONF 3 .Os .Sh NAME @@ -174,6 +174,9 @@ The number of processors configured. The number of processors online (capable of running processes). .It Li _SC_HOST_NAME_MAX The maximum size of a hostname, not counting NULL. +.It Li _SC_MONOTONIC_CLOCK +Return the POSIX version of the implementation of the Monotinic Clock +Option that this system conforms to, or \-1 if unavailable. .El .Sh RETURN VALUES If the call to diff --git a/lib/libc/gen/sysconf.c b/lib/libc/gen/sysconf.c index a7cefaa689b..838e1c485b2 100644 --- a/lib/libc/gen/sysconf.c +++ b/lib/libc/gen/sysconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sysconf.c,v 1.13 2011/04/25 20:10:10 sthen Exp $ */ +/* $OpenBSD: sysconf.c,v 1.14 2012/03/06 11:38:26 ajacoutot Exp $ */ /*- * Copyright (c) 1993 * The Regents of the University of California. All rights reserved. @@ -218,6 +218,8 @@ yesno: if (sysctl(mib, namelen, &value, &len, NULL, 0) == -1) /* Unsorted */ case _SC_HOST_NAME_MAX: return (MAXHOSTNAMELEN - 1); /* does not include \0 */ + case _SC_MONOTONIC_CLOCK: + return (_POSIX_MONOTONIC_CLOCK); /* Extensions */ case _SC_PHYS_PAGES: diff --git a/sys/sys/unistd.h b/sys/sys/unistd.h index 52b8545c6a6..da80a176cb0 100644 --- a/sys/sys/unistd.h +++ b/sys/sys/unistd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: unistd.h,v 1.19 2011/10/15 23:35:29 guenther Exp $ */ +/* $OpenBSD: unistd.h,v 1.20 2012/03/06 11:38:26 ajacoutot Exp $ */ /* $NetBSD: unistd.h,v 1.10 1994/06/29 06:46:06 cgd Exp $ */ /* @@ -49,6 +49,8 @@ /* execution-time symbolic constants */ /* chown requires appropriate privileges */ #define _POSIX_CHOWN_RESTRICTED 1 + /* monotonic clock */ +#define _POSIX_MONOTONIC_CLOCK 200112L /* too-long path components generate errors */ #define _POSIX_NO_TRUNC 1 /* may disable terminal special characters */ @@ -127,6 +129,7 @@ struct __tfork { #define _SC_SEM_NSEMS_MAX 31 #define _SC_SEM_VALUE_MAX 32 #define _SC_HOST_NAME_MAX 33 +#define _SC_MONOTONIC_CLOCK 34 /* P1003.1c */ #define _SC_GETGR_R_SIZE_MAX 100 |