summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_exec.c
diff options
context:
space:
mode:
authordillon <dillon@FreeBSD.org>2001-09-01 03:04:31 +0000
committerdillon <dillon@FreeBSD.org>2001-09-01 03:04:31 +0000
commitd1a6cbe1d59ffdd8715479fc5ceb20e567812005 (patch)
tree6e2be2d0ad774719f30ae9d248628c0f48614db6 /sys/kern/kern_exec.c
parent5610a6ae63a163468769d8b1400a386115b53ddf (diff)
downloadFreeBSD-src-d1a6cbe1d59ffdd8715479fc5ceb20e567812005.zip
FreeBSD-src-d1a6cbe1d59ffdd8715479fc5ceb20e567812005.tar.gz
Pushdown Giant for acct(), kqueue(), kevent(), execve(), fork(),
vfork(), rfork(), jail().
Diffstat (limited to 'sys/kern/kern_exec.c')
-rw-r--r--sys/kern/kern_exec.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
index c2e47d4..90a4f4c 100644
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -98,6 +98,8 @@ struct execve_args {
/*
* execve() system call.
+ *
+ * MPSAFE
*/
int
execve(p, uap)
@@ -133,6 +135,8 @@ execve(p, uap)
imgp->ps_strings = 0;
imgp->auxarg_size = 0;
+ mtx_lock(&Giant);
+
/*
* Allocate temporary demand zeroed space for argument and
* environment strings
@@ -445,17 +449,18 @@ exec_fail_dealloc:
}
if (error == 0)
- return (0);
+ goto done2;
exec_fail:
if (imgp->vmspace_destroyed) {
/* sorry, no more process anymore. exit gracefully */
exit1(p, W_EXITCODE(0, SIGABRT));
/* NOT REACHED */
- return(0);
- } else {
- return(error);
- }
+ error = 0;
+ }
+done2:
+ mtx_unlock(&Giant);
+ return(error);
}
int
OpenPOWER on IntegriCloud