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
@@ -75,16 +75,3 @@ func Accept4(fd int, flags int) (nfd int, sa Sockaddr, err error) {
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
//sysnb pipe2(p *[2]_C_int, flags int) (err error)
|
||||
|
||||
func Pipe2(p []int, flags int) error {
|
||||
if len(p) != 2 {
|
||||
return EINVAL
|
||||
}
|
||||
var pp [2]_C_int
|
||||
err := pipe2(&pp, flags)
|
||||
p[0] = int(pp[0])
|
||||
p[1] = int(pp[1])
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user