summaryrefslogtreecommitdiff
path: root/src/internal/syscall/unix/nonblocking.go
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2023-05-15 21:50:51 -0700
committerGopher Robot <gobot@golang.org>2023-05-17 21:12:04 +0000
commitf777726ff073f8066c017649b572bd8c40940a42 (patch)
tree85721d07a4e2360f2e60aee784e9b269fca8d1f5 /src/internal/syscall/unix/nonblocking.go
parentf0de4b4f03cdde77305b7ae14bd960130a855182 (diff)
downloadgo-git-f777726ff073f8066c017649b572bd8c40940a42.tar.gz
os: if descriptor is non-blocking, retain that in Fd method
For #58408 Fixes #60211 Change-Id: I30f5678b46e15121865b19d1c0f82698493fad4e Reviewed-on: https://go-review.googlesource.com/c/go/+/495079 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com>
Diffstat (limited to 'src/internal/syscall/unix/nonblocking.go')
-rw-r--r--src/internal/syscall/unix/nonblocking.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/internal/syscall/unix/nonblocking.go b/src/internal/syscall/unix/nonblocking.go
index a0becd1e01..6c6f0674d6 100644
--- a/src/internal/syscall/unix/nonblocking.go
+++ b/src/internal/syscall/unix/nonblocking.go
@@ -19,3 +19,7 @@ func IsNonblock(fd int) (nonblocking bool, err error) {
}
return flag&syscall.O_NONBLOCK != 0, nil
}
+
+func HasNonblockFlag(flag int) bool {
+ return flag&syscall.O_NONBLOCK != 0
+}