diff options
Diffstat (limited to 'src/internal/poll/fd_poll_runtime.go')
-rw-r--r-- | src/internal/poll/fd_poll_runtime.go | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/internal/poll/fd_poll_runtime.go b/src/internal/poll/fd_poll_runtime.go index d32f4a0ddd..fd73166ac3 100644 --- a/src/internal/poll/fd_poll_runtime.go +++ b/src/internal/poll/fd_poll_runtime.go @@ -107,15 +107,24 @@ func (pd *pollDesc) pollable() bool { return pd.runtimeCtx != 0 } +// Error values returned by runtime_pollReset and runtime_pollWait. +// These must match the values in runtime/netpoll.go. +const ( + pollNoError = 0 + pollErrClosing = 1 + pollErrTimeout = 2 + pollErrNotPollable = 3 +) + func convertErr(res int, isFile bool) error { switch res { - case 0: + case pollNoError: return nil - case 1: + case pollErrClosing: return errClosing(isFile) - case 2: + case pollErrTimeout: return ErrTimeout - case 3: + case pollErrNotPollable: return ErrNotPollable } println("unreachable: ", res) |