summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_fork.c
diff options
context:
space:
mode:
authorart <art@openbsd.org>2000-03-23 16:54:43 +0000
committerart <art@openbsd.org>2000-03-23 16:54:43 +0000
commitd256b03a776c2cbec7b02264a5e4a253a24fe78e (patch)
tree9cc14a8b7ab4bc2e48a1dd027cd4bc0b29e5b7d3 /sys/kern/kern_fork.c
parentAnother typo. Noted by aaron. (diff)
downloadwireguard-openbsd-d256b03a776c2cbec7b02264a5e4a253a24fe78e.tar.xz
wireguard-openbsd-d256b03a776c2cbec7b02264a5e4a253a24fe78e.zip
Don't reinitialize the tsleep and ITIMER_REAL timers all the time.
The function and the argument never change.
Diffstat (limited to 'sys/kern/kern_fork.c')
-rw-r--r--sys/kern/kern_fork.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c
index 55c0ac1710c..b2a08f77625 100644
--- a/sys/kern/kern_fork.c
+++ b/sys/kern/kern_fork.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_fork.c,v 1.30 2000/03/03 11:46:09 art Exp $ */
+/* $OpenBSD: kern_fork.c,v 1.31 2000/03/23 16:54:44 art Exp $ */
/* $NetBSD: kern_fork.c,v 1.29 1996/02/09 18:59:34 christos Exp $ */
/*
@@ -141,13 +141,15 @@ fork1(p1, flags, stack, stacksize, retval)
size_t stacksize;
register_t *retval;
{
- register struct proc *p2;
- register uid_t uid;
+ struct proc *p2;
+ uid_t uid;
struct proc *newproc;
struct vmspace *vm;
int count;
static int pidchecked = 0;
vaddr_t uaddr;
+ extern void endtsleep __P((void *));
+ extern void realitexpire __P((void *));
/*
* Although process entries are dynamically created, we still keep
@@ -252,6 +254,12 @@ again:
(unsigned) ((caddr_t)&p2->p_endcopy - (caddr_t)&p2->p_startcopy));
/*
+ * Initialize the timeouts.
+ */
+ timeout_set(&p2->p_sleep_to, endtsleep, p2);
+ timeout_set(&p2->p_realit_to, realitexpire, p2);
+
+ /*
* Duplicate sub-structures as needed.
* Increase reference counts on shared objects.
* The p_stats and p_sigacts substructs are set in vm_fork.