diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2004-11-23 19:08:56 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2004-11-23 19:08:56 +0000 |
commit | 17ea3d00ad6ab51534668f0fa412c36101fa7229 (patch) | |
tree | eb0194f91fff140acba852d73e1785ae62e67581 /sys/kern/kern_kthread.c | |
parent | 6506a735d9eb4cb6f15cdff9ad2e4fff2e0e8bdb (diff) |
Create the init process earlier, before the root filesystem is mounted,
and have it stall on a semaphore. This allows all kthread creations which
could have been requested during autoconf to be processed before root
is mounted as well.
This causes umass devices attached to any usb with flags 1 (such as on macppc)
to configure properly instead of panicing the kernel at mountroot time.
From NetBSD; tested by various.
Diffstat (limited to 'sys/kern/kern_kthread.c')
-rw-r--r-- | sys/kern/kern_kthread.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/sys/kern/kern_kthread.c b/sys/kern/kern_kthread.c index 44c85d176a3..721c440c999 100644 --- a/sys/kern/kern_kthread.c +++ b/sys/kern/kern_kthread.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_kthread.c,v 1.22 2004/05/04 16:59:32 grange Exp $ */ +/* $OpenBSD: kern_kthread.c,v 1.23 2004/11/23 19:08:55 miod Exp $ */ /* $NetBSD: kern_kthread.c,v 1.3 1998/12/22 21:21:36 kleink Exp $ */ /*- @@ -65,7 +65,6 @@ kthread_create(void (*func)(void *), void *arg, struct proc **newpp, const char *fmt, ...) { struct proc *p2; - register_t rv[2]; int error; va_list ap; @@ -74,13 +73,11 @@ kthread_create(void (*func)(void *), void *arg, * descriptors and don't leave the exit status around for the * parent to wait for. */ - error = fork1(&proc0, 0, - FORK_SHAREVM|FORK_NOZOMBIE|FORK_SIGHAND, NULL, 0, func, arg, rv); + error = fork1(&proc0, 0, FORK_SHAREVM |FORK_NOZOMBIE |FORK_SIGHAND, + NULL, 0, func, arg, NULL, &p2); if (error) return (error); - p2 = pfind(rv[0]); - /* * Mark it as a system process and not a candidate for * swapping. |