Skip to content

Commit

Permalink
syscall: implement pipe() on linux/mips
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
dwimmer authored and ianlancetaylor committed Jul 26, 2018
1 parent e5b1340 commit bd98a81
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/syscall/syscall_linux_mipsx.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,13 @@ func Pipe2(p []int, flags int) (err error) {
return
}

//sysnb pipe() (p1 int, p2 int, err error)

func Pipe(p []int) (err error) {
if len(p) != 2 {
return EINVAL
}
var pp [2]_C_int
err = pipe2(&pp, 0)
p[0] = int(pp[0])
p[1] = int(pp[1])
p[0], p[1], err = pipe()
return
}

Expand Down
12 changes: 12 additions & 0 deletions src/syscall/zsyscall_linux_mips.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions src/syscall/zsyscall_linux_mipsle.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit bd98a81

Please sign in to comment.