summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_fork.c
diff options
context:
space:
mode:
authorcheloha <cheloha@openbsd.org>2020-10-25 01:55:18 +0000
committercheloha <cheloha@openbsd.org>2020-10-25 01:55:18 +0000
commit561191346fcf038ae774cabbf7536acc1de7d4a1 (patch)
tree5b2049bd27f2c121fab53d81cb2b071c580495ae /sys/kern/kern_fork.c
parentrecognise some more realtek codecs found in submitted dmesgs (diff)
downloadwireguard-openbsd-561191346fcf038ae774cabbf7536acc1de7d4a1.tar.xz
wireguard-openbsd-561191346fcf038ae774cabbf7536acc1de7d4a1.zip
setitimer(2): ITIMER_REAL: use kclock timeouts
Reimplement the ITIMER_REAL interval timer with a kclock timeout. Couple things of note: - We need to use the high-res nanouptime(9) call, not the low-res getnanouptime(9). - The code is simpler now that we aren't working with ticks. Misc. thoughts: - Still unsure if "kclock" is the right name for these things. - MP-safely cancelling a periodic timeout is very difficult.
Diffstat (limited to 'sys/kern/kern_fork.c')
-rw-r--r--sys/kern/kern_fork.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c
index 6cfb39b6252..9fb239bc8b4 100644
--- a/sys/kern/kern_fork.c
+++ b/sys/kern/kern_fork.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_fork.c,v 1.225 2020/03/20 08:14:07 claudio Exp $ */
+/* $OpenBSD: kern_fork.c,v 1.226 2020/10/25 01:55:18 cheloha Exp $ */
/* $NetBSD: kern_fork.c,v 1.29 1996/02/09 18:59:34 christos Exp $ */
/*
@@ -198,7 +198,8 @@ process_initialize(struct process *pr, struct proc *p)
rw_init(&pr->ps_lock, "pslock");
mtx_init(&pr->ps_mtx, IPL_MPFLOOR);
- timeout_set(&pr->ps_realit_to, realitexpire, pr);
+ timeout_set_kclock(&pr->ps_realit_to, realitexpire, pr, 0,
+ KCLOCK_UPTIME);
timeout_set(&pr->ps_rucheck_to, rucheck, pr);
}