summaryrefslogtreecommitdiff
path: root/src/pkg/syscall/zsyscall_darwin_386.go
diff options
context:
space:
mode:
authorIvan Krasin <krasin@golang.org>2010-06-30 14:58:21 -0700
committerIvan Krasin <krasin@golang.org>2010-06-30 14:58:21 -0700
commitf73da39896bc9a09088ed4fe090d7b6308f80da5 (patch)
treea8d665682fa6b78ec2d52e624bff27c98c6dfd1f /src/pkg/syscall/zsyscall_darwin_386.go
parent16234d0566433f78d7c8fee2f6200685f5250a9b (diff)
downloadgolang-f73da39896bc9a09088ed4fe090d7b6308f80da5.tar.gz
syscall: add socketpair
R=rsc CC=golang-dev http://codereview.appspot.com/1319042 Committer: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src/pkg/syscall/zsyscall_darwin_386.go')
-rw-r--r--src/pkg/syscall/zsyscall_darwin_386.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/pkg/syscall/zsyscall_darwin_386.go b/src/pkg/syscall/zsyscall_darwin_386.go
index 6e46cfbc4..78e21ca44 100644
--- a/src/pkg/syscall/zsyscall_darwin_386.go
+++ b/src/pkg/syscall/zsyscall_darwin_386.go
@@ -59,6 +59,15 @@ func socket(domain int, typ int, proto int) (fd int, errno int) {
return
}
+func socketpair(domain int, typ int, proto int) (fd [2]int, errno int) {
+ var f [2]int
+ _, _, e1 := Syscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(&f)), 0, 0)
+ fd = f
+ errno = int(e1)
+ return
+}
+
+
func setsockopt(s int, level int, name int, val uintptr, vallen int) (errno int) {
_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)
errno = int(e1)