From aa175a196d74f2788ec3d02b990487f7ca2af5b0 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Mon, 30 Dec 2019 15:50:50 +0100 Subject: [PATCH] internal/syscall/unix: use libc based fcntl for IsNonblock on aix and solaris On aix and solaris (like on darwin) use libc fcntl to implement IsNonblock instead of Syscall(SYS_FCNTL, ...) which isn't supported. Change-Id: I989b02aa0c90b7e2dae025572867dda277fef8be Reviewed-on: https://go-review.googlesource.com/c/go/+/212600 Run-TryBot: Tobias Klauser TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/internal/syscall/unix/nonblocking.go | 2 +- .../unix/{nonblocking_darwin.go => nonblocking_libc.go} | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) rename src/internal/syscall/unix/{nonblocking_darwin.go => nonblocking_libc.go} (87%) diff --git a/src/internal/syscall/unix/nonblocking.go b/src/internal/syscall/unix/nonblocking.go index 545445204f..db25fcca98 100644 --- a/src/internal/syscall/unix/nonblocking.go +++ b/src/internal/syscall/unix/nonblocking.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build aix dragonfly freebsd linux netbsd openbsd solaris +// +build dragonfly freebsd linux netbsd openbsd package unix diff --git a/src/internal/syscall/unix/nonblocking_darwin.go b/src/internal/syscall/unix/nonblocking_libc.go similarity index 87% rename from src/internal/syscall/unix/nonblocking_darwin.go rename to src/internal/syscall/unix/nonblocking_libc.go index e3dd3a06b0..37cc7943ee 100644 --- a/src/internal/syscall/unix/nonblocking_darwin.go +++ b/src/internal/syscall/unix/nonblocking_libc.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build darwin +// +build aix darwin solaris package unix @@ -19,6 +19,6 @@ func IsNonblock(fd int) (nonblocking bool, err error) { return flag&syscall.O_NONBLOCK != 0, nil } -// Implemented in syscall/syscall_darwin.go. +// Implemented in the syscall package. //go:linkname fcntl syscall.fcntl func fcntl(fd int, cmd int, arg int) (int, error) -- 2.50.0