mirror of
https://github.com/rwinkhart/sys.git
synced 2026-09-06 00:57:18 -04:00
unix: add Pipe2 for solaris
We already implement Pipe2 for illumos and it seems solaris provides the pipe2 syscall as well, see https://docs.oracle.com/cd/E88353_01/html/E37841/pipe2-2.html. Fixes golang/go#40613 Change-Id: I135cb1e78e6c67567d30d7eed266d00ef8fd6c3a Reviewed-on: https://go-review.googlesource.com/c/sys/+/283032 Trust: Tobias Klauser <tobias.klauser@gmail.com> Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Matt Layher <mdlayher@gmail.com>
This commit is contained in:
committed by
Tobias Klauser
parent
789bb1bd40
commit
489259a850
@@ -11,6 +11,7 @@ import (
|
||||
)
|
||||
|
||||
//go:cgo_import_dynamic libc_pipe pipe "libc.so"
|
||||
//go:cgo_import_dynamic libc_pipe2 pipe2 "libc.so"
|
||||
//go:cgo_import_dynamic libc_getsockname getsockname "libsocket.so"
|
||||
//go:cgo_import_dynamic libc_getcwd getcwd "libc.so"
|
||||
//go:cgo_import_dynamic libc_getgroups getgroups "libc.so"
|
||||
@@ -140,6 +141,7 @@ import (
|
||||
//go:cgo_import_dynamic libc_recvfrom recvfrom "libsocket.so"
|
||||
|
||||
//go:linkname procpipe libc_pipe
|
||||
//go:linkname procpipe2 libc_pipe2
|
||||
//go:linkname procgetsockname libc_getsockname
|
||||
//go:linkname procGetcwd libc_getcwd
|
||||
//go:linkname procgetgroups libc_getgroups
|
||||
@@ -270,6 +272,7 @@ import (
|
||||
|
||||
var (
|
||||
procpipe,
|
||||
procpipe2,
|
||||
procgetsockname,
|
||||
procGetcwd,
|
||||
procgetgroups,
|
||||
@@ -412,6 +415,16 @@ func pipe(p *[2]_C_int) (n int, err error) {
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func pipe2(p *[2]_C_int, flags int) (err error) {
|
||||
_, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procpipe2)), 2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0, 0, 0, 0)
|
||||
if e1 != 0 {
|
||||
err = e1
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
|
||||
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procgetsockname)), 3, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0)
|
||||
if e1 != 0 {
|
||||
|
||||
Reference in New Issue
Block a user