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 /lib/libc | |
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 'lib/libc')
-rw-r--r-- | lib/libc/sys/wait.2 | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/libc/sys/wait.2 b/lib/libc/sys/wait.2 index 84b2b1a..a45e78a 100644 --- a/lib/libc/sys/wait.2 +++ b/lib/libc/sys/wait.2 @@ -362,6 +362,15 @@ field set to and the .Fa si_pid field set to the process ID of the process reporting status. +For the exited process, the +.Fa si_status +field of the +.Dv siginfo_t +structure contains the full 32 bit exit status passed to +.Xr _exit 2 ; +the +.Fa status +argument of other calls only returns 8 lowest bits of the exit status. .Pp When the .Dv WNOHANG @@ -656,13 +665,6 @@ is an extension; .Tn POSIX only permits this flag with .Fn waitid . -.Pp -.Tn POSIX -requires -.Fn waitid -to return the full 32 bits passed to -.Xr _exit 2 ; -this implementation only returns 8 bits like the other calls. .Sh HISTORY The .Fn wait |