complete_nodontwait.go 585 B

12345678910111213141516171819202122
  1. // Copyright 2021 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. //go:build aix || windows || zos
  5. // +build aix windows zos
  6. package socket
  7. import (
  8. "syscall"
  9. )
  10. // ioComplete checks the flags and result of a syscall, to be used as return
  11. // value in a syscall.RawConn.Read or Write callback.
  12. func ioComplete(flags int, operr error) bool {
  13. if operr == syscall.EAGAIN || operr == syscall.EWOULDBLOCK {
  14. // No data available, block for I/O and try again.
  15. return false
  16. }
  17. return true
  18. }