aboutsummaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2022-03-08 14:55:26 +0100
committerTobias Klauser <tobias.klauser@gmail.com>2022-03-08 21:16:53 +0000
commitc3c74777bc5dcd351af6dc4811011241efe07d21 (patch)
treeda8b0339061abe43f3d2c3663e50959c7832a6ac /src/runtime
parent085ef537c4a2c57d373e72f4a110d9fae9a287be (diff)
downloadgo-c3c74777bc5dcd351af6dc4811011241efe07d21.tar.xz
runtime, syscall: implement syscall.Pipe using syscall.Pipe2 on solaris
All other platforms providing the pipe2 syscall already implement it that way. Do so as well on solaris, which allows to drop runtime.syscall_pipe and its dependencies as well. Change-Id: Icf04777f21d1804da74325d173fefdc87caa42eb Reviewed-on: https://go-review.googlesource.com/c/go/+/390716 Trust: Tobias Klauser <tobias.klauser@gmail.com> Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> Trust: Matt Layher <mdlayher@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/runtime')
-rw-r--r--src/runtime/os3_solaris.go3
-rw-r--r--src/runtime/sys_solaris_amd64.s12
-rw-r--r--src/runtime/syscall_solaris.go18
3 files changed, 0 insertions, 33 deletions
diff --git a/src/runtime/os3_solaris.go b/src/runtime/os3_solaris.go
index 5aee04d5a8..f465a3aa3f 100644
--- a/src/runtime/os3_solaris.go
+++ b/src/runtime/os3_solaris.go
@@ -47,7 +47,6 @@ import (
//go:cgo_import_dynamic libc_sysconf sysconf "libc.so"
//go:cgo_import_dynamic libc_usleep usleep "libc.so"
//go:cgo_import_dynamic libc_write write "libc.so"
-//go:cgo_import_dynamic libc_pipe pipe "libc.so"
//go:cgo_import_dynamic libc_pipe2 pipe2 "libc.so"
//go:linkname libc____errno libc____errno
@@ -83,7 +82,6 @@ import (
//go:linkname libc_sysconf libc_sysconf
//go:linkname libc_usleep libc_usleep
//go:linkname libc_write libc_write
-//go:linkname libc_pipe libc_pipe
//go:linkname libc_pipe2 libc_pipe2
var (
@@ -120,7 +118,6 @@ var (
libc_sysconf,
libc_usleep,
libc_write,
- libc_pipe,
libc_pipe2 libcFunc
)
diff --git a/src/runtime/sys_solaris_amd64.s b/src/runtime/sys_solaris_amd64.s
index 05fd187517..24d2d61df0 100644
--- a/src/runtime/sys_solaris_amd64.s
+++ b/src/runtime/sys_solaris_amd64.s
@@ -29,18 +29,6 @@ TEXT runtimeĀ·miniterrno(SB),NOSPLIT,$0
MOVQ AX, (m_mOS+mOS_perrno)(BX)
RET
-// pipe(3c) wrapper that returns fds in AX, DX.
-// NOT USING GO CALLING CONVENTION.
-TEXT runtimeĀ·pipe1(SB),NOSPLIT,$0
- SUBQ $16, SP // 8 bytes will do, but stack has to be 16-byte aligned
- MOVQ SP, DI
- LEAQ libc_pipe(SB), AX
- CALL AX
- MOVL 0(SP), AX
- MOVL 4(SP), DX
- ADDQ $16, SP
- RET
-
// Call a library function with SysV calling conventions.
// The called function can take a maximum of 6 INTEGER class arguments,
// see
diff --git a/src/runtime/syscall_solaris.go b/src/runtime/syscall_solaris.go
index e270e271c0..79775711ae 100644
--- a/src/runtime/syscall_solaris.go
+++ b/src/runtime/syscall_solaris.go
@@ -25,11 +25,6 @@ var (
libc_wait4 libcFunc
)
-//go:linkname pipe1x runtime.pipe1
-var pipe1x libcFunc // name to take addr of pipe1
-
-func pipe1() // declared for vet; do NOT call
-
// Many of these are exported via linkname to assembly in the syscall
// package.
@@ -196,19 +191,6 @@ func syscall_ioctl(fd, req, arg uintptr) (err uintptr) {
return call.err
}
-//go:linkname syscall_pipe
-func syscall_pipe() (r, w, err uintptr) {
- call := libcall{
- fn: uintptr(unsafe.Pointer(&pipe1x)),
- n: 0,
- args: uintptr(unsafe.Pointer(&pipe1x)), // it's unused but must be non-nil, otherwise crashes
- }
- entersyscallblock()
- asmcgocall(unsafe.Pointer(&asmsysvicall6x), unsafe.Pointer(&call))
- exitsyscall()
- return call.r1, call.r2, call.err
-}
-
// This is syscall.RawSyscall, it exists to satisfy some build dependency,
// but it doesn't work.
//