diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/sys/wait.2 | 16 | ||||
-rw-r--r-- | lib/libkvm/kvm_proc.c | 4 |
2 files changed, 12 insertions, 8 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 diff --git a/lib/libkvm/kvm_proc.c b/lib/libkvm/kvm_proc.c index aed61a8..bafe105 100644 --- a/lib/libkvm/kvm_proc.c +++ b/lib/libkvm/kvm_proc.c @@ -66,6 +66,8 @@ __FBSDID("$FreeBSD$"); #include <sys/tty.h> #include <sys/file.h> #include <sys/conf.h> +#define _WANT_KW_EXITCODE +#include <sys/wait.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> @@ -389,7 +391,7 @@ nopgrp: kp->ki_siglist = proc.p_siglist; SIGSETOR(kp->ki_siglist, mtd.td_siglist); kp->ki_sigmask = mtd.td_sigmask; - kp->ki_xstat = proc.p_xstat; + kp->ki_xstat = KW_EXITCODE(proc.p_xexit, proc.p_xsig); kp->ki_acflag = proc.p_acflag; kp->ki_lock = proc.p_lock; if (proc.p_state != PRS_ZOMBIE) { |