Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Add {POSIX_MONOTONIC_CLOCK} variables.



details:   https://anonhg.NetBSD.org/src/rev/f27b4a6a6754
branches:  trunk
changeset: 521444:f27b4a6a6754
user:      kleink <kleink%NetBSD.org@localhost>
date:      Thu Jan 31 00:32:47 2002 +0000

description:
Add {POSIX_MONOTONIC_CLOCK} variables.

diffstat:

 lib/libc/gen/sysconf.3    |  8 ++++++--
 lib/libc/gen/sysconf.c    |  8 ++++++--
 lib/libc/gen/sysctl.3     |  7 ++++++-
 sys/kern/kern_sysctl.c    |  6 ++++--
 sys/sys/sysctl.h          |  6 ++++--
 sys/sys/unistd.h          |  5 ++++-
 usr.bin/getconf/getconf.c |  5 +++--
 7 files changed, 33 insertions(+), 12 deletions(-)

diffs (192 lines):

diff -r 6fe56892f0d9 -r f27b4a6a6754 lib/libc/gen/sysconf.3
--- a/lib/libc/gen/sysconf.3    Thu Jan 31 00:25:33 2002 +0000
+++ b/lib/libc/gen/sysconf.3    Thu Jan 31 00:32:47 2002 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: sysconf.3,v 1.17 2001/09/16 02:57:05 wiz Exp $
+.\"    $NetBSD: sysconf.3,v 1.18 2002/01/31 00:32:47 kleink Exp $
 .\"
 .\" Copyright (c) 1993
 .\"    The Regents of the University of California.  All rights reserved.
@@ -33,7 +33,7 @@
 .\"
 .\"    @(#)sysconf.3   8.3 (Berkeley) 4/19/94
 .\"
-.Dd June 24, 1999
+.Dd January 31, 2002
 .Dt SYSCONF 3
 .Os
 .Sh NAME
@@ -103,6 +103,10 @@
 .It Li _SC_MEMORY_PROTECTION
 Return 1 if the Memory Protection Option is available on this system,
 otherwise \-1.
+.It Li _SC_MONOTONIC_CLOCK
+Return the standard version the implementation of the Monotonic Clock
+Option on this systems conforms to,
+or \-1 if unavailable.
 .It Li _SC_NGROUPS_MAX
 The maximum number of supplemental groups.
 .It Li _SC_OPEN_MAX
diff -r 6fe56892f0d9 -r f27b4a6a6754 lib/libc/gen/sysconf.c
--- a/lib/libc/gen/sysconf.c    Thu Jan 31 00:25:33 2002 +0000
+++ b/lib/libc/gen/sysconf.c    Thu Jan 31 00:32:47 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sysconf.c,v 1.13 2001/05/07 17:25:57 kleink Exp $      */
+/*     $NetBSD: sysconf.c,v 1.14 2002/01/31 00:32:47 kleink Exp $      */
 
 /*-
  * Copyright (c) 1993
@@ -41,7 +41,7 @@
 #if 0
 static char sccsid[] = "@(#)sysconf.c  8.2 (Berkeley) 3/20/94";
 #else
-__RCSID("$NetBSD: sysconf.c,v 1.13 2001/05/07 17:25:57 kleink Exp $");
+__RCSID("$NetBSD: sysconf.c,v 1.14 2002/01/31 00:32:47 kleink Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -147,6 +147,10 @@
                mib[0] = CTL_KERN;
                mib[1] = KERN_MEMORY_PROTECTION;
                goto yesno;
+       case _SC_MONOTONIC_CLOCK:
+               mib[0] = CTL_KERN;
+               mib[1] = KERN_MONOTONIC_CLOCK;
+               goto yesno;
 
 /* 1003.1c */
        case _SC_LOGIN_NAME_MAX:
diff -r 6fe56892f0d9 -r f27b4a6a6754 lib/libc/gen/sysctl.3
--- a/lib/libc/gen/sysctl.3     Thu Jan 31 00:25:33 2002 +0000
+++ b/lib/libc/gen/sysctl.3     Thu Jan 31 00:32:47 2002 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: sysctl.3,v 1.84 2002/01/28 02:07:01 simonb Exp $
+.\"    $NetBSD: sysctl.3,v 1.85 2002/01/31 00:32:47 kleink Exp $
 .\"
 .\" Copyright (c) 1993
 .\"    The Regents of the University of California.  All rights reserved.
@@ -296,6 +296,7 @@
 .It KERN\_MEMLOCK      integer no
 .It KERN\_MEMLOCK\_RANGE       integer no
 .It KERN\_MEMORY\_PROTECTION   integer no
+.It KERN\_MONOTONIC\_CLOCK     integer no
 .It KERN\_MSGBUF       char[\|]        no
 .It KERN\_MSGBUFSIZE   integer no
 .It KERN\_NGROUPS      integer no
@@ -463,6 +464,10 @@
 Returns 1 if the POSIX 1003.1b Memory Protection Option is available
 on this system,
 otherwise 0.
+.It Li KERN_MONOTONIC_CLOCK
+Returns the standard version the implementation of the POSIX 1003.1b
+Monotonic Clock Option conforms to,
+otherwise 0.
 .It Li KERN_MSGBUF
 The kernel message buffer, rotated so that the head of the circular kernel
 message buffer is returned at the start of the buffer specified by
diff -r 6fe56892f0d9 -r f27b4a6a6754 sys/kern/kern_sysctl.c
--- a/sys/kern/kern_sysctl.c    Thu Jan 31 00:25:33 2002 +0000
+++ b/sys/kern/kern_sysctl.c    Thu Jan 31 00:32:47 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_sysctl.c,v 1.100 2002/01/28 02:06:02 simonb Exp $ */
+/*     $NetBSD: kern_sysctl.c,v 1.101 2002/01/31 00:32:47 kleink Exp $ */
 
 /*-
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -43,7 +43,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_sysctl.c,v 1.100 2002/01/28 02:06:02 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_sysctl.c,v 1.101 2002/01/31 00:32:47 kleink Exp $");
 
 #include "opt_ddb.h"
 #include "opt_insecure.h"
@@ -563,6 +563,8 @@
        case KERN_TKSTAT:
                return (sysctl_dotkstat(name + 1, namelen - 1, oldp, oldlenp,
                    newp));
+       case KERN_MONOTONIC_CLOCK:      /* XXX _POSIX_VERSION */
+               return (sysctl_rdint(oldp, oldlenp, newp, 200112));
        default:
                return (EOPNOTSUPP);
        }
diff -r 6fe56892f0d9 -r f27b4a6a6754 sys/sys/sysctl.h
--- a/sys/sys/sysctl.h  Thu Jan 31 00:25:33 2002 +0000
+++ b/sys/sys/sysctl.h  Thu Jan 31 00:32:47 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sysctl.h,v 1.72 2002/01/28 02:06:04 simonb Exp $       */
+/*     $NetBSD: sysctl.h,v 1.73 2002/01/31 00:32:47 kleink Exp $       */
 
 /*
  * Copyright (c) 1989, 1993
@@ -177,7 +177,8 @@
 #define        KERN_MAXPHYS            57      /* int: kernel value of MAXPHYS */
 #define        KERN_SBMAX              58      /* int: max socket buffer size */
 #define        KERN_TKSTAT             59      /* tty in/out counters */
-#define        KERN_MAXID              60      /* number of valid kern ids */
+#define        KERN_MONOTONIC_CLOCK    60      /* int: POSIX monotonic clock */
+#define        KERN_MAXID              61      /* number of valid kern ids */
 
 #define        CTL_KERN_NAMES { \
        { 0, 0 }, \
@@ -240,6 +241,7 @@
        { "maxphys", CTLTYPE_INT }, \
        { "sbmax", CTLTYPE_INT }, \
        { "tkstat", CTLTYPE_NODE }, \
+       { "monotonic_clock", CTLTYPE_INT }, \
 }
 
 /*
diff -r 6fe56892f0d9 -r f27b4a6a6754 sys/sys/unistd.h
--- a/sys/sys/unistd.h  Thu Jan 31 00:25:33 2002 +0000
+++ b/sys/sys/unistd.h  Thu Jan 31 00:32:47 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: unistd.h,v 1.18 1999/09/27 16:24:41 kleink Exp $       */
+/*     $NetBSD: unistd.h,v 1.19 2002/01/31 00:32:48 kleink Exp $       */
 
 /*
  * Copyright (c) 1989, 1993
@@ -83,6 +83,8 @@
 #define        _POSIX_MEMLOCK_RANGE    1
                                /* memory access protections */
 #define        _POSIX_MEMORY_PROTECTION 1
+                               /* monotonic clock */
+#define        _POSIX_MONOTONIC_CLOCK  200112L
 
 
 /* access function */
@@ -155,6 +157,7 @@
 #define        _SC_MEMLOCK_RANGE       35
 #define        _SC_MEMORY_PROTECTION   36
 #define        _SC_LOGIN_NAME_MAX      37
+#define        _SC_MONOTONIC_CLOCK     38
 
 /* configurable system strings */
 #define        _CS_PATH                 1
diff -r 6fe56892f0d9 -r f27b4a6a6754 usr.bin/getconf/getconf.c
--- a/usr.bin/getconf/getconf.c Thu Jan 31 00:25:33 2002 +0000
+++ b/usr.bin/getconf/getconf.c Thu Jan 31 00:32:47 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: getconf.c,v 1.13 2000/07/03 02:51:17 matt Exp $        */
+/*     $NetBSD: getconf.c,v 1.14 2002/01/31 00:32:48 kleink Exp $      */
 
 /*-
  * Copyright (c) 1996, 1998 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: getconf.c,v 1.13 2000/07/03 02:51:17 matt Exp $");
+__RCSID("$NetBSD: getconf.c,v 1.14 2002/01/31 00:32:48 kleink Exp $");
 #endif /* not lint */
 
 #include <err.h>
@@ -139,6 +139,7 @@
   { "_POSIX_MEMLOCK",          SYSCONF,        _SC_MEMLOCK             },
   { "_POSIX_MEMLOCK_RANGE",    SYSCONF,        _SC_MEMLOCK_RANGE       },
   { "_POSIX_MEMORY_PROTECTION",        SYSCONF,        _SC_MEMORY_PROTECTION   },
+  { "_POSIX_MONOTONIC_CLOCK",  SYSCONF,        _SC_MONOTONIC_CLOCK     },
   { "_POSIX_SYNCHRONIZED_IO",  SYSCONF,        _SC_SYNCHRONIZED_IO     },
 
   { "_POSIX_SYNC_IO",          PATHCONF,       _PC_SYNC_IO             },



Home | Main Index | Thread Index | Old Index