Skip to content

Commit 085ef53

Browse files
committed
os, internal/syscall/unix: consolidate Pipe implementations
All platforms with the pipe2 syscall now provide syscall.Pipe2. Use it to implement os.Pipe. This also allows to drop the illumos-specific wrapper in internal/sys/unix. Change-Id: Ieb712a1498e86a389bad261e4e97c61c11d4bdd0 Reviewed-on: https://go-review.googlesource.com/c/go/+/390715 Trust: Tobias Klauser <[email protected]> Run-TryBot: Tobias Klauser <[email protected]> Trust: Matt Layher <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent de8ddd9 commit 085ef53

File tree

5 files changed

+3
-82
lines changed

5 files changed

+3
-82
lines changed

src/internal/syscall/unix/pipe2_illumos.go

Lines changed: 0 additions & 34 deletions
This file was deleted.

src/os/pipe2_illumos.go

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/os/pipe2_bsd.go renamed to src/os/pipe2_unix.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
//go:build dragonfly || freebsd || netbsd || openbsd
5+
//go:build dragonfly || freebsd || linux || netbsd || openbsd || solaris
66

77
package os
88

@@ -15,7 +15,7 @@ func Pipe() (r *File, w *File, err error) {
1515

1616
e := syscall.Pipe2(p[0:], syscall.O_CLOEXEC)
1717
if e != nil {
18-
return nil, nil, NewSyscallError("pipe", e)
18+
return nil, nil, NewSyscallError("pipe2", e)
1919
}
2020

2121
return newFile(uintptr(p[0]), "|0", kindPipe), newFile(uintptr(p[1]), "|1", kindPipe), nil

src/os/pipe_linux.go

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/os/pipe_bsd.go renamed to src/os/pipe_unix.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
//go:build aix || darwin || (js && wasm) || (solaris && !illumos)
5+
//go:build aix || darwin || (js && wasm)
66

77
package os
88

0 commit comments

Comments
 (0)