summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>1999-03-05 10:01:24 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>1999-03-05 10:01:24 +0000
commitc40956e25d3f16f31a1c498fa972fee0ba71dce8 (patch)
treef47571d00f009c0d2400bcafde3a1ab9c7991bd3
parent5d57729b8a420d50e3beb3437214edfbf86126a5 (diff)
Notes
-rw-r--r--lib/libc/gen/ntp_gettime.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/libc/gen/ntp_gettime.c b/lib/libc/gen/ntp_gettime.c
index 1f18337870f2..4e76e85d0760 100644
--- a/lib/libc/gen/ntp_gettime.c
+++ b/lib/libc/gen/ntp_gettime.c
@@ -33,7 +33,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
static const char rcsid[] =
- "$Id$";
+ "$Id: ntp_gettime.c,v 1.4 1997/02/22 14:58:12 peter Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -44,14 +44,10 @@ static const char rcsid[] =
int
ntp_gettime(struct ntptimeval *ntv)
{
- int mib[3];
struct ntptimeval tv;
size_t size = sizeof tv;
- mib[0] = CTL_KERN;
- mib[1] = KERN_NTP_PLL;
- mib[2] = NTP_PLL_GETTIME;
- if (sysctl(mib, 3, &tv, &size, NULL, 0) == -1)
+ if (sysctlbyname("kern.ntp_pll.gettime", &tv, &size, NULL, 0) == -1)
return TIME_ERROR;
if(ntv) *ntv = tv;
return tv.time_state;