syscall: move bsd pipe syscall
Not all BSDs have the same pipe() syscall implementation - move the Darwin/FreeBSD specific implementation into their respective OS syscall files. This will be needed to add OpenBSD syscall support.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4823057
diff --git a/src/pkg/syscall/syscall_darwin.go b/src/pkg/syscall/syscall_darwin.go
index d43d486..11dc8aa 100644
--- a/src/pkg/syscall/syscall_darwin.go
+++ b/src/pkg/syscall/syscall_darwin.go
@@ -60,6 +60,16 @@
func PtraceAttach(pid int) (errno int) { return ptrace(PT_ATTACH, pid, 0, 0) }
func PtraceDetach(pid int) (errno int) { return ptrace(PT_DETACH, pid, 0, 0) }
+//sysnb pipe() (r int, w int, errno int)
+
+func Pipe(p []int) (errno int) {
+ if len(p) != 2 {
+ return EINVAL
+ }
+ p[0], p[1], errno = pipe()
+ return
+}
+
// TODO
func Sendfile(outfd int, infd int, offset *int64, count int) (written int, errno int) {
return -1, ENOSYS