summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorAntoine Jacoutot <ajacoutot@cvs.openbsd.org>2012-03-06 11:38:27 +0000
committerAntoine Jacoutot <ajacoutot@cvs.openbsd.org>2012-03-06 11:38:27 +0000
commit7733315367d2f7a9605abe896dae98b03a7d1d7c (patch)
treea5e6f386e1c00bc08dfddd1008df7893360213fe /lib/libc
parentaf74664155e4a6650d15f947ab5f1a8f2166d76f (diff)
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@
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/gen/sysconf.37
-rw-r--r--lib/libc/gen/sysconf.c4
2 files changed, 8 insertions, 3 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: