mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
Add accessor for SIGTRAP cause in wait status
R=rsc APPROVED=rsc DELTA=7 (7 added, 0 deleted, 0 changed) OCL=31563 CL=31565
This commit is contained in:
parent
218c393029
commit
da1da8d07e
1 changed files with 7 additions and 0 deletions
|
|
@ -164,6 +164,13 @@ func (w WaitStatus) StopSignal() int {
|
|||
return int(w >> shift) & 0xFF;
|
||||
}
|
||||
|
||||
func (w WaitStatus) TrapCause() int {
|
||||
if w.StopSignal() != SIGTRAP {
|
||||
return -1;
|
||||
}
|
||||
return int(w >> shift) >> 8;
|
||||
}
|
||||
|
||||
//sys wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, errno int)
|
||||
func Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, errno int) {
|
||||
var status _C_int;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue