Hide the boottime and bootimebin globals, provide the getboottime(9)

and getboottimebin(9) KPI. Change consumers of boottime to use the
KPI.  The variables were renamed to avoid shadowing issues with local
variables of the same name.

Issue is that boottime* should be adjusted from tc_windup(), which
requires them to be members of the timehands structure.  As a
preparation, this commit only introduces the interface.

Some uses of boottime were found doubtful, e.g. NLM uses boottime to
identify the system boot instance.  Arguably the identity should not
change on the leap second adjustment, but the commit is about the
timekeeping code and the consumers were kept bug-to-bug compatible.

Tested by:	pho (as part of the bigger patch)
Reviewed by:	jhb (same)
Discussed with:	bde
Sponsored by:	The FreeBSD Foundation
MFC after:	1 month
X-Differential revision:	https://reviews.freebsd.org/D7302
This commit is contained in:
kib 2016-07-27 11:08:59 +00:00
parent 3202a130ab
commit 42da5a6952
15 changed files with 80 additions and 29 deletions

View File

@ -447,9 +447,11 @@ linprocfs_dostat(PFS_FILL_ARGS)
struct pcpu *pcpu; struct pcpu *pcpu;
long cp_time[CPUSTATES]; long cp_time[CPUSTATES];
long *cp; long *cp;
struct timeval boottime;
int i; int i;
read_cpu_time(cp_time); read_cpu_time(cp_time);
getboottime(&boottime);
sbuf_printf(sb, "cpu %ld %ld %ld %ld\n", sbuf_printf(sb, "cpu %ld %ld %ld %ld\n",
T2J(cp_time[CP_USER]), T2J(cp_time[CP_USER]),
T2J(cp_time[CP_NICE]), T2J(cp_time[CP_NICE]),
@ -624,10 +626,12 @@ static int
linprocfs_doprocstat(PFS_FILL_ARGS) linprocfs_doprocstat(PFS_FILL_ARGS)
{ {
struct kinfo_proc kp; struct kinfo_proc kp;
struct timeval boottime;
char state; char state;
static int ratelimit = 0; static int ratelimit = 0;
vm_offset_t startcode, startdata; vm_offset_t startcode, startdata;
getboottime(&boottime);
sx_slock(&proctree_lock); sx_slock(&proctree_lock);
PROC_LOCK(p); PROC_LOCK(p);
fill_kinfo_proc(p, &kp); fill_kinfo_proc(p, &kp);

View File

@ -707,10 +707,11 @@ devfs_getattr(struct vop_getattr_args *ap)
{ {
struct vnode *vp = ap->a_vp; struct vnode *vp = ap->a_vp;
struct vattr *vap = ap->a_vap; struct vattr *vap = ap->a_vap;
int error;
struct devfs_dirent *de; struct devfs_dirent *de;
struct devfs_mount *dmp; struct devfs_mount *dmp;
struct cdev *dev; struct cdev *dev;
struct timeval boottime;
int error;
error = devfs_populate_vp(vp); error = devfs_populate_vp(vp);
if (error != 0) if (error != 0)
@ -740,6 +741,7 @@ devfs_getattr(struct vop_getattr_args *ap)
vap->va_blocksize = DEV_BSIZE; vap->va_blocksize = DEV_BSIZE;
vap->va_type = vp->v_type; vap->va_type = vp->v_type;
getboottime(&boottime);
#define fix(aa) \ #define fix(aa) \
do { \ do { \
if ((aa).tv_sec <= 3600) { \ if ((aa).tv_sec <= 3600) { \

View File

@ -394,7 +394,9 @@ fdesc_getattr(struct vop_getattr_args *ap)
{ {
struct vnode *vp = ap->a_vp; struct vnode *vp = ap->a_vp;
struct vattr *vap = ap->a_vap; struct vattr *vap = ap->a_vap;
struct timeval boottime;
getboottime(&boottime);
vap->va_mode = S_IRUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH; vap->va_mode = S_IRUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH;
vap->va_fileid = VTOFDESC(vp)->fd_ix; vap->va_fileid = VTOFDESC(vp)->fd_ix;
vap->va_uid = 0; vap->va_uid = 0;

View File

@ -872,7 +872,7 @@ int newnfs_realign(struct mbuf **, int);
/* /*
* Set boottime. * Set boottime.
*/ */
#define NFSSETBOOTTIME(b) ((b) = boottime) #define NFSSETBOOTTIME(b) (getboottime(&b))
/* /*
* The size of directory blocks in the buffer cache. * The size of directory blocks in the buffer cache.

View File

@ -70,6 +70,7 @@ procfs_doprocstatus(PFS_FILL_ARGS)
const char *wmesg; const char *wmesg;
char *pc; char *pc;
char *sep; char *sep;
struct timeval boottime;
int pid, ppid, pgid, sid; int pid, ppid, pgid, sid;
int i; int i;
@ -129,6 +130,7 @@ procfs_doprocstatus(PFS_FILL_ARGS)
calcru(p, &ut, &st); calcru(p, &ut, &st);
PROC_STATUNLOCK(p); PROC_STATUNLOCK(p);
start = p->p_stats->p_start; start = p->p_stats->p_start;
getboottime(&boottime);
timevaladd(&start, &boottime); timevaladd(&start, &boottime);
sbuf_printf(sb, " %jd,%ld %jd,%ld %jd,%ld", sbuf_printf(sb, " %jd,%ld %jd,%ld %jd,%ld",
(intmax_t)start.tv_sec, start.tv_usec, (intmax_t)start.tv_sec, start.tv_usec,

View File

@ -389,7 +389,7 @@ acct_process(struct thread *td)
acct.ac_stime = encode_timeval(st); acct.ac_stime = encode_timeval(st);
/* (4) The elapsed time the command ran (and its starting time) */ /* (4) The elapsed time the command ran (and its starting time) */
tmp = boottime; getboottime(&tmp);
timevaladd(&tmp, &p->p_stats->p_start); timevaladd(&tmp, &p->p_stats->p_start);
acct.ac_btime = tmp.tv_sec; acct.ac_btime = tmp.tv_sec;
microuptime(&tmp); microuptime(&tmp);

View File

@ -872,6 +872,7 @@ fill_kinfo_proc_only(struct proc *p, struct kinfo_proc *kp)
struct session *sp; struct session *sp;
struct ucred *cred; struct ucred *cred;
struct sigacts *ps; struct sigacts *ps;
struct timeval boottime;
/* For proc_realparent. */ /* For proc_realparent. */
sx_assert(&proctree_lock, SX_LOCKED); sx_assert(&proctree_lock, SX_LOCKED);
@ -953,6 +954,7 @@ fill_kinfo_proc_only(struct proc *p, struct kinfo_proc *kp)
kp->ki_nice = p->p_nice; kp->ki_nice = p->p_nice;
kp->ki_fibnum = p->p_fibnum; kp->ki_fibnum = p->p_fibnum;
kp->ki_start = p->p_stats->p_start; kp->ki_start = p->p_stats->p_start;
getboottime(&boottime);
timevaladd(&kp->ki_start, &boottime); timevaladd(&kp->ki_start, &boottime);
PROC_STATLOCK(p); PROC_STATLOCK(p);
rufetch(p, &kp->ki_rusage); rufetch(p, &kp->ki_rusage);

View File

@ -106,8 +106,8 @@ int tc_min_ticktock_freq = 1;
volatile time_t time_second = 1; volatile time_t time_second = 1;
volatile time_t time_uptime = 1; volatile time_t time_uptime = 1;
struct bintime boottimebin; static struct bintime boottimebin_x;
struct timeval boottime; static struct timeval boottime_x;
static int sysctl_kern_boottime(SYSCTL_HANDLER_ARGS); static int sysctl_kern_boottime(SYSCTL_HANDLER_ARGS);
SYSCTL_PROC(_kern, KERN_BOOTTIME, boottime, CTLTYPE_STRUCT|CTLFLAG_RD, SYSCTL_PROC(_kern, KERN_BOOTTIME, boottime, CTLTYPE_STRUCT|CTLFLAG_RD,
NULL, 0, sysctl_kern_boottime, "S,timeval", "System boottime"); NULL, 0, sysctl_kern_boottime, "S,timeval", "System boottime");
@ -143,6 +143,10 @@ void dtrace_getnanotime(struct timespec *tsp);
static int static int
sysctl_kern_boottime(SYSCTL_HANDLER_ARGS) sysctl_kern_boottime(SYSCTL_HANDLER_ARGS)
{ {
struct timeval boottime;
getboottime(&boottime);
#ifndef __mips__ #ifndef __mips__
#ifdef SCTL_MASK32 #ifdef SCTL_MASK32
int tv[2]; int tv[2];
@ -150,11 +154,11 @@ sysctl_kern_boottime(SYSCTL_HANDLER_ARGS)
if (req->flags & SCTL_MASK32) { if (req->flags & SCTL_MASK32) {
tv[0] = boottime.tv_sec; tv[0] = boottime.tv_sec;
tv[1] = boottime.tv_usec; tv[1] = boottime.tv_usec;
return SYSCTL_OUT(req, tv, sizeof(tv)); return (SYSCTL_OUT(req, tv, sizeof(tv)));
} else }
#endif #endif
#endif #endif
return SYSCTL_OUT(req, &boottime, sizeof(boottime)); return (SYSCTL_OUT(req, &boottime, sizeof(boottime)));
} }
static int static int
@ -236,7 +240,7 @@ fbclock_bintime(struct bintime *bt)
{ {
fbclock_binuptime(bt); fbclock_binuptime(bt);
bintime_add(bt, &boottimebin); bintime_add(bt, &boottimebin_x);
} }
void void
@ -311,7 +315,7 @@ fbclock_getbintime(struct bintime *bt)
*bt = th->th_offset; *bt = th->th_offset;
atomic_thread_fence_acq(); atomic_thread_fence_acq();
} while (gen == 0 || gen != th->th_generation); } while (gen == 0 || gen != th->th_generation);
bintime_add(bt, &boottimebin); bintime_add(bt, &boottimebin_x);
} }
void void
@ -380,7 +384,7 @@ bintime(struct bintime *bt)
{ {
binuptime(bt); binuptime(bt);
bintime_add(bt, &boottimebin); bintime_add(bt, &boottimebin_x);
} }
void void
@ -455,7 +459,7 @@ getbintime(struct bintime *bt)
*bt = th->th_offset; *bt = th->th_offset;
atomic_thread_fence_acq(); atomic_thread_fence_acq();
} while (gen == 0 || gen != th->th_generation); } while (gen == 0 || gen != th->th_generation);
bintime_add(bt, &boottimebin); bintime_add(bt, &boottimebin_x);
} }
void void
@ -487,6 +491,20 @@ getmicrotime(struct timeval *tvp)
} }
#endif /* FFCLOCK */ #endif /* FFCLOCK */
void
getboottime(struct timeval *boottime)
{
*boottime = boottime_x;
}
void
getboottimebin(struct bintime *boottimebin)
{
*boottimebin = boottimebin_x;
}
#ifdef FFCLOCK #ifdef FFCLOCK
/* /*
* Support for feed-forward synchronization algorithms. This is heavily inspired * Support for feed-forward synchronization algorithms. This is heavily inspired
@ -1103,6 +1121,7 @@ int
sysclock_snap2bintime(struct sysclock_snap *cs, struct bintime *bt, sysclock_snap2bintime(struct sysclock_snap *cs, struct bintime *bt,
int whichclock, uint32_t flags) int whichclock, uint32_t flags)
{ {
struct bintime boottimebin;
#ifdef FFCLOCK #ifdef FFCLOCK
struct bintime bt2; struct bintime bt2;
uint64_t period; uint64_t period;
@ -1116,8 +1135,10 @@ sysclock_snap2bintime(struct sysclock_snap *cs, struct bintime *bt,
if (cs->delta > 0) if (cs->delta > 0)
bintime_addx(bt, cs->fb_info.th_scale * cs->delta); bintime_addx(bt, cs->fb_info.th_scale * cs->delta);
if ((flags & FBCLOCK_UPTIME) == 0) if ((flags & FBCLOCK_UPTIME) == 0) {
getboottimebin(&boottimebin);
bintime_add(bt, &boottimebin); bintime_add(bt, &boottimebin);
}
break; break;
#ifdef FFCLOCK #ifdef FFCLOCK
case SYSCLOCK_FFWD: case SYSCLOCK_FFWD:
@ -1242,9 +1263,9 @@ tc_setclock(struct timespec *ts)
timespec2bintime(ts, &bt); timespec2bintime(ts, &bt);
binuptime(&bt2); binuptime(&bt2);
bintime_sub(&bt, &bt2); bintime_sub(&bt, &bt2);
bintime_add(&bt2, &boottimebin); bintime_add(&bt2, &boottimebin_x);
boottimebin = bt; boottimebin_x = bt;
bintime2timeval(&bt, &boottime); bintime2timeval(&bt, &boottime_x);
/* XXX fiddle all the little crinkly bits around the fiords... */ /* XXX fiddle all the little crinkly bits around the fiords... */
tc_windup(); tc_windup();
@ -1338,7 +1359,7 @@ tc_windup(void)
* case we missed a leap second. * case we missed a leap second.
*/ */
bt = th->th_offset; bt = th->th_offset;
bintime_add(&bt, &boottimebin); bintime_add(&bt, &boottimebin_x);
i = bt.sec - tho->th_microtime.tv_sec; i = bt.sec - tho->th_microtime.tv_sec;
if (i > LARGE_STEP) if (i > LARGE_STEP)
i = 2; i = 2;
@ -1346,7 +1367,7 @@ tc_windup(void)
t = bt.sec; t = bt.sec;
ntp_update_second(&th->th_adjustment, &bt.sec); ntp_update_second(&th->th_adjustment, &bt.sec);
if (bt.sec != t) if (bt.sec != t)
boottimebin.sec += bt.sec - t; boottimebin_x.sec += bt.sec - t;
} }
/* Update the UTC timestamps used by the get*() functions. */ /* Update the UTC timestamps used by the get*() functions. */
/* XXX shouldn't do this here. Should force non-`get' versions. */ /* XXX shouldn't do this here. Should force non-`get' versions. */
@ -1769,7 +1790,7 @@ pps_event(struct pps_state *pps, int event)
tcount &= pps->capth->th_counter->tc_counter_mask; tcount &= pps->capth->th_counter->tc_counter_mask;
bt = pps->capth->th_offset; bt = pps->capth->th_offset;
bintime_addx(&bt, pps->capth->th_scale * tcount); bintime_addx(&bt, pps->capth->th_scale * tcount);
bintime_add(&bt, &boottimebin); bintime_add(&bt, &boottimebin_x);
bintime2timespec(&bt, &ts); bintime2timespec(&bt, &ts);
/* If the timecounter was wound up underneath us, bail out. */ /* If the timecounter was wound up underneath us, bail out. */
@ -2095,7 +2116,7 @@ tc_fill_vdso_timehands(struct vdso_timehands *vdso_th)
vdso_th->th_offset_count = th->th_offset_count; vdso_th->th_offset_count = th->th_offset_count;
vdso_th->th_counter_mask = th->th_counter->tc_counter_mask; vdso_th->th_counter_mask = th->th_counter->tc_counter_mask;
vdso_th->th_offset = th->th_offset; vdso_th->th_offset = th->th_offset;
vdso_th->th_boottime = boottimebin; vdso_th->th_boottime = boottimebin_x;
enabled = cpu_fill_vdso_timehands(vdso_th, th->th_counter); enabled = cpu_fill_vdso_timehands(vdso_th, th->th_counter);
if (!vdso_th_enable) if (!vdso_th_enable)
enabled = 0; enabled = 0;
@ -2116,8 +2137,8 @@ tc_fill_vdso_timehands32(struct vdso_timehands32 *vdso_th32)
vdso_th32->th_counter_mask = th->th_counter->tc_counter_mask; vdso_th32->th_counter_mask = th->th_counter->tc_counter_mask;
vdso_th32->th_offset.sec = th->th_offset.sec; vdso_th32->th_offset.sec = th->th_offset.sec;
*(uint64_t *)&vdso_th32->th_offset.frac[0] = th->th_offset.frac; *(uint64_t *)&vdso_th32->th_offset.frac[0] = th->th_offset.frac;
vdso_th32->th_boottime.sec = boottimebin.sec; vdso_th32->th_boottime.sec = boottimebin_x.sec;
*(uint64_t *)&vdso_th32->th_boottime.frac[0] = boottimebin.frac; *(uint64_t *)&vdso_th32->th_boottime.frac[0] = boottimebin_x.frac;
enabled = cpu_fill_vdso_timehands32(vdso_th32, th->th_counter); enabled = cpu_fill_vdso_timehands32(vdso_th32, th->th_counter);
if (!vdso_th_enable) if (!vdso_th_enable)
enabled = 0; enabled = 0;

View File

@ -523,7 +523,7 @@ procdesc_stat(struct file *fp, struct stat *sb, struct ucred *active_cred,
struct thread *td) struct thread *td)
{ {
struct procdesc *pd; struct procdesc *pd;
struct timeval pstart; struct timeval pstart, boottime;
/* /*
* XXXRW: Perhaps we should cache some more information from the * XXXRW: Perhaps we should cache some more information from the
@ -539,6 +539,7 @@ procdesc_stat(struct file *fp, struct stat *sb, struct ucred *active_cred,
/* Set birth and [acm] times to process start time. */ /* Set birth and [acm] times to process start time. */
pstart = pd->pd_proc->p_stats->p_start; pstart = pd->pd_proc->p_stats->p_start;
getboottime(&boottime);
timevaladd(&pstart, &boottime); timevaladd(&pstart, &boottime);
TIMEVAL_TO_TIMESPEC(&pstart, &sb->st_birthtim); TIMEVAL_TO_TIMESPEC(&pstart, &sb->st_birthtim);
sb->st_atim = sb->st_birthtim; sb->st_atim = sb->st_birthtim;

View File

@ -1027,9 +1027,10 @@ read_machclk(void)
panic("read_machclk"); panic("read_machclk");
#endif #endif
} else { } else {
struct timeval tv; struct timeval tv, boottime;
microtime(&tv); microtime(&tv);
getboottime(&boottime);
val = (((u_int64_t)(tv.tv_sec - boottime.tv_sec) * 1000000 val = (((u_int64_t)(tv.tv_sec - boottime.tv_sec) * 1000000
+ tv.tv_usec) << MACHCLK_SHIFT); + tv.tv_usec) << MACHCLK_SHIFT);
} }

View File

@ -2328,12 +2328,13 @@ bpf_hdrlen(struct bpf_d *d)
static void static void
bpf_bintime2ts(struct bintime *bt, struct bpf_ts *ts, int tstype) bpf_bintime2ts(struct bintime *bt, struct bpf_ts *ts, int tstype)
{ {
struct bintime bt2; struct bintime bt2, boottimebin;
struct timeval tsm; struct timeval tsm;
struct timespec tsn; struct timespec tsn;
if ((tstype & BPF_T_MONOTONIC) == 0) { if ((tstype & BPF_T_MONOTONIC) == 0) {
bt2 = *bt; bt2 = *bt;
getboottimebin(&boottimebin);
bintime_add(&bt2, &boottimebin); bintime_add(&bt2, &boottimebin);
bt = &bt2; bt = &bt2;
} }

View File

@ -395,6 +395,7 @@ swap_map(struct ip_fw_chain *chain, struct ip_fw **new_map, int new_len)
static void static void
export_cntr1_base(struct ip_fw *krule, struct ip_fw_bcounter *cntr) export_cntr1_base(struct ip_fw *krule, struct ip_fw_bcounter *cntr)
{ {
struct timeval boottime;
cntr->size = sizeof(*cntr); cntr->size = sizeof(*cntr);
@ -403,21 +404,26 @@ export_cntr1_base(struct ip_fw *krule, struct ip_fw_bcounter *cntr)
cntr->bcnt = counter_u64_fetch(krule->cntr + 1); cntr->bcnt = counter_u64_fetch(krule->cntr + 1);
cntr->timestamp = krule->timestamp; cntr->timestamp = krule->timestamp;
} }
if (cntr->timestamp > 0) if (cntr->timestamp > 0) {
getboottime(&boottime);
cntr->timestamp += boottime.tv_sec; cntr->timestamp += boottime.tv_sec;
}
} }
static void static void
export_cntr0_base(struct ip_fw *krule, struct ip_fw_bcounter0 *cntr) export_cntr0_base(struct ip_fw *krule, struct ip_fw_bcounter0 *cntr)
{ {
struct timeval boottime;
if (krule->cntr != NULL) { if (krule->cntr != NULL) {
cntr->pcnt = counter_u64_fetch(krule->cntr); cntr->pcnt = counter_u64_fetch(krule->cntr);
cntr->bcnt = counter_u64_fetch(krule->cntr + 1); cntr->bcnt = counter_u64_fetch(krule->cntr + 1);
cntr->timestamp = krule->timestamp; cntr->timestamp = krule->timestamp;
} }
if (cntr->timestamp > 0) if (cntr->timestamp > 0) {
getboottime(&boottime);
cntr->timestamp += boottime.tv_sec; cntr->timestamp += boottime.tv_sec;
}
} }
/* /*
@ -2055,11 +2061,13 @@ ipfw_getrules(struct ip_fw_chain *chain, void *buf, size_t space)
char *ep = bp + space; char *ep = bp + space;
struct ip_fw *rule; struct ip_fw *rule;
struct ip_fw_rule0 *dst; struct ip_fw_rule0 *dst;
struct timeval boottime;
int error, i, l, warnflag; int error, i, l, warnflag;
time_t boot_seconds; time_t boot_seconds;
warnflag = 0; warnflag = 0;
getboottime(&boottime);
boot_seconds = boottime.tv_sec; boot_seconds = boottime.tv_sec;
for (i = 0; i < chain->n_rules; i++) { for (i = 0; i < chain->n_rules; i++) {
rule = chain->map[i]; rule = chain->map[i];

View File

@ -241,6 +241,7 @@ nfs_dolock(struct vop_advlock_args *ap)
struct flock *fl; struct flock *fl;
struct proc *p; struct proc *p;
struct nfsmount *nmp; struct nfsmount *nmp;
struct timeval boottime;
td = curthread; td = curthread;
p = td->td_proc; p = td->td_proc;
@ -284,6 +285,7 @@ nfs_dolock(struct vop_advlock_args *ap)
p->p_nlminfo = malloc(sizeof(struct nlminfo), p->p_nlminfo = malloc(sizeof(struct nlminfo),
M_NLMINFO, M_WAITOK | M_ZERO); M_NLMINFO, M_WAITOK | M_ZERO);
p->p_nlminfo->pid_start = p->p_stats->p_start; p->p_nlminfo->pid_start = p->p_stats->p_start;
getboottime(&boottime);
timevaladd(&p->p_nlminfo->pid_start, &boottime); timevaladd(&p->p_nlminfo->pid_start, &boottime);
} }
msg.lm_msg_ident.pid_start = p->p_nlminfo->pid_start; msg.lm_msg_ident.pid_start = p->p_nlminfo->pid_start;

View File

@ -504,11 +504,13 @@ svc_rpc_gss_find_client(struct svc_rpc_gss_clientid *id)
{ {
struct svc_rpc_gss_client *client; struct svc_rpc_gss_client *client;
struct svc_rpc_gss_client_list *list; struct svc_rpc_gss_client_list *list;
struct timeval boottime;
unsigned long hostid; unsigned long hostid;
rpc_gss_log_debug("in svc_rpc_gss_find_client(%d)", id->ci_id); rpc_gss_log_debug("in svc_rpc_gss_find_client(%d)", id->ci_id);
getcredhostid(curthread->td_ucred, &hostid); getcredhostid(curthread->td_ucred, &hostid);
getboottime(&boottime);
if (id->ci_hostid != hostid || id->ci_boottime != boottime.tv_sec) if (id->ci_hostid != hostid || id->ci_boottime != boottime.tv_sec)
return (NULL); return (NULL);
@ -537,6 +539,7 @@ svc_rpc_gss_create_client(void)
{ {
struct svc_rpc_gss_client *client; struct svc_rpc_gss_client *client;
struct svc_rpc_gss_client_list *list; struct svc_rpc_gss_client_list *list;
struct timeval boottime;
unsigned long hostid; unsigned long hostid;
rpc_gss_log_debug("in svc_rpc_gss_create_client()"); rpc_gss_log_debug("in svc_rpc_gss_create_client()");
@ -547,6 +550,7 @@ svc_rpc_gss_create_client(void)
sx_init(&client->cl_lock, "GSS-client"); sx_init(&client->cl_lock, "GSS-client");
getcredhostid(curthread->td_ucred, &hostid); getcredhostid(curthread->td_ucred, &hostid);
client->cl_id.ci_hostid = hostid; client->cl_id.ci_hostid = hostid;
getboottime(&boottime);
client->cl_id.ci_boottime = boottime.tv_sec; client->cl_id.ci_boottime = boottime.tv_sec;
client->cl_id.ci_id = svc_rpc_gss_next_clientid++; client->cl_id.ci_id = svc_rpc_gss_next_clientid++;
list = &svc_rpc_gss_client_hash[client->cl_id.ci_id % CLIENT_HASH_SIZE]; list = &svc_rpc_gss_client_hash[client->cl_id.ci_id % CLIENT_HASH_SIZE];

View File

@ -372,8 +372,6 @@ void resettodr(void);
extern volatile time_t time_second; extern volatile time_t time_second;
extern volatile time_t time_uptime; extern volatile time_t time_uptime;
extern struct bintime boottimebin;
extern struct timeval boottime;
extern struct bintime tc_tick_bt; extern struct bintime tc_tick_bt;
extern sbintime_t tc_tick_sbt; extern sbintime_t tc_tick_sbt;
extern struct bintime tick_bt; extern struct bintime tick_bt;
@ -440,6 +438,9 @@ void getbintime(struct bintime *bt);
void getnanotime(struct timespec *tsp); void getnanotime(struct timespec *tsp);
void getmicrotime(struct timeval *tvp); void getmicrotime(struct timeval *tvp);
void getboottime(struct timeval *boottime);
void getboottimebin(struct bintime *boottimebin);
/* Other functions */ /* Other functions */
int itimerdecr(struct itimerval *itp, int usec); int itimerdecr(struct itimerval *itp, int usec);
int itimerfix(struct timeval *tv); int itimerfix(struct timeval *tv);