Source-Changes-HG archive

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

[src/trunk]: src/include In the manner of Solaris and other OSes, we now defi...



details:   https://anonhg.NetBSD.org/src/rev/57dfc049a042
branches:  trunk
changeset: 533173:57dfc049a042
user:      perry <perry%NetBSD.org@localhost>
date:      Sun Jun 23 19:41:04 2002 +0000

description:
In the manner of Solaris and other OSes, we now define CLK_TCK to
expand to a call to __sysconf(_SC_CLK_TCK), rather than hard coding it
as a constant.

diffstat:

 include/time.h |  13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diffs (34 lines):

diff -r 1be0c8bb68af -r 57dfc049a042 include/time.h
--- a/include/time.h    Sun Jun 23 19:19:01 2002 +0000
+++ b/include/time.h    Sun Jun 23 19:41:04 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: time.h,v 1.27 2001/03/31 18:29:20 kleink Exp $ */
+/*     $NetBSD: time.h,v 1.28 2002/06/23 19:41:04 perry Exp $  */
 
 /*
  * Copyright (c) 1989, 1993
@@ -46,7 +46,6 @@
 #include <sys/cdefs.h>
 #include <sys/featuretest.h>
 #include <machine/ansi.h>
-#include <machine/limits.h>    /* Include file containing CLK_TCK. */
 
 #include <sys/null.h>
 
@@ -104,7 +103,15 @@
 time_t time __P((time_t *));
 
 #if !defined(_ANSI_SOURCE)
-#define CLK_TCK                100
+
+/*
+ * CLK_TCK uses libc's internal __sysconf() to retrieve the machine's
+ * HZ. The value of _SC_CLK_TCK is 3 -- we hard code it so we do not
+ * need to include unistd.h
+ */
+long __sysconf __P((int));
+#define CLK_TCK                (__sysconf(3))
+
 extern __aconst char *tzname[2];
 void tzset __P((void));
 



Home | Main Index | Thread Index | Old Index