summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1999-03-05 10:01:24 +0000
committerphk <phk@FreeBSD.org>1999-03-05 10:01:24 +0000
commit6c9764d077e6c518ff7a4613d57d02d008f93037 (patch)
treea8450cccb86ef4b28bc0eb30a95d73eb7bab7f4a /lib
parentf637c88b816ec16353664b29000ec2312c6bbea9 (diff)
downloadFreeBSD-src-6c9764d077e6c518ff7a4613d57d02d008f93037.zip
FreeBSD-src-6c9764d077e6c518ff7a4613d57d02d008f93037.tar.gz
Use sysctlbyname() instead of sysctl().
Diffstat (limited to 'lib')
-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 1f18337..4e76e85 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;
OpenPOWER on IntegriCloud