diff options
author | Otto Moerbeek <otto@cvs.openbsd.org> | 2006-06-04 18:47:34 +0000 |
---|---|---|
committer | Otto Moerbeek <otto@cvs.openbsd.org> | 2006-06-04 18:47:34 +0000 |
commit | 6dc76771d7db62df59f4974ea3849648a9678b55 (patch) | |
tree | 1ac8eaad593d99db2772397df7d5f277ade7631e /sys/kern | |
parent | 42e4130d0a6fcb41516f4c08ada976c9427f2112 (diff) |
Allow any user to request the current adjustment; ok henning@ deraadt@
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_time.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c index c8f2fa62e31..7bffe722027 100644 --- a/sys/kern/kern_time.c +++ b/sys/kern/kern_time.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_time.c,v 1.54 2006/01/20 07:53:48 tedu Exp $ */ +/* $OpenBSD: kern_time.c,v 1.55 2006/06/04 18:47:33 otto Exp $ */ /* $NetBSD: kern_time.c,v 1.20 1996/02/18 11:57:06 fvdl Exp $ */ /* @@ -385,6 +385,12 @@ sys_adjtime(struct proc *p, void *v, register_t *retval) long ndelta, ntickdelta, odelta; int s, error; + if (!SCARG(uap, delta)) { + s = splclock(); + odelta = timedelta; + splx(s); + goto out; + } if ((error = suser(p, 0))) return (error); if ((error = copyin((void *)SCARG(uap, delta), (void *)&atv, @@ -432,6 +438,7 @@ sys_adjtime(struct proc *p, void *v, register_t *retval) tickdelta = ntickdelta; splx(s); +out: if (SCARG(uap, olddelta)) { atv.tv_sec = odelta / 1000000; atv.tv_usec = odelta % 1000000; |