summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2023-02-15 10:07:51 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2023-02-15 10:07:51 +0000
commit523626fb93ebfa5c7d49d17b3584f666a9a81dc1 (patch)
tree69f076241531bc2eceb0a85970e64a1be6d68a4b /sys/kern
parent92a78fe49d218cdd2ac0d02f63237c7e632986fc (diff)
Use the nowake channel for sys_nanosleep() instead of handrolling the same.
OK cheloha@ jca@ mvs@
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_time.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c
index 9072595194f..9caf7c1f327 100644
--- a/sys/kern/kern_time.c
+++ b/sys/kern/kern_time.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_time.c,v 1.162 2023/02/04 19:33:03 cheloha Exp $ */
+/* $OpenBSD: kern_time.c,v 1.163 2023/02/15 10:07:50 claudio Exp $ */
/* $NetBSD: kern_time.c,v 1.20 1996/02/18 11:57:06 fvdl Exp $ */
/*
@@ -269,7 +269,6 @@ sys_clock_getres(struct proc *p, void *v, register_t *retval)
int
sys_nanosleep(struct proc *p, void *v, register_t *retval)
{
- static int chan;
struct sys_nanosleep_args/* {
syscallarg(const struct timespec *) rqtp;
syscallarg(struct timespec *) rmtp;
@@ -294,7 +293,7 @@ sys_nanosleep(struct proc *p, void *v, register_t *retval)
do {
getnanouptime(&start);
nsecs = MAX(1, MIN(TIMESPEC_TO_NSEC(&request), MAXTSLP));
- error = tsleep_nsec(&chan, PWAIT | PCATCH, "nanoslp", nsecs);
+ error = tsleep_nsec(&nowake, PWAIT | PCATCH, "nanoslp", nsecs);
getnanouptime(&stop);
timespecsub(&stop, &start, &elapsed);
timespecsub(&request, &elapsed, &request);