summaryrefslogtreecommitdiffstats
path: root/sys/compat
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2015-07-18 09:02:50 +0000
committerkib <kib@FreeBSD.org>2015-07-18 09:02:50 +0000
commit48ccbdea817fb25a05eb4024844eec6ec81249a7 (patch)
tree5d1411f5124df7d1ff8fb76e514e51a232fa0406 /sys/compat
parentcad9ad69e50ec0e79836106ef79f5c6e37973b3d (diff)
downloadFreeBSD-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/compat')
-rw-r--r--sys/compat/cloudabi/cloudabi_proc.c2
-rw-r--r--sys/compat/linux/linux_fork.c2
-rw-r--r--sys/compat/linux/linux_misc.c2
-rw-r--r--sys/compat/svr4/svr4_misc.c4
4 files changed, 5 insertions, 5 deletions
diff --git a/sys/compat/cloudabi/cloudabi_proc.c b/sys/compat/cloudabi/cloudabi_proc.c
index a5bc85a..dba1412 100644
--- a/sys/compat/cloudabi/cloudabi_proc.c
+++ b/sys/compat/cloudabi/cloudabi_proc.c
@@ -57,7 +57,7 @@ cloudabi_sys_proc_exit(struct thread *td,
struct cloudabi_sys_proc_exit_args *uap)
{
- exit1(td, W_EXITCODE(uap->rval, 0));
+ exit1(td, uap->rval, 0);
/* NOTREACHED */
}
diff --git a/sys/compat/linux/linux_fork.c b/sys/compat/linux/linux_fork.c
index 394c26f..6b37490 100644
--- a/sys/compat/linux/linux_fork.c
+++ b/sys/compat/linux/linux_fork.c
@@ -398,7 +398,7 @@ linux_exit(struct thread *td, struct linux_exit_args *args)
* exit via pthread_exit() try thr_exit() first.
*/
kern_thr_exit(td);
- exit1(td, W_EXITCODE(args->rval, 0));
+ exit1(td, args->rval, 0);
/* NOTREACHED */
}
diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c
index fa5feaf..ccb618c 100644
--- a/sys/compat/linux/linux_misc.c
+++ b/sys/compat/linux/linux_misc.c
@@ -1839,7 +1839,7 @@ linux_exit_group(struct thread *td, struct linux_exit_group_args *args)
* SIGNAL_EXIT_GROUP is set. We ignore that (temporarily?)
* as it doesnt occur often.
*/
- exit1(td, W_EXITCODE(args->error_code, 0));
+ exit1(td, args->error_code, 0);
/* NOTREACHED */
}
diff --git a/sys/compat/svr4/svr4_misc.c b/sys/compat/svr4/svr4_misc.c
index 5e53874..b560764 100644
--- a/sys/compat/svr4/svr4_misc.c
+++ b/sys/compat/svr4/svr4_misc.c
@@ -1277,7 +1277,7 @@ loop:
/* Found a zombie, so cache info in local variables. */
pid = p->p_pid;
- status = p->p_xstat;
+ status = KW_EXITCODE(p->p_xexit, p->p_xsig);
ru = p->p_ru;
PROC_STATLOCK(p);
calcru(p, &ru.ru_utime, &ru.ru_stime);
@@ -1304,7 +1304,7 @@ loop:
p->p_flag |= P_WAITED;
sx_sunlock(&proctree_lock);
pid = p->p_pid;
- status = W_STOPCODE(p->p_xstat);
+ status = W_STOPCODE(p->p_xsig);
ru = p->p_ru;
PROC_STATLOCK(p);
calcru(p, &ru.ru_utime, &ru.ru_stime);
OpenPOWER on IntegriCloud