From 3a03e877cc03c1fd155055e60a3f1f9cb8bda8d0 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 4 Aug 2016 19:53:52 -0700 Subject: [PATCH] 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 --- src/os/wait_waitid.go | 6 ++++++ 1 file changed, 6 insertions(+) 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 -- 2.50.0