diff options
author | Ivan Krasin <krasin@golang.org> | 2010-06-30 14:58:21 -0700 |
---|---|---|
committer | Ivan Krasin <krasin@golang.org> | 2010-06-30 14:58:21 -0700 |
commit | f73da39896bc9a09088ed4fe090d7b6308f80da5 (patch) | |
tree | a8d665682fa6b78ec2d52e624bff27c98c6dfd1f /src/pkg/syscall/zsyscall_darwin_386.go | |
parent | 16234d0566433f78d7c8fee2f6200685f5250a9b (diff) | |
download | golang-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.go | 9 |
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) |