diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-03-06 17:57:23 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-03-06 17:57:23 +0000 |
commit | 593f74bbab63d34c7060918088bcbad686c31c66 (patch) | |
tree | 4ce83ca433796a728e9fdd00af105bce158532b5 /libgo/go/syscall | |
parent | 46402cbe0ba3ea92be9642cf18eedaefe57a414c (diff) | |
download | gcc-593f74bbab63d34c7060918088bcbad686c31c66.zip gcc-593f74bbab63d34c7060918088bcbad686c31c66.tar.gz gcc-593f74bbab63d34c7060918088bcbad686c31c66.tar.bz2 |
libgo: Update to weekly.2012-03-04 release.
From-SVN: r185010
Diffstat (limited to 'libgo/go/syscall')
-rw-r--r-- | libgo/go/syscall/socket.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libgo/go/syscall/socket.go b/libgo/go/syscall/socket.go index 7a2e95c..6d36e39 100644 --- a/libgo/go/syscall/socket.go +++ b/libgo/go/syscall/socket.go @@ -217,6 +217,13 @@ func Socketpair(domain, typ, proto int) (fd [2]int, err error) { //sys getsockopt(s int, level int, name int, val uintptr, vallen *Socklen_t) (err error) //getsockopt(s int, level int, name int, val *byte, vallen *Socklen_t) int +func GetsockoptByte(fd, level, opt int) (value byte, err error) { + var n byte + vallen := Socklen_t(1) + err = getsockopt(fd, level, opt, uintptr(unsafe.Pointer(&n)), &vallen) + return n, err +} + func GetsockoptInt(fd, level, opt int) (value int, err error) { var n int32 vallen := Socklen_t(4) @@ -254,6 +261,11 @@ func GetsockoptIPv6Mreq(fd, level, opt int) (*IPv6Mreq, error) { //sys setsockopt(s int, level int, name int, val *byte, vallen Socklen_t) (err error) //setsockopt(s int, level int, optname int, val *byte, vallen Socklen_t) int +func SetsockoptByte(fd, level, opt int, value byte) (err error) { + var n = byte(value) + return setsockopt(fd, level, opt, (*byte)(unsafe.Pointer(&n)), 1) +} + func SetsockoptInt(fd, level, opt int, value int) (err error) { var n = int32(value) return setsockopt(fd, level, opt, (*byte)(unsafe.Pointer(&n)), 4) |