diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2011-03-30 15:33:16 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2011-03-30 15:33:16 +0000 |
commit | f72f4169133572cf62f1e872c5657cdbc4d5de2c (patch) | |
tree | 9382d76e5dc68294cdf3c4f2c03a9f61b44fb014 /libgo/syscalls | |
parent | f2034d064c29d9620c5562b2b5b517bdc6c7a672 (diff) | |
download | gcc-f72f4169133572cf62f1e872c5657cdbc4d5de2c.zip gcc-f72f4169133572cf62f1e872c5657cdbc4d5de2c.tar.gz gcc-f72f4169133572cf62f1e872c5657cdbc4d5de2c.tar.bz2 |
Update to current Go library.
From-SVN: r171732
Diffstat (limited to 'libgo/syscalls')
-rw-r--r-- | libgo/syscalls/socket.go | 9 | ||||
-rw-r--r-- | libgo/syscalls/sysfile_posix.go | 2 |
2 files changed, 8 insertions, 3 deletions
diff --git a/libgo/syscalls/socket.go b/libgo/syscalls/socket.go index e786653..28581a5 100644 --- a/libgo/syscalls/socket.go +++ b/libgo/syscalls/socket.go @@ -208,6 +208,13 @@ func Listen(fd int, n int) (errno int) { return; } +func GetsockoptInt(fd, level, opt int) (value, errno int) { + var n int32 + vallen := Socklen_t(4) + errno = libc_getsockopt(fd, level, opt, (*byte)(unsafe.Pointer(&n)), &vallen) + return int(n), errno +} + func setsockopt(fd, level, opt int, valueptr uintptr, length Socklen_t) (errno int) { r := libc_setsockopt(fd, level, opt, (*byte)(unsafe.Pointer(valueptr)), length); @@ -383,5 +390,3 @@ func Shutdown(fd int, how int) (errno int) { if r < 0 { errno = GetErrno() } return; } - -// FIXME: No getsockopt. diff --git a/libgo/syscalls/sysfile_posix.go b/libgo/syscalls/sysfile_posix.go index 8b72498..46ac0e0 100644 --- a/libgo/syscalls/sysfile_posix.go +++ b/libgo/syscalls/sysfile_posix.go @@ -209,7 +209,7 @@ func FDZero(set *FdSet_t) { func Select(nfds int, r *FdSet_t, w *FdSet_t, e *FdSet_t, timeout *Timeval) (n int, errno int) { n = libc_select(nfds, (*byte)(unsafe.Pointer(r)), - (*byte)(unsafe.Pointer(e)), + (*byte)(unsafe.Pointer(w)), (*byte)(unsafe.Pointer(e)), timeout); if n < 0 { errno = GetErrno() } return; |