Skip to content

Commit bd98a81

Browse files
dwimmerianlancetaylor
authored andcommitted
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. Change-Id: I65dfbd2a02b64e777a8eb13013d718e356521be6 GitHub-Last-Rev: c483a06 GitHub-Pull-Request: #26608 Reviewed-on: https://go-review.googlesource.com/125915 Run-TryBot: Ian Lance Taylor <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Vladimir Stefanovic <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent e5b1340 commit bd98a81

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)