Skip to content

Commit c483a06

Browse files
committed
syscall: implement pipe() on linux/mips
Change the Pipe() function to use the pipe() syscall (which has a unique calling convention on linux/mips) instead of using pipe2(). This allows it work on kernels <2.6.27 when pipe2() was introduced.
1 parent 5f5402b commit c483a06

File tree

3 files changed

+27
-4
lines changed

3 files changed

+27
-4
lines changed

src/syscall/syscall_linux_mipsx.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,13 @@ func Pipe2(p []int, flags int) (err error) {
119119
return
120120
}
121121

122+
//sysnb pipe() (p1 int, p2 int, err error)
123+
122124
func Pipe(p []int) (err error) {
123125
if len(p) != 2 {
124126
return EINVAL
125127
}
126-
var pp [2]_C_int
127-
err = pipe2(&pp, 0)
128-
p[0] = int(pp[0])
129-
p[1] = int(pp[1])
128+
p[0], p[1], err = pipe()
130129
return
131130
}
132131

src/syscall/zsyscall_linux_mips.go

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/syscall/zsyscall_linux_mipsle.go

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)