syscall: add socketpair

R=rsc
CC=golang-dev
https://golang.org/cl/1319042
This commit is contained in:
Ivan Krasin 2010-06-30 14:58:21 -07:00 committed by Russ Cox
parent a0117bafa0
commit 400f7a6ba5
9 changed files with 67 additions and 0 deletions

View file

@ -323,6 +323,11 @@ func Socket(domain, typ, proto int) (fd, errno int) {
return
}
func Socketpair(domain, typ, proto int) (fd [2]int, errno int) {
fd, errno = socketpair(domain, typ, proto)
return
}
func SetsockoptInt(fd, level, opt int, value int) (errno int) {
var n = int32(value)
return setsockopt(fd, level, opt, uintptr(unsafe.Pointer(&n)), 4)