Make ntp_gettime() and ntp_adjtime() like other system calls:
- The functions that implement them and the argument names are prepended with "sys_". - Optional systems calls are "UNIMPL" if the support is not being compiled into the kernel.
This commit is contained in:
parent
82b23eb20c
commit
9d9479eb2f
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: kern_ntptime.c,v 1.2 1996/03/07 14:31:20 christos Exp $ */
|
/* $NetBSD: kern_ntptime.c,v 1.3 1996/11/14 04:51:09 thorpej Exp $ */
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* *
|
* *
|
||||||
|
@ -64,8 +64,6 @@
|
||||||
#include <vm/vm.h>
|
#include <vm/vm.h>
|
||||||
#include <sys/sysctl.h>
|
#include <sys/sysctl.h>
|
||||||
|
|
||||||
#ifdef NTP
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The following variables are used by the hardclock() routine in the
|
* The following variables are used by the hardclock() routine in the
|
||||||
* kern_clock.c module and are described in that module.
|
* kern_clock.c module and are described in that module.
|
||||||
|
@ -103,13 +101,13 @@ extern long pps_stbcnt; /* stability limit exceeded */
|
||||||
* ntp_gettime() - NTP user application interface
|
* ntp_gettime() - NTP user application interface
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
ntp_gettime(p, v, retval)
|
sys_ntp_gettime(p, v, retval)
|
||||||
struct proc *p;
|
struct proc *p;
|
||||||
void *v;
|
void *v;
|
||||||
register_t *retval;
|
register_t *retval;
|
||||||
|
|
||||||
{
|
{
|
||||||
struct ntp_gettime_args /* {
|
struct sys_ntp_gettime_args /* {
|
||||||
syscallarg(struct timex *) tp;
|
syscallarg(struct timex *) tp;
|
||||||
} */ *uap = v;
|
} */ *uap = v;
|
||||||
struct timeval atv;
|
struct timeval atv;
|
||||||
|
@ -190,12 +188,12 @@ ntp_gettime(p, v, retval)
|
||||||
* ntp_adjtime() - NTP daemon application interface
|
* ntp_adjtime() - NTP daemon application interface
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
ntp_adjtime(p, v, retval)
|
sys_ntp_adjtime(p, v, retval)
|
||||||
struct proc *p;
|
struct proc *p;
|
||||||
void *v;
|
void *v;
|
||||||
register_t *retval;
|
register_t *retval;
|
||||||
{
|
{
|
||||||
struct ntp_adjtime_args /* {
|
struct sys_ntp_adjtime_args /* {
|
||||||
syscallarg(struct timex *) tp;
|
syscallarg(struct timex *) tp;
|
||||||
} */ *uap = v;
|
} */ *uap = v;
|
||||||
struct timex ntv;
|
struct timex ntv;
|
||||||
|
@ -368,41 +366,3 @@ sysctl_ntptime(where, sizep)
|
||||||
#endif /* notyet */
|
#endif /* notyet */
|
||||||
return (sysctl_rdstruct(where, sizep, NULL, &ntv, sizeof(ntv)));
|
return (sysctl_rdstruct(where, sizep, NULL, &ntv, sizeof(ntv)));
|
||||||
}
|
}
|
||||||
|
|
||||||
#else /* !NTP */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* For kernels configured without the NTP option, emulate the behavior
|
|
||||||
* of a kernel with no NTP support (i.e., sys_nosys()). On systems
|
|
||||||
* where kernel NTP support appears present when xntpd is compiled,
|
|
||||||
* (e.g., sys/timex.h is present), xntpd relies on getting a SIGSYS
|
|
||||||
* signal in response to an ntp_adjtime() syscal, to inform xntpd that
|
|
||||||
* NTP support is not really present, and xntpd should fall back to
|
|
||||||
* using a user-level phase-locked loop to discipline the clock.
|
|
||||||
*/
|
|
||||||
int
|
|
||||||
ntp_gettime(p, v, retval)
|
|
||||||
struct proc *p;
|
|
||||||
void *v;
|
|
||||||
register_t *retval;
|
|
||||||
{
|
|
||||||
return(ENOSYS);
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
ntp_adjtime(p, v, retval)
|
|
||||||
struct proc *p;
|
|
||||||
void *v;
|
|
||||||
register_t *retval;
|
|
||||||
{
|
|
||||||
return(sys_nosys(p, v, retval));
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
sysctl_ntptime(where, sizep)
|
|
||||||
register char *where;
|
|
||||||
size_t *sizep;
|
|
||||||
{
|
|
||||||
return (ENOSYS);
|
|
||||||
}
|
|
||||||
#endif /* NTP */
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
$NetBSD: syscalls.master,v 1.37 1996/09/19 04:52:12 jtc Exp $
|
$NetBSD: syscalls.master,v 1.38 1996/11/14 04:51:11 thorpej Exp $
|
||||||
|
|
||||||
; @(#)syscalls.master 8.2 (Berkeley) 1/13/94
|
; @(#)syscalls.master 8.2 (Berkeley) 1/13/94
|
||||||
|
|
||||||
|
@ -308,8 +308,13 @@
|
||||||
172 UNIMPL
|
172 UNIMPL
|
||||||
173 UNIMPL
|
173 UNIMPL
|
||||||
174 UNIMPL
|
174 UNIMPL
|
||||||
175 STD { int ntp_gettime(struct timex *tp); }
|
#ifdef NTP
|
||||||
176 STD { int ntp_adjtime(struct timex *tp); }
|
175 STD { int sys_ntp_gettime(struct timex *tp); }
|
||||||
|
176 STD { int sys_ntp_adjtime(struct timex *tp); }
|
||||||
|
#else
|
||||||
|
175 UNIMPL ntp_gettime
|
||||||
|
176 UNIMPL ntp_adjtime
|
||||||
|
#endif
|
||||||
177 UNIMPL
|
177 UNIMPL
|
||||||
178 UNIMPL
|
178 UNIMPL
|
||||||
179 UNIMPL
|
179 UNIMPL
|
||||||
|
|
Loading…
Reference in New Issue