This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[gccgo] Don't use BindToDevice on RTEMS
- From: Ian Lance Taylor <iant at google dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 02 Jul 2010 09:54:02 -0700
- Subject: [gccgo] Don't use BindToDevice on RTEMS
RTEMS does not support SO_BINDTODEVICE. This patch from Vinu
Rajashekhar avoids it on RTEMS. Committed to gccgo branch.
Ian
diff -r 27379025cbbd libgo/syscalls/socket.go
--- a/libgo/syscalls/socket.go Fri Jul 02 09:39:30 2010 -0700
+++ b/libgo/syscalls/socket.go Fri Jul 02 09:47:21 2010 -0700
@@ -149,11 +149,6 @@
return setsockopt(fd, level, opt, uintptr(unsafe.Pointer(&[]byte(s)[0])), Socklen_t(len(s)))
}
-// BindToDevice binds the socket associated with fd to device.
-func BindToDevice(fd int, device string) (errno int) {
- return SetsockoptString(fd, SOL_SOCKET, SO_BINDTODEVICE, device)
-}
-
func Getsockname(fd int) (sa Sockaddr, errno int) {
var rsa RawSockaddrAny;
var len Socklen_t = SizeofSockaddrAny;
diff -r 27379025cbbd libgo/syscalls/socket_bsd.go
--- a/libgo/syscalls/socket_bsd.go Fri Jul 02 09:39:30 2010 -0700
+++ b/libgo/syscalls/socket_bsd.go Fri Jul 02 09:47:21 2010 -0700
@@ -132,3 +132,8 @@
}
return nil, EAFNOSUPPORT;
}
+
+// BindToDevice binds the socket associated with fd to device.
+func BindToDevice(fd int, device string) (errno int) {
+ return ENOSYS
+}
diff -r 27379025cbbd libgo/syscalls/socket_linux.go
--- a/libgo/syscalls/socket_linux.go Fri Jul 02 09:39:30 2010 -0700
+++ b/libgo/syscalls/socket_linux.go Fri Jul 02 09:47:21 2010 -0700
@@ -133,3 +133,8 @@
}
return nil, EAFNOSUPPORT;
}
+
+// BindToDevice binds the socket associated with fd to device.
+func BindToDevice(fd int, device string) (errno int) {
+ return SetsockoptString(fd, SOL_SOCKET, SO_BINDTODEVICE, device)
+}