diff options
author | kib <kib@FreeBSD.org> | 2015-07-18 09:02:50 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2015-07-18 09:02:50 +0000 |
commit | 48ccbdea817fb25a05eb4024844eec6ec81249a7 (patch) | |
tree | 5d1411f5124df7d1ff8fb76e514e51a232fa0406 /sys/kern/kern_proc.c | |
parent | cad9ad69e50ec0e79836106ef79f5c6e37973b3d (diff) | |
download | FreeBSD-src-48ccbdea817fb25a05eb4024844eec6ec81249a7.zip FreeBSD-src-48ccbdea817fb25a05eb4024844eec6ec81249a7.tar.gz |
The si_status field of the siginfo_t, provided by the waitid(2) and
SIGCHLD signal, should keep full 32 bits of the status passed to the
_exit(2).
Split the combined p_xstat of the struct proc into the separate exit
status p_xexit for normal process exit, and signalled termination
information p_xsig. Kernel-visible macro KW_EXITCODE() reconstructs
old p_xstat from p_xexit and p_xsig. p_xexit contains complete status
and copied out into si_status.
Requested by: Joerg Schilling
Reviewed by: jilles (previous version), pho
Tested by: pho
Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'sys/kern/kern_proc.c')
-rw-r--r-- | sys/kern/kern_proc.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index 27c6f40..3c88a59 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -41,7 +41,9 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> #include <sys/systm.h> #include <sys/elf.h> +#include <sys/eventhandler.h> #include <sys/exec.h> +#include <sys/jail.h> #include <sys/kernel.h> #include <sys/limits.h> #include <sys/lock.h> @@ -68,9 +70,8 @@ __FBSDID("$FreeBSD$"); #include <sys/sdt.h> #include <sys/sx.h> #include <sys/user.h> -#include <sys/jail.h> #include <sys/vnode.h> -#include <sys/eventhandler.h> +#include <sys/wait.h> #ifdef DDB #include <ddb/ddb.h> @@ -920,7 +921,7 @@ fill_kinfo_proc_only(struct proc *p, struct kinfo_proc *kp) p->p_sysent->sv_name[0] != '\0') strlcpy(kp->ki_emul, p->p_sysent->sv_name, sizeof(kp->ki_emul)); kp->ki_siglist = p->p_siglist; - kp->ki_xstat = p->p_xstat; + kp->ki_xstat = KW_EXITCODE(p->p_xexit, p->p_xsig); kp->ki_acflag = p->p_acflag; kp->ki_lock = p->p_lock; if (p->p_pptr) { |