summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2016-06-10 23:29:20 +0000
committerchristos <christos@NetBSD.org>2016-06-10 23:29:20 +0000
commit7d287d4798cc0a133e2ebf847fd33c5b2d4bf0bf (patch)
tree01ff5d4420332f5d6a2a6a13a4dd6d619e123e87 /lib/libc
parent82d726f805ed0d9c30c5557cc0fb71012394b031 (diff)
GSoC 2016: Charles Cui: Add timer related macros
_POSIX_CPUTIME _POSIX_THREAD_CPUTIME _POSIX_DELAYTIMER_MAX
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/gen/sysconf.311
-rw-r--r--lib/libc/gen/sysconf.c10
2 files changed, 18 insertions, 3 deletions
diff --git a/lib/libc/gen/sysconf.3 b/lib/libc/gen/sysconf.3
index dfdbaf0fa07..165d705d0cb 100644
--- a/lib/libc/gen/sysconf.3
+++ b/lib/libc/gen/sysconf.3
@@ -1,4 +1,4 @@
-.\" $NetBSD: sysconf.3,v 1.47 2016/06/10 23:26:43 wiz Exp $
+.\" $NetBSD: sysconf.3,v 1.48 2016/06/10 23:29:20 christos Exp $
.\"
.\" Copyright (c) 1993
.\" The Regents of the University of California. All rights reserved.
@@ -185,6 +185,15 @@ and its
Timers
option to which the system attempts to conform,
otherwise \-1.
+.It Li _SC_CPUTIME
+The clockID CLOCK_PROCESS_CPUTIME_ID is supported,
+otherwise \-1.
+.It Li _SC_THREAD_CPUTIME
+The clockID CLOCK_THREAD_CPUTIME_ID is supported,
+otherwise \-1.
+.It Li _SC_DELAYTIMER_MAX
+The maximum number of overrun for a specific timer,
+otherwise \-1.
.It Li _SC_TZNAME_MAX
The minimum maximum number of types supported for the name of a
timezone.
diff --git a/lib/libc/gen/sysconf.c b/lib/libc/gen/sysconf.c
index 173d85427ef..c320b17f893 100644
--- a/lib/libc/gen/sysconf.c
+++ b/lib/libc/gen/sysconf.c
@@ -1,4 +1,4 @@
-/* $NetBSD: sysconf.c,v 1.38 2016/06/10 23:24:33 christos Exp $ */
+/* $NetBSD: sysconf.c,v 1.39 2016/06/10 23:29:20 christos Exp $ */
/*-
* Copyright (c) 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)sysconf.c 8.2 (Berkeley) 3/20/94";
#else
-__RCSID("$NetBSD: sysconf.c,v 1.38 2016/06/10 23:24:33 christos Exp $");
+__RCSID("$NetBSD: sysconf.c,v 1.39 2016/06/10 23:29:20 christos Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -422,6 +422,12 @@ yesno: if (sysctl(mib, mib_len, &value, &len, NULL, 0) == -1)
return _POSIX_TIMER_MAX;
case _SC_SEM_NSEMS_MAX:
return _POSIX_SEM_NSEMS_MAX;
+ case _SC_CPUTIME:
+ return _POSIX_CPUTIME;
+ case _SC_THREAD_CPUTIME:
+ return _POSIX_THREAD_CPUTIME;
+ case _SC_DELAYTIMER_MAX:
+ return _POSIX_DELAYTIMER_MAX;
default:
errno = EINVAL;
return (-1);