Commit 13d03a9a authored by Cholerae Hu's avatar Cholerae Hu Committed by Tobias Klauser

unix: add GetsockoptLinger and GetsockoptTimeval

Fixes golang/go#24515

Change-Id: Icac78e8f2937668c2ce2fd6a695ce44bb702b8f1
Reviewed-on: https://go-review.googlesource.com/102515
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: 's avatarTobias Klauser <tobias.klauser@gmail.com>
parent 91ee8cde
......@@ -206,6 +206,20 @@ func GetsockoptInt(fd, level, opt int) (value int, err error) {
return int(n), err
}
func GetsockoptLinger(fd, level, opt int) (*Linger, error) {
var linger Linger
vallen := _Socklen(SizeofLinger)
err := getsockopt(fd, level, opt, unsafe.Pointer(&linger), &vallen)
return &linger, err
}
func GetsockoptTimeval(fd, level, opt int) (*Timeval, error) {
var tv Timeval
vallen := _Socklen(unsafe.Sizeof(tv))
err := getsockopt(fd, level, opt, unsafe.Pointer(&tv), &vallen)
return &tv, err
}
func Recvfrom(fd int, p []byte, flags int) (n int, from Sockaddr, err error) {
var rsa RawSockaddrAny
var len _Socklen = SizeofSockaddrAny
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment