]> Cypherpunks repositories - gostls13.git/commitdiff
internal/syscall/unix: use libc based fcntl for IsNonblock on aix and solaris
authorTobias Klauser <tklauser@distanz.ch>
Mon, 30 Dec 2019 14:50:50 +0000 (15:50 +0100)
committerTobias Klauser <tobias.klauser@gmail.com>
Mon, 30 Dec 2019 20:44:00 +0000 (20:44 +0000)
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 <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/internal/syscall/unix/nonblocking.go
src/internal/syscall/unix/nonblocking_libc.go [moved from src/internal/syscall/unix/nonblocking_darwin.go with 87% similarity]

index 545445204f5909a3fbf1fdfa93b6814b21086994..db25fcca98597cb389ff356c5ac144c16030d0a3 100644 (file)
@@ -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
 
similarity index 87%
rename from src/internal/syscall/unix/nonblocking_darwin.go
rename to src/internal/syscall/unix/nonblocking_libc.go
index e3dd3a06b013e0e92d5df8a2ec430dfee1611e19..37cc7943eed0b84f03c14e61d02072827cd56059 100644 (file)
@@ -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)