Skip to content

Commit 3a03e87

Browse files
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 <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]>
1 parent 1031675 commit 3a03e87

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/os/wait_waitid.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ func (p *Process) blockUntilWaitable() (bool, error) {
2828
_, _, e := syscall.Syscall6(syscall.SYS_WAITID, _P_PID, uintptr(p.Pid), uintptr(unsafe.Pointer(psig)), syscall.WEXITED|syscall.WNOWAIT, 0, 0)
2929
runtime.KeepAlive(psig)
3030
if e != 0 {
31+
// waitid has been available since Linux 2.6.9, but
32+
// reportedly is not available in Ubuntu on Windows.
33+
// See issue 16610.
34+
if e == syscall.ENOSYS {
35+
return false, nil
36+
}
3137
return false, NewSyscallError("waitid", e)
3238
}
3339
return true, nil

0 commit comments

Comments
 (0)