]> Cypherpunks.ru repositories - gostls13.git/commitdiff
runtime: remove fallback to pipe on platforms with pipe2
authorTobias Klauser <tklauser@distanz.ch>
Thu, 3 Mar 2022 09:19:07 +0000 (10:19 +0100)
committerTobias Klauser <tobias.klauser@gmail.com>
Thu, 3 Mar 2022 20:47:17 +0000 (20:47 +0000)
On Linux, the minimum required kernel version for Go 1.18 was be changed
to 2.6.32, see #45964. The pipe2 syscall was added in 2.6.27.

All other platforms already provide the pipe2 syscall in the minimum
supported version:
- DragonFly BSD added it in version 4.2, see
  https://www.dragonflybsd.org/release42/
- FreeBSD added it in version 10.0, see
  https://www.freebsd.org/cgi/man.cgi?pipe(2)#end
- NetBSD added it in version 6.0, see
  https://man.netbsd.org/pipe2.2#HISTORY
- OpenBSD added it in version 5.7, see
  https://man.openbsd.org/pipe.2#HISTORY
- Illumos supports it since 2013, see
  https://www.illumos.org/issues/3714
- Solaris supports it since 11.4

This also allows to remove setNonblock which was only used in the pipe
fallback path on these platforms.

Change-Id: I1f40d32fd3065d74e22af77b9ff2292b9cf66706
Reviewed-on: https://go-review.googlesource.com/c/go/+/389354
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
64 files changed:
src/runtime/defs1_netbsd_386.go
src/runtime/defs1_netbsd_amd64.go
src/runtime/defs1_netbsd_arm.go
src/runtime/defs1_netbsd_arm64.go
src/runtime/defs1_solaris_amd64.go
src/runtime/defs_dragonfly.go
src/runtime/defs_dragonfly_amd64.go
src/runtime/defs_freebsd.go
src/runtime/defs_freebsd_386.go
src/runtime/defs_freebsd_amd64.go
src/runtime/defs_freebsd_arm.go
src/runtime/defs_freebsd_arm64.go
src/runtime/defs_linux.go
src/runtime/defs_linux_386.go
src/runtime/defs_linux_amd64.go
src/runtime/defs_linux_arm.go
src/runtime/defs_linux_arm64.go
src/runtime/defs_linux_mips64x.go
src/runtime/defs_linux_mipsx.go
src/runtime/defs_linux_ppc64.go
src/runtime/defs_linux_ppc64le.go
src/runtime/defs_linux_riscv64.go
src/runtime/defs_linux_s390x.go
src/runtime/defs_netbsd.go
src/runtime/defs_openbsd.go
src/runtime/defs_openbsd_386.go
src/runtime/defs_openbsd_amd64.go
src/runtime/defs_openbsd_arm.go
src/runtime/defs_openbsd_arm64.go
src/runtime/defs_openbsd_mips64.go
src/runtime/defs_solaris.go
src/runtime/export_aix_test.go
src/runtime/export_darwin_test.go
src/runtime/export_pipe2_test.go
src/runtime/export_unix_test.go
src/runtime/nbpipe_pipe2.go
src/runtime/nbpipe_pipe_test.go [new file with mode: 0644]
src/runtime/nbpipe_test.go
src/runtime/os3_solaris.go
src/runtime/os_dragonfly.go
src/runtime/os_freebsd.go
src/runtime/os_linux.go
src/runtime/os_netbsd.go
src/runtime/os_openbsd_syscall2.go
src/runtime/sys_dragonfly_amd64.s
src/runtime/sys_freebsd_386.s
src/runtime/sys_freebsd_amd64.s
src/runtime/sys_freebsd_arm.s
src/runtime/sys_freebsd_arm64.s
src/runtime/sys_linux_386.s
src/runtime/sys_linux_amd64.s
src/runtime/sys_linux_arm.s
src/runtime/sys_linux_arm64.s
src/runtime/sys_linux_mips64x.s
src/runtime/sys_linux_mipsx.s
src/runtime/sys_linux_ppc64x.s
src/runtime/sys_linux_riscv64.s
src/runtime/sys_linux_s390x.s
src/runtime/sys_netbsd_386.s
src/runtime/sys_netbsd_amd64.s
src/runtime/sys_netbsd_arm.s
src/runtime/sys_netbsd_arm64.s
src/runtime/sys_openbsd2.go
src/runtime/sys_openbsd_mips64.s

index a4548e6f0629bcb7b505c20c22c48bc25159fd8b..b6e47a008d142176b6803f38edb55dc647b5fc4e 100644 (file)
@@ -7,7 +7,6 @@ const (
        _EINTR  = 0x4
        _EFAULT = 0xe
        _EAGAIN = 0x23
-       _ENOSYS = 0x4e
 
        _O_NONBLOCK = 0x4
        _O_CLOEXEC  = 0x400000
index 4b0e79ebb6fc4cf9fcab999fee104775e8fcda31..b8292fa3cce79425ca71c587553c90c86652d9e9 100644 (file)
@@ -7,7 +7,6 @@ const (
        _EINTR  = 0x4
        _EFAULT = 0xe
        _EAGAIN = 0x23
-       _ENOSYS = 0x4e
 
        _O_NONBLOCK = 0x4
        _O_CLOEXEC  = 0x400000
index 2b5d5990d3618bfb978b329139ad274608d9551c..d2cb4865b68b2443be53428f29c0d1de5b82c8b0 100644 (file)
@@ -7,7 +7,6 @@ const (
        _EINTR  = 0x4
        _EFAULT = 0xe
        _EAGAIN = 0x23
-       _ENOSYS = 0x4e
 
        _O_NONBLOCK = 0x4
        _O_CLOEXEC  = 0x400000
index 740dc77658f9170f60409004a1f1d7c8293f9356..7776fe1d99734ada8d463810ffa6321937e56d0b 100644 (file)
@@ -7,7 +7,6 @@ const (
        _EINTR  = 0x4
        _EFAULT = 0xe
        _EAGAIN = 0x23
-       _ENOSYS = 0x4e
 
        _O_NONBLOCK = 0x4
        _O_CLOEXEC  = 0x400000
index 19e8a2512e9df225d82b3366262fbb4b445d7391..3c13f333315aa68fad6b151865d0502d116372d4 100644 (file)
@@ -13,7 +13,6 @@ const (
        _ETIMEDOUT   = 0x91
        _EWOULDBLOCK = 0xb
        _EINPROGRESS = 0x96
-       _ENOSYS      = 0x59
 
        _PROT_NONE  = 0x0
        _PROT_READ  = 0x1
index 47a2e4d1232537d1a3606c7c62c93f92662afb3b..952163b5558ee5421017dbaacf74eecb934c5fc4 100644 (file)
@@ -31,7 +31,6 @@ const (
        EFAULT = C.EFAULT
        EBUSY  = C.EBUSY
        EAGAIN = C.EAGAIN
-       ENOSYS = C.ENOSYS
 
        O_NONBLOCK = C.O_NONBLOCK
        O_CLOEXEC  = C.O_CLOEXEC
index f3c6ecd04b7997cf5d2142d377dd8c79b5251827..4358c1e0c2beb927d1db07ddc1d31638ba432cd2 100644 (file)
@@ -10,7 +10,6 @@ const (
        _EFAULT = 0xe
        _EBUSY  = 0x10
        _EAGAIN = 0x23
-       _ENOSYS = 0x4e
 
        _O_NONBLOCK = 0x4
        _O_CLOEXEC  = 0x20000
index 9ba97c84596bd30d4e2eaa8110e5303c255d0561..3fbd580ac51eea824945018975afbe217960dffa 100644 (file)
@@ -48,7 +48,6 @@ const (
        EINTR  = C.EINTR
        EFAULT = C.EFAULT
        EAGAIN = C.EAGAIN
-       ENOSYS = C.ENOSYS
 
        O_NONBLOCK = C.O_NONBLOCK
        O_CLOEXEC  = C.O_CLOEXEC
index f822934d582c74b40700067c676199181692409c..ff4dcfa5fe87cbcf3739d05a9d9b1af4fefb2928 100644 (file)
@@ -16,7 +16,6 @@ const (
        _EINTR     = 0x4
        _EFAULT    = 0xe
        _EAGAIN    = 0x23
-       _ENOSYS    = 0x4e
        _ETIMEDOUT = 0x3c
 
        _O_NONBLOCK = 0x4
index 0b696cf227090112fc430fe4a68a2f43ee75157f..f537c898e4277dad469177ca13db88f184d8a626 100644 (file)
@@ -16,7 +16,6 @@ const (
        _EINTR     = 0x4
        _EFAULT    = 0xe
        _EAGAIN    = 0x23
-       _ENOSYS    = 0x4e
        _ETIMEDOUT = 0x3c
 
        _O_NONBLOCK = 0x4
index b6f3e790cff9315b02d0db5eea9621425207f1c7..2e20ae7d78406825a4bc002a876a8b02bb6504db 100644 (file)
@@ -16,7 +16,6 @@ const (
        _EINTR     = 0x4
        _EFAULT    = 0xe
        _EAGAIN    = 0x23
-       _ENOSYS    = 0x4e
        _ETIMEDOUT = 0x3c
 
        _O_NONBLOCK = 0x4
index 0759a1238f940ced32e496aa3e7f5cc4282be83b..1838108fdb31e8582f5717ba31cc251ee27421e3 100644 (file)
@@ -16,7 +16,6 @@ const (
        _EINTR     = 0x4
        _EFAULT    = 0xe
        _EAGAIN    = 0x23
-       _ENOSYS    = 0x4e
        _ETIMEDOUT = 0x3c
 
        _O_NONBLOCK = 0x4
index 95f807b502c135b0da685193b1b188affd2480ef..e55bb6bbbcfe555f8c5dfcfa140e7de945b6292e 100644 (file)
@@ -37,7 +37,6 @@ const (
        EINTR  = C.EINTR
        EAGAIN = C.EAGAIN
        ENOMEM = C.ENOMEM
-       ENOSYS = C.ENOSYS
 
        PROT_NONE  = C.PROT_NONE
        PROT_READ  = C.PROT_READ
@@ -91,7 +90,7 @@ const (
        SIGPWR    = C.SIGPWR
        SIGSYS    = C.SIGSYS
 
-       SIGRTMIN  = C.SIGRTMIN
+       SIGRTMIN = C.SIGRTMIN
 
        FPE_INTDIV = C.FPE_INTDIV
        FPE_INTOVF = C.FPE_INTOVF
index d24d00febbb71bdedf35b19db26293dd3acf93d9..5376bded2b169707538c4a32bef30f4e4549f060 100644 (file)
@@ -9,7 +9,6 @@ const (
        _EINTR  = 0x4
        _EAGAIN = 0xb
        _ENOMEM = 0xc
-       _ENOSYS = 0x26
 
        _PROT_NONE  = 0x0
        _PROT_READ  = 0x1
index 47fb468621d1f7c0fe6a6bd1b0918eb230f76f37..da4d3575328184c847884cb7833aebb8ab9b5d2c 100644 (file)
@@ -9,7 +9,6 @@ const (
        _EINTR  = 0x4
        _EAGAIN = 0xb
        _ENOMEM = 0xc
-       _ENOSYS = 0x26
 
        _PROT_NONE  = 0x0
        _PROT_READ  = 0x1
index ed387e6eff1b9384992db1cf274be55da6800fe8..18aa0931e52b280c6fe00ef24f03920d084a8f63 100644 (file)
@@ -11,7 +11,6 @@ const (
        _EINTR  = 0x4
        _ENOMEM = 0xc
        _EAGAIN = 0xb
-       _ENOSYS = 0x26
 
        _PROT_NONE  = 0
        _PROT_READ  = 0x1
index 97b3a9600fc2a3da9415f08cec59e0934eca0028..c5d7d7e3fd33524f9143b7d0b34bf1a2a17a8e48 100644 (file)
@@ -9,7 +9,6 @@ const (
        _EINTR  = 0x4
        _EAGAIN = 0xb
        _ENOMEM = 0xc
-       _ENOSYS = 0x26
 
        _PROT_NONE  = 0x0
        _PROT_READ  = 0x1
index 67f28ddc2b308643971e8f76a09433b188784284..e64524813180d9c211b186c840568b973c63d745 100644 (file)
@@ -12,7 +12,6 @@ const (
        _EINTR  = 0x4
        _EAGAIN = 0xb
        _ENOMEM = 0xc
-       _ENOSYS = 0x59
 
        _PROT_NONE  = 0x0
        _PROT_READ  = 0x1
index b5c0d7f568c9470c43d6cd5a09f6844035bd6d56..5afb6f423f94b1c602671a9aaa2db98c3c2e3135 100644 (file)
@@ -12,7 +12,6 @@ const (
        _EINTR  = 0x4
        _EAGAIN = 0xb
        _ENOMEM = 0xc
-       _ENOSYS = 0x59
 
        _PROT_NONE  = 0x0
        _PROT_READ  = 0x1
index c077868cf801fb02d0977368a4df1b993bf6fbc8..f3e305e34eab631ec666306d61936a1d3e03c504 100644 (file)
@@ -9,7 +9,6 @@ const (
        _EINTR  = 0x4
        _EAGAIN = 0xb
        _ENOMEM = 0xc
-       _ENOSYS = 0x26
 
        _PROT_NONE  = 0x0
        _PROT_READ  = 0x1
index c077868cf801fb02d0977368a4df1b993bf6fbc8..f3e305e34eab631ec666306d61936a1d3e03c504 100644 (file)
@@ -9,7 +9,6 @@ const (
        _EINTR  = 0x4
        _EAGAIN = 0xb
        _ENOMEM = 0xc
-       _ENOSYS = 0x26
 
        _PROT_NONE  = 0x0
        _PROT_READ  = 0x1
index 30bf1770d7b0d7973c3c1749ee4fa91010f1efba..29496acdcb6992a87e1179194e365472a34635e4 100644 (file)
@@ -10,7 +10,6 @@ const (
        _EINTR  = 0x4
        _EAGAIN = 0xb
        _ENOMEM = 0xc
-       _ENOSYS = 0x26
 
        _PROT_NONE  = 0x0
        _PROT_READ  = 0x1
index 224136a4631db277f42030800d2348f6375611cc..817a29ed30cd3461cae7438aca358fb3f16541b4 100644 (file)
@@ -10,7 +10,6 @@ const (
        _EINTR  = 0x4
        _EAGAIN = 0xb
        _ENOMEM = 0xc
-       _ENOSYS = 0x26
 
        _PROT_NONE  = 0x0
        _PROT_READ  = 0x1
index df8bc579f2556ab2e6d42fbfc21c98ac7ce9a2cb..6b084c06b57654f213052b1fb01705308240d902 100644 (file)
@@ -33,7 +33,6 @@ const (
        EINTR  = C.EINTR
        EFAULT = C.EFAULT
        EAGAIN = C.EAGAIN
-       ENOSYS = C.ENOSYS
 
        O_NONBLOCK = C.O_NONBLOCK
        O_CLOEXEC  = C.O_CLOEXEC
index ec7d82a33cf018e12316de8ad70c80c42e463680..cbf53eb9eff571465239f09b75eebe6a1d0f537c 100644 (file)
@@ -34,7 +34,6 @@ const (
        EINTR  = C.EINTR
        EFAULT = C.EFAULT
        EAGAIN = C.EAGAIN
-       ENOSYS = C.ENOSYS
 
        O_NONBLOCK = C.O_NONBLOCK
        O_CLOEXEC  = C.O_CLOEXEC
index a866ec880ad22cd7f1de14c1f23b9372ea2afc49..35c559bb454a60563126eca738342d1d3a17031c 100644 (file)
@@ -9,7 +9,6 @@ const (
        _EINTR  = 0x4
        _EFAULT = 0xe
        _EAGAIN = 0x23
-       _ENOSYS = 0x4e
 
        _O_NONBLOCK = 0x4
        _O_CLOEXEC  = 0x10000
index 46f1245201ce322f60dbf19a43cd15a260eb30f0..d7432daeddf13cd438731b4bc61f00c150713fc2 100644 (file)
@@ -9,7 +9,6 @@ const (
        _EINTR  = 0x4
        _EFAULT = 0xe
        _EAGAIN = 0x23
-       _ENOSYS = 0x4e
 
        _O_NONBLOCK = 0x4
        _O_CLOEXEC  = 0x10000
index 6f128c4284b1540aeb6cc0ffa41eb9b06b073117..471b3063fb18a692bc7cbf81b819040c23387304 100644 (file)
@@ -9,7 +9,6 @@ const (
        _EINTR  = 0x4
        _EFAULT = 0xe
        _EAGAIN = 0x23
-       _ENOSYS = 0x4e
 
        _O_NONBLOCK = 0x4
        _O_CLOEXEC  = 0x10000
index d2b947feb2741c00f8b9da264a444367bdfb8147..5300ab087c667964614677646df429467f95d24b 100644 (file)
@@ -10,7 +10,6 @@ const (
        _EINTR  = 0x4
        _EFAULT = 0xe
        _EAGAIN = 0x23
-       _ENOSYS = 0x4e
 
        _O_NONBLOCK = 0x4
        _O_CLOEXEC  = 0x10000
index 28d70b7a018df8190ca36d1e0b1c58ae65603d87..a8789ef451d4f3da7967fdf2b2728bd67ed0aed0 100644 (file)
@@ -16,7 +16,6 @@ const (
        _EINTR  = 0x4
        _EFAULT = 0xe
        _EAGAIN = 0x23
-       _ENOSYS = 0x4e
 
        _O_NONBLOCK = 0x4
        _O_CLOEXEC  = 0x10000
index ec16c9dcce94afa5cd9b5d4a7d8daae5c124071c..f626498525290b3c06680eda11d47aab9d6a65f5 100644 (file)
@@ -43,7 +43,6 @@ const (
        ETIMEDOUT   = C.ETIMEDOUT
        EWOULDBLOCK = C.EWOULDBLOCK
        EINPROGRESS = C.EINPROGRESS
-       ENOSYS      = C.ENOSYS
 
        PROT_NONE  = C.PROT_NONE
        PROT_READ  = C.PROT_READ
index 162552d04c46d129810d60b602ae59be07b88442..51df951738436afe5b455976c0cba9c176592d31 100644 (file)
@@ -5,3 +5,4 @@
 package runtime
 
 var Fcntl = syscall_fcntl1
+var SetNonblock = setNonblock
index e9b6eb36da5cda684e4f06ae3bc40a025253ccd5..66e2c02c4f6c2159e4a13d24fe3897fcf0663626 100644 (file)
@@ -11,3 +11,5 @@ func Fcntl(fd, cmd, arg uintptr) (uintptr, uintptr) {
        }
        return uintptr(r), 0
 }
+
+var SetNonblock = setNonblock
index bdf39c60dfcf72c0577d4315b7e4aeb1d6a7d965..8d49009b43b280588894a8fa02927fb670105a44 100644 (file)
@@ -7,9 +7,5 @@
 package runtime
 
 func Pipe() (r, w int32, errno int32) {
-       r, w, errno = pipe2(0)
-       if errno == _ENOSYS {
-               return pipe()
-       }
-       return r, w, errno
+       return pipe2(0)
 }
index 9f046b95e043ba3a7896ad207921856eacffcfba..4a587cb78013df6110090721b8953a6227d53d6a 100644 (file)
@@ -9,7 +9,6 @@ package runtime
 import "unsafe"
 
 var NonblockingPipe = nonblockingPipe
-var SetNonblock = setNonblock
 var Closeonexec = closeonexec
 
 func sigismember(mask *sigset, i int) bool {
index 6a555bcd9970d9640780ee6984d0fe92cddb8d06..22d60b4a63205c3a861ec6c9d8212709437090aa 100644 (file)
@@ -7,16 +7,5 @@
 package runtime
 
 func nonblockingPipe() (r, w int32, errno int32) {
-       r, w, errno = pipe2(_O_NONBLOCK | _O_CLOEXEC)
-       if errno == -_ENOSYS {
-               r, w, errno = pipe()
-               if errno != 0 {
-                       return -1, -1, errno
-               }
-               closeonexec(r)
-               setNonblock(r)
-               closeonexec(w)
-               setNonblock(w)
-       }
-       return r, w, errno
+       return pipe2(_O_NONBLOCK | _O_CLOEXEC)
 }
diff --git a/src/runtime/nbpipe_pipe_test.go b/src/runtime/nbpipe_pipe_test.go
new file mode 100644 (file)
index 0000000..c8cb3cf
--- /dev/null
@@ -0,0 +1,38 @@
+// Copyright 2022 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+//go:build aix || darwin
+
+package runtime_test
+
+import (
+       "runtime"
+       "syscall"
+       "testing"
+)
+
+func TestSetNonblock(t *testing.T) {
+       t.Parallel()
+
+       r, w, errno := runtime.Pipe()
+       if errno != 0 {
+               t.Fatal(syscall.Errno(errno))
+       }
+       defer func() {
+               runtime.Close(r)
+               runtime.Close(w)
+       }()
+
+       checkIsPipe(t, r, w)
+
+       runtime.SetNonblock(r)
+       runtime.SetNonblock(w)
+       checkNonblocking(t, r, "reader")
+       checkNonblocking(t, w, "writer")
+
+       runtime.Closeonexec(r)
+       runtime.Closeonexec(w)
+       checkCloseonexec(t, r, "reader")
+       checkCloseonexec(t, w, "writer")
+}
index 36342cfde832aa3150bbf97d4dbfbb24df47b0f0..b6869e79746a23a5db14ab47fc518dc5a5009d2d 100644 (file)
@@ -66,28 +66,3 @@ func checkCloseonexec(t *testing.T, fd int32, name string) {
                t.Errorf("FD_CLOEXEC not set in %s flags %#x", name, flags)
        }
 }
-
-func TestSetNonblock(t *testing.T) {
-       t.Parallel()
-
-       r, w, errno := runtime.Pipe()
-       if errno != 0 {
-               t.Fatal(syscall.Errno(errno))
-       }
-       defer func() {
-               runtime.Close(r)
-               runtime.Close(w)
-       }()
-
-       checkIsPipe(t, r, w)
-
-       runtime.SetNonblock(r)
-       runtime.SetNonblock(w)
-       checkNonblocking(t, r, "reader")
-       checkNonblocking(t, w, "writer")
-
-       runtime.Closeonexec(r)
-       runtime.Closeonexec(w)
-       checkCloseonexec(t, r, "reader")
-       checkCloseonexec(t, w, "writer")
-}
index 4aba0ff64ba3da16d3ac78b21e2fe6940a9454fe..5aee04d5a8d518fa57262bec2f779d02925a85ae 100644 (file)
@@ -561,13 +561,6 @@ func write1(fd uintptr, buf unsafe.Pointer, nbyte int32) int32 {
        return -int32(err)
 }
 
-//go:nosplit
-func pipe() (r, w int32, errno int32) {
-       var p [2]int32
-       _, e := sysvicall1Err(&libc_pipe, uintptr(noescape(unsafe.Pointer(&p))))
-       return p[0], p[1], int32(e)
-}
-
 //go:nosplit
 func pipe2(flags int32) (r, w int32, errno int32) {
        var p [2]int32
@@ -580,12 +573,6 @@ func closeonexec(fd int32) {
        fcntl(fd, _F_SETFD, _FD_CLOEXEC)
 }
 
-//go:nosplit
-func setNonblock(fd int32) {
-       flags := fcntl(fd, _F_GETFL, 0)
-       fcntl(fd, _F_SETFL, flags|_O_NONBLOCK)
-}
-
 func osyield1()
 
 //go:nosplit
index 152d94cf43d3a76eb1fcd7020f812ded24ed0837..a56706b4151ea117b2c20bcc6a86e5da3c1e735e 100644 (file)
@@ -62,10 +62,8 @@ func kqueue() int32
 //go:noescape
 func kevent(kq int32, ch *keventt, nch int32, ev *keventt, nev int32, ts *timespec) int32
 
-func pipe() (r, w int32, errno int32)
 func pipe2(flags int32) (r, w int32, errno int32)
 func closeonexec(fd int32)
-func setNonblock(fd int32)
 
 // From DragonFly's <sys/sysctl.h>
 const (
index d908a80cd162c50ca89e12af1a978816a612a214..e4d15474d82b225e0472dde1c5f71faca2dedff0 100644 (file)
@@ -47,10 +47,8 @@ func kqueue() int32
 //go:noescape
 func kevent(kq int32, ch *keventt, nch int32, ev *keventt, nev int32, ts *timespec) int32
 
-func pipe() (r, w int32, errno int32)
 func pipe2(flags int32) (r, w int32, errno int32)
 func closeonexec(fd int32)
-func setNonblock(fd int32)
 
 // From FreeBSD's <sys/sysctl.h>
 const (
index eb8aa076e9f9b1b8c10c114fe150f44b7f3a0638..efb54ff20e3150830387a5ccb60af4d57d497ad0 100644 (file)
@@ -446,9 +446,7 @@ func osyield_no_g() {
        osyield()
 }
 
-func pipe() (r, w int32, errno int32)
 func pipe2(flags int32) (r, w int32, errno int32)
-func setNonblock(fd int32)
 
 const (
        _si_max_size    = 128
index c4e69fb189cdc48a3383a554cef58d6dac6e8fa5..88a4a8b90e5da59c0449d93ae3a7e32baedc1692 100644 (file)
@@ -78,10 +78,8 @@ func kqueue() int32
 //go:noescape
 func kevent(kq int32, ch *keventt, nch int32, ev *keventt, nev int32, ts *timespec) int32
 
-func pipe() (r, w int32, errno int32)
 func pipe2(flags int32) (r, w int32, errno int32)
 func closeonexec(fd int32)
-func setNonblock(fd int32)
 
 const (
        _ESRCH     = 3
index 99542fb2de161786d8974b17fb96d3476205b99e..a48f5fa88a6a75b9894b1f95f8970b7ba8ab0c12 100644 (file)
@@ -70,7 +70,6 @@ func sigprocmask(how int32, new, old *sigset) {
        }
 }
 
-func pipe() (r, w int32, errno int32)
 func pipe2(flags int32) (r, w int32, errno int32)
 
 //go:noescape
@@ -95,6 +94,5 @@ func nanotime1() int64
 func sigaltstack(new, old *stackt)
 
 func closeonexec(fd int32)
-func setNonblock(fd int32)
 
 func walltime() (sec int64, nsec int32)
index d57bc2a7a4ee8591a5e2c58cde77772668f6aaa0..684c9ab7f0e1609ae51c8a9c1093a9383c446dc0 100644 (file)
@@ -109,21 +109,6 @@ TEXT runtime·read(SB),NOSPLIT,$-8
        MOVL    AX, ret+24(FP)
        RET
 
-// func pipe() (r, w int32, errno int32)
-TEXT runtime·pipe(SB),NOSPLIT,$0-12
-       MOVL    $42, AX
-       SYSCALL
-       JCC     pipeok
-       MOVL    $-1,r+0(FP)
-       MOVL    $-1,w+4(FP)
-       MOVL    AX, errno+8(FP)
-       RET
-pipeok:
-       MOVL    AX, r+0(FP)
-       MOVL    DX, w+4(FP)
-       MOVL    $0, errno+8(FP)
-       RET
-
 // func pipe2(flags int32) (r, w int32, errno int32)
 TEXT runtime·pipe2(SB),NOSPLIT,$0-20
        MOVL    $0, DI
@@ -402,18 +387,3 @@ TEXT runtime·closeonexec(SB),NOSPLIT,$0
        MOVL    $92, AX         // fcntl
        SYSCALL
        RET
-
-// func runtime·setNonblock(int32 fd)
-TEXT runtime·setNonblock(SB),NOSPLIT,$0-4
-       MOVL    fd+0(FP), DI  // fd
-       MOVQ    $3, SI  // F_GETFL
-       MOVQ    $0, DX
-       MOVL    $92, AX // fcntl
-       SYSCALL
-       MOVL    fd+0(FP), DI // fd
-       MOVQ    $4, SI // F_SETFL
-       MOVQ    $4, DX // O_NONBLOCK
-       ORL     AX, DX
-       MOVL    $92, AX // fcntl
-       SYSCALL
-       RET
index 97e6d9ab36634ced64091e5831d2d4589405824d..aceb6fe1bf992d9292be859e00d3339b7bcae515 100644 (file)
@@ -101,21 +101,6 @@ TEXT runtime·read(SB),NOSPLIT,$-4
        MOVL    AX, ret+12(FP)
        RET
 
-// func pipe() (r, w int32, errno int32)
-TEXT runtime·pipe(SB),NOSPLIT,$8-12
-       MOVL    $42, AX
-       INT     $0x80
-       JAE     ok
-       MOVL    $0, r+0(FP)
-       MOVL    $0, w+4(FP)
-       MOVL    AX, errno+8(FP)
-       RET
-ok:
-       MOVL    AX, r+0(FP)
-       MOVL    DX, w+4(FP)
-       MOVL    $0, errno+8(FP)
-       RET
-
 // func pipe2(flags int32) (r, w int32, errno int32)
 TEXT runtime·pipe2(SB),NOSPLIT,$12-16
        MOVL    $542, AX
@@ -443,23 +428,6 @@ TEXT runtime·closeonexec(SB),NOSPLIT,$32
        NEGL    AX
        RET
 
-// func runtime·setNonblock(fd int32)
-TEXT runtime·setNonblock(SB),NOSPLIT,$16-4
-       MOVL    $92, AX // fcntl
-       MOVL    fd+0(FP), BX // fd
-       MOVL    BX, 4(SP)
-       MOVL    $3, 8(SP) // F_GETFL
-       MOVL    $0, 12(SP)
-       INT     $0x80
-       MOVL    fd+0(FP), BX // fd
-       MOVL    BX, 4(SP)
-       MOVL    $4, 8(SP) // F_SETFL
-       ORL     $4, AX // O_NONBLOCK
-       MOVL    AX, 12(SP)
-       MOVL    $92, AX // fcntl
-       INT     $0x80
-       RET
-
 // func cpuset_getaffinity(level int, which int, id int64, size int, mask *byte) int32
 TEXT runtime·cpuset_getaffinity(SB), NOSPLIT, $0-28
        MOVL    $487, AX
index 165e97c60d735881ea3797df151f5c3aa79f9409..cc95da7e64529b0d6846a4e7cfe6646ea0ab54c5 100644 (file)
@@ -102,21 +102,6 @@ TEXT runtime·read(SB),NOSPLIT,$-8
        MOVL    AX, ret+24(FP)
        RET
 
-// func pipe() (r, w int32, errno int32)
-TEXT runtime·pipe(SB),NOSPLIT,$0-12
-       MOVL    $42, AX
-       SYSCALL
-       JCC     ok
-       MOVL    $0, r+0(FP)
-       MOVL    $0, w+4(FP)
-       MOVL    AX, errno+8(FP)
-       RET
-ok:
-       MOVL    AX, r+0(FP)
-       MOVL    DX, w+4(FP)
-       MOVL    $0, errno+8(FP)
-       RET
-
 // func pipe2(flags int32) (r, w int32, errno int32)
 TEXT runtime·pipe2(SB),NOSPLIT,$0-20
        LEAQ    r+8(FP), DI
@@ -491,21 +476,6 @@ TEXT runtime·closeonexec(SB),NOSPLIT,$0
        SYSCALL
        RET
 
-// func runtime·setNonblock(int32 fd)
-TEXT runtime·setNonblock(SB),NOSPLIT,$0-4
-       MOVL    fd+0(FP), DI  // fd
-       MOVQ    $3, SI  // F_GETFL
-       MOVQ    $0, DX
-       MOVL    $92, AX // fcntl
-       SYSCALL
-       MOVL    fd+0(FP), DI // fd
-       MOVQ    $4, SI // F_SETFL
-       MOVQ    $4, DX // O_NONBLOCK
-       ORL     AX, DX
-       MOVL    $92, AX // fcntl
-       SYSCALL
-       RET
-
 // func cpuset_getaffinity(level int, which int, id int64, size int, mask *byte) int32
 TEXT runtime·cpuset_getaffinity(SB), NOSPLIT, $0-44
        MOVQ    level+0(FP), DI
index b12e47c576daeb8a3b3556f405e5c5fbea0d4007..88ab0fc795d84d24a57feaf8b6632637897b3eb7 100644 (file)
@@ -20,7 +20,6 @@
 #define SYS_close (SYS_BASE + 6)
 #define SYS_getpid (SYS_BASE + 20)
 #define SYS_kill (SYS_BASE + 37)
-#define SYS_pipe (SYS_BASE + 42)
 #define SYS_sigaltstack (SYS_BASE + 53)
 #define SYS_munmap (SYS_BASE + 73)
 #define SYS_madvise (SYS_BASE + 75)
@@ -123,23 +122,6 @@ TEXT runtime·read(SB),NOSPLIT|NOFRAME,$0
        MOVW    R0, ret+12(FP)
        RET
 
-// func pipe() (r, w int32, errno int32)
-TEXT runtime·pipe(SB),NOSPLIT,$0-12
-       MOVW    $SYS_pipe, R7
-       SWI     $0
-       BCC     ok
-       MOVW    $0, R1
-       MOVW    R1, r+0(FP)
-       MOVW    R1, w+4(FP)
-       MOVW    R0, errno+8(FP)
-       RET
-ok:
-       MOVW    R0, r+0(FP)
-       MOVW    R1, w+4(FP)
-       MOVW    $0, R1
-       MOVW    R1, errno+8(FP)
-       RET
-
 // func pipe2(flags int32) (r, w int32, errno int32)
 TEXT runtime·pipe2(SB),NOSPLIT,$0-16
        MOVW    $r+4(FP), R0
@@ -414,20 +396,6 @@ TEXT runtime·closeonexec(SB),NOSPLIT,$0
        SWI $0
        RET
 
-// func runtime·setNonblock(fd int32)
-TEXT runtime·setNonblock(SB),NOSPLIT,$0-4
-       MOVW    fd+0(FP), R0    // fd
-       MOVW    $3, R1  // F_GETFL
-       MOVW    $0, R2
-       MOVW    $SYS_fcntl, R7
-       SWI     $0
-       ORR     $0x4, R0, R2    // O_NONBLOCK
-       MOVW    fd+0(FP), R0    // fd
-       MOVW    $4, R1  // F_SETFL
-       MOVW    $SYS_fcntl, R7
-       SWI     $0
-       RET
-
 // TODO: this is only valid for ARMv7+
 TEXT ·publicationBarrier(SB),NOSPLIT|NOFRAME,$0-0
        B       runtime·armPublicationBarrier(SB)
index 1aa09e87ca1dc3fc304ff01f8925525a9c72dcf5..59adf4e5f34088cbbb9206e9068868efc1d2aeb6 100644 (file)
@@ -133,18 +133,6 @@ ok:
        MOVW    R0, ret+8(FP)
        RET
 
-// func pipe() (r, w int32, errno int32)
-TEXT runtime·pipe(SB),NOSPLIT|NOFRAME,$0-12
-       MOVD    $r+0(FP), R0
-       MOVW    $0, R1
-       MOVD    $SYS_pipe2, R8
-       SVC
-       BCC     ok
-       NEG     R0, R0
-ok:
-       MOVW    R0, errno+8(FP)
-       RET
-
 // func pipe2(flags int32) (r, w int32, errno int32)
 TEXT runtime·pipe2(SB),NOSPLIT|NOFRAME,$0-20
        MOVD    $r+8(FP), R0
@@ -492,20 +480,6 @@ TEXT runtime·closeonexec(SB),NOSPLIT|NOFRAME,$0
        SVC
        RET
 
-// func runtime·setNonblock(fd int32)
-TEXT runtime·setNonblock(SB),NOSPLIT,$0-4
-       MOVW    fd+0(FP), R0
-       MOVD    $F_GETFL, R1
-       MOVD    $0, R2
-       MOVD    $SYS_fcntl, R8
-       SVC
-       ORR     $O_NONBLOCK, R0, R2
-       MOVW    fd+0(FP), R0
-       MOVW    $F_SETFL, R1
-       MOVW    $SYS_fcntl, R7
-       SVC
-       RET
-
 // func getCntxct(physical bool) uint32
 TEXT runtime·getCntxct(SB),NOSPLIT,$0
        MOVB    physical+0(FP), R0
index 6df812234c3f9cf4591a83375a2dc39b4745662f..fef68d51dcdb432627883810cc927286f0531526 100644 (file)
@@ -32,7 +32,6 @@
 #define SYS_getpid             20
 #define SYS_access             33
 #define SYS_kill               37
-#define SYS_pipe               42
 #define SYS_brk                45
 #define SYS_fcntl              55
 #define SYS_munmap             91
@@ -130,14 +129,6 @@ TEXT runtime·read(SB),NOSPLIT,$0
        MOVL    AX, ret+12(FP)
        RET
 
-// func pipe() (r, w int32, errno int32)
-TEXT runtime·pipe(SB),NOSPLIT,$0-12
-       MOVL    $SYS_pipe, AX
-       LEAL    r+0(FP), BX
-       INVOKE_SYSCALL
-       MOVL    AX, errno+8(FP)
-       RET
-
 // func pipe2(flags int32) (r, w int32, errno int32)
 TEXT runtime·pipe2(SB),NOSPLIT,$0-16
        MOVL    $SYS_pipe2, AX
@@ -782,21 +773,6 @@ TEXT runtime·closeonexec(SB),NOSPLIT,$0
        INVOKE_SYSCALL
        RET
 
-// func runtime·setNonblock(fd int32)
-TEXT runtime·setNonblock(SB),NOSPLIT,$0-4
-       MOVL    $SYS_fcntl, AX
-       MOVL    fd+0(FP), BX // fd
-       MOVL    $3, CX // F_GETFL
-       MOVL    $0, DX
-       INVOKE_SYSCALL
-       MOVL    fd+0(FP), BX // fd
-       MOVL    $4, CX // F_SETFL
-       MOVL    $0x800, DX // O_NONBLOCK
-       ORL     AX, DX
-       MOVL    $SYS_fcntl, AX
-       INVOKE_SYSCALL
-       RET
-
 // int access(const char *name, int mode)
 TEXT runtime·access(SB),NOSPLIT,$0
        MOVL    $SYS_access, AX
index f0e58e11db36ec56ed0bf2de730f198a64cec0a3..4be0801114bd34d42110ad4757e4ce0065fdcb28 100644 (file)
@@ -22,7 +22,6 @@
 #define SYS_rt_sigaction       13
 #define SYS_rt_sigprocmask     14
 #define SYS_rt_sigreturn       15
-#define SYS_pipe               22
 #define SYS_sched_yield        24
 #define SYS_mincore            27
 #define SYS_madvise            28
@@ -114,14 +113,6 @@ TEXT runtime·read(SB),NOSPLIT,$0-28
        MOVL    AX, ret+24(FP)
        RET
 
-// func pipe() (r, w int32, errno int32)
-TEXT runtime·pipe(SB),NOSPLIT,$0-12
-       LEAQ    r+0(FP), DI
-       MOVL    $SYS_pipe, AX
-       SYSCALL
-       MOVL    AX, errno+8(FP)
-       RET
-
 // func pipe2(flags int32) (r, w int32, errno int32)
 TEXT runtime·pipe2(SB),NOSPLIT,$0-20
        LEAQ    r+8(FP), DI
@@ -708,21 +699,6 @@ TEXT runtime·closeonexec(SB),NOSPLIT,$0
        SYSCALL
        RET
 
-// func runtime·setNonblock(int32 fd)
-TEXT runtime·setNonblock(SB),NOSPLIT,$0-4
-       MOVL    fd+0(FP), DI  // fd
-       MOVQ    $3, SI  // F_GETFL
-       MOVQ    $0, DX
-       MOVL    $SYS_fcntl, AX
-       SYSCALL
-       MOVL    fd+0(FP), DI // fd
-       MOVQ    $4, SI // F_SETFL
-       MOVQ    $0x800, DX // O_NONBLOCK
-       ORL     AX, DX
-       MOVL    $SYS_fcntl, AX
-       SYSCALL
-       RET
-
 // int access(const char *name, int mode)
 TEXT runtime·access(SB),NOSPLIT,$0
        // This uses faccessat instead of access, because Android O blocks access.
index ca443b699fdcf3b2cf6b3866fadad8a008ff5c57..201940b4e6d48d29554c254e502fdb4fc1b5abeb 100644 (file)
@@ -23,7 +23,6 @@
 #define SYS_close (SYS_BASE + 6)
 #define SYS_getpid (SYS_BASE + 20)
 #define SYS_kill (SYS_BASE + 37)
-#define SYS_pipe (SYS_BASE + 42)
 #define SYS_clone (SYS_BASE + 120)
 #define SYS_rt_sigreturn (SYS_BASE + 173)
 #define SYS_rt_sigaction (SYS_BASE + 174)
@@ -98,14 +97,6 @@ TEXT runtime·read(SB),NOSPLIT,$0
        MOVW    R0, ret+12(FP)
        RET
 
-// func pipe() (r, w int32, errno int32)
-TEXT runtime·pipe(SB),NOSPLIT,$0-12
-       MOVW    $r+0(FP), R0
-       MOVW    $SYS_pipe, R7
-       SWI     $0
-       MOVW    R0, errno+8(FP)
-       RET
-
 // func pipe2(flags int32) (r, w int32, errno int32)
 TEXT runtime·pipe2(SB),NOSPLIT,$0-16
        MOVW    $r+4(FP), R0
@@ -717,20 +708,6 @@ TEXT runtime·closeonexec(SB),NOSPLIT,$0
        SWI     $0
        RET
 
-// func runtime·setNonblock(fd int32)
-TEXT runtime·setNonblock(SB),NOSPLIT,$0-4
-       MOVW    fd+0(FP), R0    // fd
-       MOVW    $3, R1  // F_GETFL
-       MOVW    $0, R2
-       MOVW    $SYS_fcntl, R7
-       SWI     $0
-       ORR     $0x800, R0, R2  // O_NONBLOCK
-       MOVW    fd+0(FP), R0    // fd
-       MOVW    $4, R1  // F_SETFL
-       MOVW    $SYS_fcntl, R7
-       SWI     $0
-       RET
-
 // b __kuser_get_tls @ 0xffff0fe0
 TEXT runtime·read_tls_fallback(SB),NOSPLIT|NOFRAME,$0
        MOVW    $0xffff0fe0, R0
index 1276c077d701f2c8bf894d780a79d8938d05268e..5f05afb743dba29c803f2eb75e81f772456f5b0d 100644 (file)
@@ -113,15 +113,6 @@ TEXT runtime·read(SB),NOSPLIT|NOFRAME,$0-28
        MOVW    R0, ret+24(FP)
        RET
 
-// func pipe() (r, w int32, errno int32)
-TEXT runtime·pipe(SB),NOSPLIT|NOFRAME,$0-12
-       MOVD    $r+0(FP), R0
-       MOVW    $0, R1
-       MOVW    $SYS_pipe2, R8
-       SVC
-       MOVW    R0, errno+8(FP)
-       RET
-
 // func pipe2(flags int32) (r, w int32, errno int32)
 TEXT runtime·pipe2(SB),NOSPLIT|NOFRAME,$0-20
        MOVD    $r+8(FP), R0
@@ -740,21 +731,6 @@ TEXT runtime·closeonexec(SB),NOSPLIT|NOFRAME,$0
        SVC
        RET
 
-// func runtime·setNonblock(int32 fd)
-TEXT runtime·setNonblock(SB),NOSPLIT|NOFRAME,$0-4
-       MOVW    fd+0(FP), R0 // fd
-       MOVD    $3, R1  // F_GETFL
-       MOVD    $0, R2
-       MOVD    $SYS_fcntl, R8
-       SVC
-       MOVD    $0x800, R2 // O_NONBLOCK
-       ORR     R0, R2
-       MOVW    fd+0(FP), R0 // fd
-       MOVD    $4, R1  // F_SETFL
-       MOVD    $SYS_fcntl, R8
-       SVC
-       RET
-
 // int access(const char *name, int mode)
 TEXT runtime·access(SB),NOSPLIT,$0-20
        MOVD    $AT_FDCWD, R0
index 0df25979939357b4b464e0aaa44586903ef7be44..3c7f0e73078768614b0e8f730c159743c2d0f2e2 100644 (file)
@@ -113,17 +113,6 @@ TEXT runtime·read(SB),NOSPLIT|NOFRAME,$0-28
        MOVW    R2, ret+24(FP)
        RET
 
-// func pipe() (r, w int32, errno int32)
-TEXT runtime·pipe(SB),NOSPLIT|NOFRAME,$0-12
-       MOVV    $r+0(FP), R4
-       MOVV    R0, R5
-       MOVV    $SYS_pipe2, R2
-       SYSCALL
-       BEQ     R7, 2(PC)
-       SUBVU   R2, R0, R2      // caller expects negative errno
-       MOVW    R2, errno+8(FP)
-       RET
-
 // func pipe2(flags int32) (r, w int32, errno int32)
 TEXT runtime·pipe2(SB),NOSPLIT|NOFRAME,$0-20
        MOVV    $r+8(FP), R4
@@ -635,21 +624,6 @@ TEXT runtime·closeonexec(SB),NOSPLIT|NOFRAME,$0
        SYSCALL
        RET
 
-// func runtime·setNonblock(int32 fd)
-TEXT runtime·setNonblock(SB),NOSPLIT|NOFRAME,$0-4
-       MOVW    fd+0(FP), R4 // fd
-       MOVV    $3, R5  // F_GETFL
-       MOVV    $0, R6
-       MOVV    $SYS_fcntl, R2
-       SYSCALL
-       MOVW    $0x80, R6 // O_NONBLOCK
-       OR      R2, R6
-       MOVW    fd+0(FP), R4 // fd
-       MOVV    $4, R5  // F_SETFL
-       MOVV    $SYS_fcntl, R2
-       SYSCALL
-       RET
-
 // func sbrk0() uintptr
 TEXT runtime·sbrk0(SB),NOSPLIT|NOFRAME,$0-8
        // Implemented as brk(NULL).
index 2207e9ab98f702fb0a2b43ddf6d2a6d19a1d668d..ab4e976ee4d770db2ecdabff215700e9ae49ab96 100644 (file)
@@ -19,7 +19,6 @@
 #define SYS_close              4006
 #define SYS_getpid             4020
 #define SYS_kill               4037
-#define SYS_pipe               4042
 #define SYS_brk                        4045
 #define SYS_fcntl              4055
 #define SYS_mmap               4090
@@ -112,23 +111,6 @@ TEXT runtime·read(SB),NOSPLIT,$0-16
        MOVW    R2, ret+12(FP)
        RET
 
-// func pipe() (r, w int32, errno int32)
-TEXT runtime·pipe(SB),NOSPLIT,$0-12
-       MOVW    $SYS_pipe, R2
-       SYSCALL
-       BEQ     R7, pipeok
-       MOVW    $-1, R1
-       MOVW    R1, r+0(FP)
-       MOVW    R1, w+4(FP)
-       SUBU    R2, R0, R2      // caller expects negative errno
-       MOVW    R2, errno+8(FP)
-       RET
-pipeok:
-       MOVW    R2, r+0(FP)
-       MOVW    R3, w+4(FP)
-       MOVW    R0, errno+8(FP)
-       RET
-
 // func pipe2(flags int32) (r, w int32, errno int32)
 TEXT runtime·pipe2(SB),NOSPLIT,$0-16
        MOVW    $r+4(FP), R4
@@ -559,21 +541,6 @@ TEXT runtime·closeonexec(SB),NOSPLIT,$0-4
        SYSCALL
        RET
 
-// func runtime·setNonblock(int32 fd)
-TEXT runtime·setNonblock(SB),NOSPLIT,$0-4
-       MOVW    fd+0(FP), R4 // fd
-       MOVW    $3, R5  // F_GETFL
-       MOVW    $0, R6
-       MOVW    $SYS_fcntl, R2
-       SYSCALL
-       MOVW    $0x80, R6 // O_NONBLOCK
-       OR      R2, R6
-       MOVW    fd+0(FP), R4 // fd
-       MOVW    $4, R5  // F_SETFL
-       MOVW    $SYS_fcntl, R2
-       SYSCALL
-       RET
-
 // func sbrk0() uintptr
 TEXT runtime·sbrk0(SB),NOSPLIT,$0-4
        // Implemented as brk(NULL).
index dc3d89fae741c7ff808cf38bc253e2287ef91d4c..48f933479523eb8cf15f7d789e0d998055bd8a6a 100644 (file)
@@ -20,7 +20,6 @@
 #define SYS_close                6
 #define SYS_getpid              20
 #define SYS_kill                37
-#define SYS_pipe                42
 #define SYS_brk                         45
 #define SYS_fcntl               55
 #define SYS_mmap                90
@@ -104,13 +103,6 @@ TEXT runtime·read(SB),NOSPLIT|NOFRAME,$0-28
        MOVW    R3, ret+24(FP)
        RET
 
-// func pipe() (r, w int32, errno int32)
-TEXT runtime·pipe(SB),NOSPLIT|NOFRAME,$0-12
-       ADD     $FIXED_FRAME, R1, R3
-       SYSCALL $SYS_pipe
-       MOVW    R3, errno+8(FP)
-       RET
-
 // func pipe2(flags int32) (r, w int32, errno int32)
 TEXT runtime·pipe2(SB),NOSPLIT|NOFRAME,$0-20
        ADD     $FIXED_FRAME+8, R1, R3
@@ -933,18 +925,6 @@ TEXT runtime·closeonexec(SB),NOSPLIT|NOFRAME,$0
        SYSCALL $SYS_fcntl
        RET
 
-// func runtime·setNonblock(int32 fd)
-TEXT runtime·setNonblock(SB),NOSPLIT|NOFRAME,$0-4
-       MOVW    fd+0(FP), R3 // fd
-       MOVD    $3, R4  // F_GETFL
-       MOVD    $0, R5
-       SYSCALL $SYS_fcntl
-       OR      $0x800, R3, R5 // O_NONBLOCK
-       MOVW    fd+0(FP), R3 // fd
-       MOVD    $4, R4  // F_SETFL
-       SYSCALL $SYS_fcntl
-       RET
-
 // func sbrk0() uintptr
 TEXT runtime·sbrk0(SB),NOSPLIT|NOFRAME,$0
        // Implemented as brk(NULL).
index a3da46d1362fbcd615ff4378cbc229b302d6e644..8dde29eb92ab3a8da514b2457cc52fff7d976cc8 100644 (file)
@@ -118,15 +118,6 @@ TEXT runtime·read(SB),NOSPLIT|NOFRAME,$0-28
        MOVW    A0, ret+24(FP)
        RET
 
-// func pipe() (r, w int32, errno int32)
-TEXT runtime·pipe(SB),NOSPLIT|NOFRAME,$0-12
-       MOV     $r+0(FP), A0
-       MOV     ZERO, A1
-       MOV     $SYS_pipe2, A7
-       ECALL
-       MOVW    A0, errno+8(FP)
-       RET
-
 // func pipe2(flags int32) (r, w int32, errno int32)
 TEXT runtime·pipe2(SB),NOSPLIT|NOFRAME,$0-20
        MOV     $r+8(FP), A0
@@ -635,21 +626,6 @@ TEXT runtime·closeonexec(SB),NOSPLIT|NOFRAME,$0
        ECALL
        RET
 
-// func runtime·setNonblock(int32 fd)
-TEXT runtime·setNonblock(SB),NOSPLIT|NOFRAME,$0-4
-       MOVW    fd+0(FP), A0 // fd
-       MOV     $3, A1  // F_GETFL
-       MOV     $0, A2
-       MOV     $SYS_fcntl, A7
-       ECALL
-       MOV     $0x800, A2 // O_NONBLOCK
-       OR      A0, A2
-       MOVW    fd+0(FP), A0 // fd
-       MOV     $4, A1  // F_SETFL
-       MOV     $SYS_fcntl, A7
-       ECALL
-       RET
-
 // func sbrk0() uintptr
 TEXT runtime·sbrk0(SB),NOSPLIT,$0-8
        // Implemented as brk(NULL).
index 886add8b543b3c927db0e362f535a1c90ec6d1cb..03ec7f03fd48d4c0984542becd308896675828aa 100644 (file)
@@ -16,7 +16,6 @@
 #define SYS_close                 6
 #define SYS_getpid               20
 #define SYS_kill                 37
-#define SYS_pipe                42
 #define SYS_brk                         45
 #define SYS_fcntl                55
 #define SYS_mmap                 90
@@ -103,14 +102,6 @@ TEXT runtime·read(SB),NOSPLIT|NOFRAME,$0-28
        MOVW    R2, ret+24(FP)
        RET
 
-// func pipe() (r, w int32, errno int32)
-TEXT runtime·pipe(SB),NOSPLIT|NOFRAME,$0-12
-       MOVD    $r+0(FP), R2
-       MOVW    $SYS_pipe, R1
-       SYSCALL
-       MOVW    R2, errno+8(FP)
-       RET
-
 // func pipe2() (r, w int32, errno int32)
 TEXT runtime·pipe2(SB),NOSPLIT|NOFRAME,$0-20
        MOVD    $r+8(FP), R2
@@ -497,21 +488,6 @@ TEXT runtime·closeonexec(SB),NOSPLIT|NOFRAME,$0
        SYSCALL
        RET
 
-// func runtime·setNonblock(int32 fd)
-TEXT runtime·setNonblock(SB),NOSPLIT|NOFRAME,$0-4
-       MOVW    fd+0(FP), R2 // fd
-       MOVD    $3, R3  // F_GETFL
-       XOR     R4, R4
-       MOVW    $SYS_fcntl, R1
-       SYSCALL
-       MOVD    $0x800, R4 // O_NONBLOCK
-       OR      R2, R4
-       MOVW    fd+0(FP), R2 // fd
-       MOVD    $4, R3  // F_SETFL
-       MOVW    $SYS_fcntl, R1
-       SYSCALL
-       RET
-
 // func sbrk0() uintptr
 TEXT runtime·sbrk0(SB),NOSPLIT|NOFRAME,$0-8
        // Implemented as brk(NULL).
index 8a33894892f1f1e0ca8b1b9612b470984aee89a9..b7d4645af1f425d026712c150bca40edc8712205 100644 (file)
@@ -87,21 +87,6 @@ TEXT runtime·read(SB),NOSPLIT,$-4
        MOVL    AX, ret+12(FP)
        RET
 
-// func pipe() (r, w int32, errno int32)
-TEXT runtime·pipe(SB),NOSPLIT,$0-12
-       MOVL    $42, AX
-       INT     $0x80
-       JCC     pipeok
-       MOVL    $-1, r+0(FP)
-       MOVL    $-1, w+4(FP)
-       MOVL    AX, errno+8(FP)
-       RET
-pipeok:
-       MOVL    AX, r+0(FP)
-       MOVL    DX, w+4(FP)
-       MOVL    $0, errno+8(FP)
-       RET
-
 // func pipe2(flags int32) (r, w int32, errno int32)
 TEXT runtime·pipe2(SB),NOSPLIT,$12-16
        MOVL    $453, AX
@@ -484,20 +469,3 @@ TEXT runtime·closeonexec(SB),NOSPLIT,$32
        JAE     2(PC)
        NEGL    AX
        RET
-
-// func runtime·setNonblock(fd int32)
-TEXT runtime·setNonblock(SB),NOSPLIT,$16-4
-       MOVL    $92, AX // fcntl
-       MOVL    fd+0(FP), BX // fd
-       MOVL    BX, 4(SP)
-       MOVL    $3, 8(SP) // F_GETFL
-       MOVL    $0, 12(SP)
-       INT     $0x80
-       MOVL    fd+0(FP), BX // fd
-       MOVL    BX, 4(SP)
-       MOVL    $4, 8(SP) // F_SETFL
-       ORL     $4, AX // O_NONBLOCK
-       MOVL    AX, 12(SP)
-       MOVL    $92, AX // fcntl
-       INT     $0x80
-       RET
index 02f5b4ba3b71c386ee2beb37db3e8c332e3aff34..41eddf373505aa454bbee1a2c29ba124f417be59 100644 (file)
@@ -163,21 +163,6 @@ TEXT runtime·read(SB),NOSPLIT,$-8
        MOVL    AX, ret+24(FP)
        RET
 
-// func pipe() (r, w int32, errno int32)
-TEXT runtime·pipe(SB),NOSPLIT,$0-12
-       MOVL    $42, AX
-       SYSCALL
-       JCC     pipeok
-       MOVL    $-1, r+0(FP)
-       MOVL    $-1, w+4(FP)
-       MOVL    AX, errno+8(FP)
-       RET
-pipeok:
-       MOVL    AX, r+0(FP)
-       MOVL    DX, w+4(FP)
-       MOVL    $0, errno+8(FP)
-       RET
-
 // func pipe2(flags int32) (r, w int32, errno int32)
 TEXT runtime·pipe2(SB),NOSPLIT,$0-20
        LEAQ    r+8(FP), DI
@@ -449,18 +434,3 @@ TEXT runtime·closeonexec(SB),NOSPLIT,$0
        MOVL    $SYS_fcntl, AX
        SYSCALL
        RET
-
-// func runtime·setNonblock(int32 fd)
-TEXT runtime·setNonblock(SB),NOSPLIT,$0-4
-       MOVL    fd+0(FP), DI  // fd
-       MOVQ    $3, SI  // F_GETFL
-       MOVQ    $0, DX
-       MOVL    $92, AX // fcntl
-       SYSCALL
-       MOVL    fd+0(FP), DI // fd
-       MOVQ    $4, SI // F_SETFL
-       MOVQ    $4, DX // O_NONBLOCK
-       ORL     AX, DX
-       MOVL    $92, AX // fcntl
-       SYSCALL
-       RET
index 3a763b2a6a7730035488b5323ff32023c129f50e..bbca040994e5aaa64e98b690ed7cda90a0396fb2 100644 (file)
@@ -96,22 +96,6 @@ TEXT runtime·read(SB),NOSPLIT|NOFRAME,$0
        MOVW    R0, ret+12(FP)
        RET
 
-// func pipe() (r, w int32, errno int32)
-TEXT runtime·pipe(SB),NOSPLIT,$0-12
-       SWI $0xa0002a
-       BCC pipeok
-       MOVW $-1,R2
-       MOVW R2, r+0(FP)
-       MOVW R2, w+4(FP)
-       MOVW R0, errno+8(FP)
-       RET
-pipeok:
-       MOVW $0, R2
-       MOVW R0, r+0(FP)
-       MOVW R1, w+4(FP)
-       MOVW R2, errno+8(FP)
-       RET
-
 // func pipe2(flags int32) (r, w int32, errno int32)
 TEXT runtime·pipe2(SB),NOSPLIT,$0-16
        MOVW $r+4(FP), R0
@@ -422,18 +406,6 @@ TEXT runtime·closeonexec(SB),NOSPLIT,$0
        SWI $SYS_fcntl
        RET
 
-// func runtime·setNonblock(fd int32)
-TEXT runtime·setNonblock(SB),NOSPLIT,$0-4
-       MOVW fd+0(FP), R0       // fd
-       MOVW $3, R1     // F_GETFL
-       MOVW $0, R2
-       SWI $0xa0005c   // sys_fcntl
-       ORR $0x4, R0, R2        // O_NONBLOCK
-       MOVW fd+0(FP), R0       // fd
-       MOVW $4, R1     // F_SETFL
-       SWI $0xa0005c   // sys_fcntl
-       RET
-
 // TODO: this is only valid for ARMv7+
 TEXT ·publicationBarrier(SB),NOSPLIT|NOFRAME,$0-0
        B       runtime·armPublicationBarrier(SB)
index 8a0496e80722e349bfc59ffe405be2419b99cc02..f7cce57c2d6bec22500647866c18bc6930be1c88 100644 (file)
@@ -154,17 +154,6 @@ ok:
        MOVW    R0, ret+24(FP)
        RET
 
-// func pipe() (r, w int32, errno int32)
-TEXT runtime·pipe(SB),NOSPLIT|NOFRAME,$0-12
-       ADD     $8, RSP, R0
-       MOVW    $0, R1
-       SVC     $SYS_pipe2
-       BCC     pipeok
-       NEG     R0, R0
-pipeok:
-       MOVW    R0, errno+8(FP)
-       RET
-
 // func pipe2(flags int32) (r, w int32, errno int32)
 TEXT runtime·pipe2(SB),NOSPLIT|NOFRAME,$0-20
        ADD     $16, RSP, R0
@@ -466,16 +455,3 @@ TEXT runtime·closeonexec(SB),NOSPLIT,$0
        MOVW    $FD_CLOEXEC, R2
        SVC     $SYS_fcntl
        RET
-
-// func runtime·setNonblock(int32 fd)
-TEXT runtime·setNonblock(SB),NOSPLIT|NOFRAME,$0-4
-       MOVW    fd+0(FP), R0            // arg 1 - fd
-       MOVD    $F_GETFL, R1            // arg 2 - cmd
-       MOVD    $0, R2                  // arg 3
-       SVC     $SYS_fcntl
-       MOVD    $O_NONBLOCK, R2
-       EOR     R0, R2                  // arg 3 - flags
-       MOVW    fd+0(FP), R0            // arg 1 - fd
-       MOVD    $F_SETFL, R1            // arg 2 - cmd
-       SVC     $SYS_fcntl
-       RET
index 4d50b4f6b136f23d5c615acadf1ad28748e130cc..d174d87a49cfd41409a770eb175fbda08cd16672 100644 (file)
@@ -111,10 +111,6 @@ func write1(fd uintptr, p unsafe.Pointer, n int32) int32 {
 }
 func write_trampoline()
 
-func pipe() (r, w int32, errno int32) {
-       return pipe2(0)
-}
-
 func pipe2(flags int32) (r, w int32, errno int32) {
        var p [2]int32
        args := struct {
@@ -258,12 +254,6 @@ func closeonexec(fd int32) {
        fcntl(fd, _F_SETFD, _FD_CLOEXEC)
 }
 
-//go:nosplit
-func setNonblock(fd int32) {
-       flags := fcntl(fd, _F_GETFL, 0)
-       fcntl(fd, _F_SETFL, flags|_O_NONBLOCK)
-}
-
 // Tell the linker that the libc_* functions are to be found
 // in a system library, with the libc_ prefix missing.
 
index f8ae8e7c3014b7eb8a0ff28a5d517354ded709fc..3b18bdda7a721ae1f5cd0fe0cf496fe78322996a 100644 (file)
@@ -64,17 +64,6 @@ TEXT runtime·read(SB),NOSPLIT|NOFRAME,$0
        MOVW    R2, ret+24(FP)
        RET
 
-// func pipe() (r, w int32, errno int32)
-TEXT runtime·pipe(SB),NOSPLIT|NOFRAME,$0-12
-       MOVV    $r+0(FP), R4
-       MOVW    $0, R5
-       MOVV    $101, R2                // sys_pipe2
-       SYSCALL
-       BEQ     R7, 2(PC)
-       SUBVU   R2, R0, R2      // caller expects negative errno
-       MOVW    R2, errno+8(FP)
-       RET
-
 // func pipe2(flags int32) (r, w int32, errno int32)
 TEXT runtime·pipe2(SB),NOSPLIT|NOFRAME,$0-20
        MOVV    $r+8(FP), R4
@@ -383,18 +372,3 @@ TEXT runtime·closeonexec(SB),NOSPLIT,$0
        MOVV    $92, R2                 // sys_fcntl
        SYSCALL
        RET
-
-// func runtime·setNonblock(int32 fd)
-TEXT runtime·setNonblock(SB),NOSPLIT|NOFRAME,$0-4
-       MOVW    fd+0(FP), R4            // arg 1 - fd
-       MOVV    $3, R5                  // arg 2 - cmd (F_GETFL)
-       MOVV    $0, R6                  // arg 3
-       MOVV    $92, R2                 // sys_fcntl
-       SYSCALL
-       MOVV    $4, R6                  // O_NONBLOCK
-       OR      R2, R6                  // arg 3 - flags
-       MOVW    fd+0(FP), R4            // arg 1 - fd
-       MOVV    $4, R5                  // arg 2 - cmd (F_SETFL)
-       MOVV    $92, R2                 // sys_fcntl
-       SYSCALL
-       RET