Commit da1da8d0 authored by Austin Clements's avatar Austin Clements

Add accessor for SIGTRAP cause in wait status

R=rsc
APPROVED=rsc
DELTA=7  (7 added, 0 deleted, 0 changed)
OCL=31563
CL=31565
parent 218c3930
...@@ -164,6 +164,13 @@ func (w WaitStatus) StopSignal() int { ...@@ -164,6 +164,13 @@ func (w WaitStatus) StopSignal() int {
return int(w >> shift) & 0xFF; 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) //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) { func Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, errno int) {
var status _C_int; var status _C_int;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment