mirror of
https://github.com/golang/go
synced 2024-11-14 08:10:22 -07:00
syscall: Implement SetsockoptString
R=rsc, r CC=golang-dev https://golang.org/cl/739042
This commit is contained in:
parent
16e543163b
commit
7f2ea938ed
@ -342,6 +342,9 @@ func SetsockoptLinger(fd, level, opt int, l *Linger) (errno int) {
|
|||||||
return setsockopt(fd, level, opt, uintptr(unsafe.Pointer(l)), unsafe.Sizeof(*l))
|
return setsockopt(fd, level, opt, uintptr(unsafe.Pointer(l)), unsafe.Sizeof(*l))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func SetsockoptString(fd, level, opt int, s string) (errno int) {
|
||||||
|
return setsockopt(fd, level, opt, uintptr(unsafe.Pointer(&[]byte(s)[0])), len(s))
|
||||||
|
}
|
||||||
|
|
||||||
//sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, errno int)
|
//sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, errno int)
|
||||||
|
|
||||||
|
@ -342,6 +342,9 @@ func SetsockoptLinger(fd, level, opt int, l *Linger) (errno int) {
|
|||||||
return setsockopt(fd, level, opt, uintptr(unsafe.Pointer(l)), unsafe.Sizeof(*l))
|
return setsockopt(fd, level, opt, uintptr(unsafe.Pointer(l)), unsafe.Sizeof(*l))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func SetsockoptString(fd, level, opt int, s string) (errno int) {
|
||||||
|
return setsockopt(fd, level, opt, uintptr(unsafe.Pointer(&[]byte(s)[0])), len(s))
|
||||||
|
}
|
||||||
|
|
||||||
//sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, errno int)
|
//sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, errno int)
|
||||||
|
|
||||||
|
@ -365,6 +365,10 @@ func SetsockoptLinger(fd, level, opt int, l *Linger) (errno int) {
|
|||||||
return setsockopt(fd, level, opt, uintptr(unsafe.Pointer(l)), unsafe.Sizeof(*l))
|
return setsockopt(fd, level, opt, uintptr(unsafe.Pointer(l)), unsafe.Sizeof(*l))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func SetsockoptString(fd, level, opt int, s string) (errno int) {
|
||||||
|
return setsockopt(fd, level, opt, uintptr(unsafe.Pointer(&[]byte(s)[0])), len(s))
|
||||||
|
}
|
||||||
|
|
||||||
func Recvfrom(fd int, p []byte, flags int) (n int, from Sockaddr, errno int) {
|
func Recvfrom(fd int, p []byte, flags int) (n int, from Sockaddr, errno int) {
|
||||||
var rsa RawSockaddrAny
|
var rsa RawSockaddrAny
|
||||||
var len _Socklen = SizeofSockaddrAny
|
var len _Socklen = SizeofSockaddrAny
|
||||||
|
Loading…
Reference in New Issue
Block a user