diff options
Diffstat (limited to 'libgo/go/os/wait_waitid.go')
-rw-r--r-- | libgo/go/os/wait_waitid.go | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/libgo/go/os/wait_waitid.go b/libgo/go/os/wait_waitid.go index 4bb77f9c542..2c39f9bcd94 100644 --- a/libgo/go/os/wait_waitid.go +++ b/libgo/go/os/wait_waitid.go @@ -23,12 +23,18 @@ const _P_PID = 1 func (p *Process) blockUntilWaitable() (bool, error) { // The waitid system call expects a pointer to a siginfo_t, // which is 128 bytes on all GNU/Linux systems. - // On Darwin, it requires greater than or equal to 64 bytes - // for darwin/{386,arm} and 104 bytes for darwin/amd64. + // On darwin/amd64, it requires 104 bytes. // We don't care about the values it returns. var siginfo [16]uint64 psig := &siginfo[0] - r, _, e := syscall.Syscall6(syscall.SYS_WAITID, _P_PID, uintptr(p.Pid), uintptr(unsafe.Pointer(psig)), syscall.WEXITED|syscall.WNOWAIT, 0, 0) + var r uintptr + var e syscall.Errno + for { + r, _, e = syscall.Syscall6(syscall.SYS_WAITID, _P_PID, uintptr(p.Pid), uintptr(unsafe.Pointer(psig)), syscall.WEXITED|syscall.WNOWAIT, 0, 0) + if e != syscall.EINTR { + break + } + } runtime.KeepAlive(p) // Check r as well as e because syscall.Syscall6 currently // just returns errno, and the SIGCHLD signal handler may |