diff options
author | Bret Lambert <blambert@cvs.openbsd.org> | 2008-05-02 14:07:16 +0000 |
---|---|---|
committer | Bret Lambert <blambert@cvs.openbsd.org> | 2008-05-02 14:07:16 +0000 |
commit | d6447a68c24855cb6b98126fc3745338658361de (patch) | |
tree | 16eba2483942574a94c403f09ca87897d16eeaa0 /sys/kern | |
parent | 93c715a9207d0cdc0efeed608385289f47377649 (diff) |
Pass FORK_SHAREFILES flag in kthread_create; avoids allocating a
filedesc struct and associated fdcopy operation on kernel thread
creation. Instead, kernel threads share and bump reference count
on proc0's filedesc.
ok thib@, "definitely makes sense" art@
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_kthread.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/kern_kthread.c b/sys/kern/kern_kthread.c index 1eae0eae8b7..787b7c30ff4 100644 --- a/sys/kern/kern_kthread.c +++ b/sys/kern/kern_kthread.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_kthread.c,v 1.28 2007/09/07 15:00:20 art Exp $ */ +/* $OpenBSD: kern_kthread.c,v 1.29 2008/05/02 14:07:15 blambert Exp $ */ /* $NetBSD: kern_kthread.c,v 1.3 1998/12/22 21:21:36 kleink Exp $ */ /*- @@ -75,8 +75,8 @@ 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, NULL, &p2); + error = fork1(&proc0, 0, FORK_SHAREVM|FORK_SHAREFILES|FORK_NOZOMBIE| + FORK_SIGHAND, NULL, 0, func, arg, NULL, &p2); if (error) return (error); |