From: Ian Lance Taylor Date: Fri, 5 Aug 2016 02:53:52 +0000 (-0700) Subject: os: check for waitid returning ENOSYS X-Git-Tag: go1.7rc6~1^2~4 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=3a03e87;p=gostls13.git os: check for waitid returning ENOSYS Reportedly waitid is not available for Ubuntu on Windows. Fixes #16610. Change-Id: Ia724f45a85c6d3467b847da06d8c65d280781dcd Reviewed-on: https://go-review.googlesource.com/25507 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- diff --git a/src/os/wait_waitid.go b/src/os/wait_waitid.go index 5dbd7f9766..74b7494c0d 100644 --- a/src/os/wait_waitid.go +++ b/src/os/wait_waitid.go @@ -28,6 +28,12 @@ func (p *Process) blockUntilWaitable() (bool, error) { _, _, e := syscall.Syscall6(syscall.SYS_WAITID, _P_PID, uintptr(p.Pid), uintptr(unsafe.Pointer(psig)), syscall.WEXITED|syscall.WNOWAIT, 0, 0) runtime.KeepAlive(psig) if e != 0 { + // waitid has been available since Linux 2.6.9, but + // reportedly is not available in Ubuntu on Windows. + // See issue 16610. + if e == syscall.ENOSYS { + return false, nil + } return false, NewSyscallError("waitid", e) } return true, nil