diff options
author | davidxu <davidxu@FreeBSD.org> | 2004-10-07 13:50:10 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2004-10-07 13:50:10 +0000 |
commit | 94500a033672dc789c56e4522186c8fd37178ccc (patch) | |
tree | 9d48e67427fd64f920838673e8454045c51ee92c /sys/kern/kern_kse.c | |
parent | f0350755fadbfdd20f28e83d8bc25421037974fd (diff) | |
download | FreeBSD-src-94500a033672dc789c56e4522186c8fd37178ccc.zip FreeBSD-src-94500a033672dc789c56e4522186c8fd37178ccc.tar.gz |
Add an execve command for kse_thr_interrupt to allow libpthread to
restore signal mask correctly, this is required by POSIX.
Reviewed by: deischen
Diffstat (limited to 'sys/kern/kern_kse.c')
-rw-r--r-- | sys/kern/kern_kse.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/sys/kern/kern_kse.c b/sys/kern/kern_kse.c index eff18d1..5a98f82 100644 --- a/sys/kern/kern_kse.c +++ b/sys/kern/kern_kse.c @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include <sys/proc.h> #include <sys/ptrace.h> #include <sys/smp.h> +#include <sys/syscallsubr.h> #include <sys/sysproto.h> #include <sys/sched.h> #include <sys/signalvar.h> @@ -176,11 +177,13 @@ struct kse_thr_interrupt_args { int kse_thr_interrupt(struct thread *td, struct kse_thr_interrupt_args *uap) { + struct kse_execve_args args; struct proc *p; struct thread *td2; struct kse_upcall *ku; struct kse_thr_mailbox *tmbx; uint32_t flags; + int error; p = td->td_proc; @@ -256,6 +259,20 @@ kse_thr_interrupt(struct thread *td, struct kse_thr_interrupt_args *uap) } return (0); + case KSE_INTR_EXECVE: + error = copyin((void *)uap->data, &args, sizeof(args)); + if (error) + return (error); + error = kern_execve(td, args.path, args.argv, args.envp, NULL); + if (error == 0) { + PROC_LOCK(p); + SIGSETOR(td->td_siglist, args.sigpend); + PROC_UNLOCK(p); + kern_sigprocmask(td, SIG_SETMASK, &args.sigmask, NULL, + 0); + } + return (error); + default: return (EINVAL); } |