summaryrefslogtreecommitdiff
path: root/src/internal/syscall/unix
diff options
context:
space:
mode:
Diffstat (limited to 'src/internal/syscall/unix')
-rw-r--r--src/internal/syscall/unix/nonblocking.go4
-rw-r--r--src/internal/syscall/unix/nonblocking_js.go4
-rw-r--r--src/internal/syscall/unix/nonblocking_libc.go4
-rw-r--r--src/internal/syscall/unix/nonblocking_wasip1.go4
4 files changed, 16 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
+}
diff --git a/src/internal/syscall/unix/nonblocking_js.go b/src/internal/syscall/unix/nonblocking_js.go
index 8ed40f3f91..cfe78c58d8 100644
--- a/src/internal/syscall/unix/nonblocking_js.go
+++ b/src/internal/syscall/unix/nonblocking_js.go
@@ -9,3 +9,7 @@ package unix
func IsNonblock(fd int) (nonblocking bool, err error) {
return false, nil
}
+
+func HasNonblockFlag(flag int) bool {
+ return false
+}
diff --git a/src/internal/syscall/unix/nonblocking_libc.go b/src/internal/syscall/unix/nonblocking_libc.go
index bff6684962..1310dbf8ce 100644
--- a/src/internal/syscall/unix/nonblocking_libc.go
+++ b/src/internal/syscall/unix/nonblocking_libc.go
@@ -19,6 +19,10 @@ 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
+}
+
// Implemented in the syscall package.
//
//go:linkname fcntl syscall.fcntl
diff --git a/src/internal/syscall/unix/nonblocking_wasip1.go b/src/internal/syscall/unix/nonblocking_wasip1.go
index 208db28c3e..5b2b53bf5c 100644
--- a/src/internal/syscall/unix/nonblocking_wasip1.go
+++ b/src/internal/syscall/unix/nonblocking_wasip1.go
@@ -19,6 +19,10 @@ func IsNonblock(fd int) (nonblocking bool, err error) {
return flags&syscall.FDFLAG_NONBLOCK != 0, nil
}
+func HasNonblockFlag(flag int) bool {
+ return flag&syscall.FDFLAG_NONBLOCK != 0
+}
+
// This helper is implemented in the syscall package. It means we don't have
// to redefine the fd_fdstat_get host import or the fdstat struct it
// populates.