diff options
author | jhb <jhb@FreeBSD.org> | 2001-10-26 08:12:54 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2001-10-26 08:12:54 +0000 |
commit | 46e3f92a5d9268f6cd24fb05657ca80cc78f3aa4 (patch) | |
tree | ea93762e897a0b2d2eca0a29032d37f114739a9f /sys/kern/init_main.c | |
parent | 83e21bd3fa88980898951b32af3e4126bfa94a29 (diff) | |
download | FreeBSD-src-46e3f92a5d9268f6cd24fb05657ca80cc78f3aa4.zip FreeBSD-src-46e3f92a5d9268f6cd24fb05657ca80cc78f3aa4.tar.gz |
Add a per-thread ucred reference for syscalls and synchronous traps from
userland. The per thread ucred reference is immutable and thus needs no
locks to be read. However, until all the proc locking associated with
writes to p_ucred are completed, it is still not safe to use the per-thread
reference.
Tested on: x86 (SMP), alpha, sparc64
Diffstat (limited to 'sys/kern/init_main.c')
-rw-r--r-- | sys/kern/init_main.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index 5491cef..438f2f9 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -347,6 +347,7 @@ proc0_init(void *dummy __unused) p->p_ucred->cr_uidinfo = uifind(0); p->p_ucred->cr_ruidinfo = uifind(0); p->p_ucred->cr_prison = NULL; /* Don't jail it. */ + td->td_ucred = crhold(p->p_ucred); /* Create procsig. */ p->p_procsig = &procsig0; |