diff options
author | Ian Lance Taylor <iant@golang.org> | 2016-08-04 19:53:52 -0700 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2016-08-05 19:48:42 +0000 |
commit | 3a03e877cc03c1fd155055e60a3f1f9cb8bda8d0 (patch) | |
tree | 9ecdecc94a2b973e438422facdc86787dc8b69e3 | |
parent | 10316757cec3c2744ea61088e0fc905cfeb28fb2 (diff) | |
download | go-3a03e877cc03c1fd155055e60a3f1f9cb8bda8d0.tar.gz go-3a03e877cc03c1fd155055e60a3f1f9cb8bda8d0.zip |
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 <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-rw-r--r-- | src/os/wait_waitid.go | 6 |
1 files changed, 6 insertions, 0 deletions
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 |