Move KERN_NTP to a more suitable file.

This commit is contained in:
Poul-Henning Kamp 1995-11-14 09:07:14 +00:00
parent 45a4ad1146
commit a52752a457
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=12279
2 changed files with 9 additions and 17 deletions

View File

@ -81,23 +81,13 @@ extern long pps_errcnt; /* calibration errors */
extern long pps_stbcnt; /* stability limit exceeded */
#endif /* PPS_SYNC */
int
ntp_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp,
void *newp, size_t newlen, struct proc *p)
static int
ntp_sysctl SYSCTL_HANDLER_ARGS
{
struct timeval atv;
struct ntptimeval ntv;
int s;
/* All names at this level are terminal. */
if (namelen != 1) {
return ENOTDIR;
}
if (name[0] != NTP_PLL_GETTIME) {
return EOPNOTSUPP;
}
s = splclock();
#ifdef EXT_CLOCK
/*
@ -163,9 +153,14 @@ ntp_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp,
time_status & (STA_PPSWANDER | STA_PPSERROR)) {
ntv.time_state = TIME_ERROR;
}
return(sysctl_rdstruct(oldp, oldlenp, newp, &ntv, sizeof ntv));
return (sysctl_handle_opaque(oidp, &ntv, sizeof ntv, req));
}
SYSCTL_NODE(_kern, KERN_NTP_PLL, ntp_pll, CTLFLAG_RW, 0,
"NTP kernel PLL related stuff");
SYSCTL_PROC(_kern_ntp_pll, NTP_PLL_GETTIME, gettime, CTLTYPE_OPAQUE|CTLFLAG_RD,
0, sizeof(struct ntptimeval) , ntp_sysctl, "");
/*
* ntp_adjtime() - NTP daemon application interface
*/

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)kern_sysctl.c 8.4 (Berkeley) 4/14/94
* $Id: kern_sysctl.c,v 1.39 1995/11/13 13:54:09 phk Exp $
* $Id: kern_sysctl.c,v 1.40 1995/11/14 09:05:40 phk Exp $
*/
/*
@ -729,9 +729,6 @@ kern_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
return (sysctl_doprof(name + 1, namelen - 1, oldp, oldlenp,
newp, newlen));
#endif
case KERN_NTP_PLL:
return (ntp_sysctl(name + 1, namelen - 1, oldp, oldlenp,
newp, newlen, p));
case KERN_DUMPDEV:
ndumpdev = dumpdev;
error = sysctl_struct(oldp, oldlenp, newp, newlen, &ndumpdev,