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/fs | |
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/fs')
-rw-r--r-- | sys/fs/procfs/procfs_ctl.c | 6 | ||||
-rw-r--r-- | sys/fs/procfs/procfs_ioctl.c | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/sys/fs/procfs/procfs_ctl.c b/sys/fs/procfs/procfs_ctl.c index 15679e3..b1f1cc8 100644 --- a/sys/fs/procfs/procfs_ctl.c +++ b/sys/fs/procfs/procfs_ctl.c @@ -142,7 +142,7 @@ procfs_control(struct thread *td, struct proc *p, int op) */ p->p_flag |= P_TRACED; faultin(p); - p->p_xstat = 0; /* XXX ? */ + p->p_xsig = 0; /* XXX ? */ p->p_oppid = p->p_pptr->p_pid; if (p->p_pptr != td->td_proc) { proc_reparent(p, td->td_proc); @@ -198,7 +198,7 @@ out: * To continue with a signal, just send * the signal name to the ctl file */ - p->p_xstat = 0; + p->p_xsig = 0; switch (op) { /* @@ -340,7 +340,7 @@ procfs_doprocctl(PFS_FILL_ARGS) PROC_LOCK(p); if (TRACE_WAIT_P(td->td_proc, p)) { - p->p_xstat = nm->nm_val; + p->p_xsig = nm->nm_val; #ifdef FIX_SSTEP FIX_SSTEP(FIRST_THREAD_IN_PROC(p)); #endif diff --git a/sys/fs/procfs/procfs_ioctl.c b/sys/fs/procfs/procfs_ioctl.c index 3fa00bc..0f37f07 100644 --- a/sys/fs/procfs/procfs_ioctl.c +++ b/sys/fs/procfs/procfs_ioctl.c @@ -140,7 +140,7 @@ procfs_ioctl(PFS_IOCTL_ARGS) ps->flags = 0; /* nope */ ps->events = p->p_stops; ps->why = p->p_step ? p->p_stype : 0; - ps->val = p->p_step ? p->p_xstat : 0; + ps->val = p->p_step ? p->p_xsig : 0; break; #ifdef COMPAT_FREEBSD32 case PIOCWAIT32: @@ -160,7 +160,7 @@ procfs_ioctl(PFS_IOCTL_ARGS) ps32->flags = 0; /* nope */ ps32->events = p->p_stops; ps32->why = p->p_step ? p->p_stype : 0; - ps32->val = p->p_step ? p->p_xstat : 0; + ps32->val = p->p_step ? p->p_xsig : 0; break; #endif #if defined(COMPAT_FREEBSD5) || defined(COMPAT_FREEBSD4) || defined(COMPAT_43) @@ -182,7 +182,7 @@ procfs_ioctl(PFS_IOCTL_ARGS) #if 0 p->p_step = 0; if (P_SHOULDSTOP(p)) { - p->p_xstat = sig; + p->p_xsig = sig; p->p_flag &= ~(P_STOPPED_TRACE|P_STOPPED_SIG); PROC_SLOCK(p); thread_unsuspend(p); |