diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2019-03-19 14:00:59 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2019-03-19 14:00:59 +0000 |
commit | 9195aa172bbc20627f23bfb1612180c83a0a7bab (patch) | |
tree | e42ecb2ffbddc6bf438c711494028bc3b86f527c /libgo/go/net | |
parent | 3b595ecaeda647070c6c4ede0c09be78dfc4f763 (diff) | |
download | gcc-9195aa172bbc20627f23bfb1612180c83a0a7bab.zip gcc-9195aa172bbc20627f23bfb1612180c83a0a7bab.tar.gz gcc-9195aa172bbc20627f23bfb1612180c83a0a7bab.tar.bz2 |
libgo: fix build on AIX
Since aix/ppc64 has been added to GC toolchain, a mix between new and
old files were created in gcc toolchain.
This commit corrects this merge for aix/ppc64 and aix/ppc.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/167658
From-SVN: r269797
Diffstat (limited to 'libgo/go/net')
-rw-r--r-- | libgo/go/net/interface_aix.go | 8 | ||||
-rw-r--r-- | libgo/go/net/interface_stub.go | 2 | ||||
-rw-r--r-- | libgo/go/net/sockoptip_aix.go | 15 |
3 files changed, 6 insertions, 19 deletions
diff --git a/libgo/go/net/interface_aix.go b/libgo/go/net/interface_aix.go index 9a8b5bb..1fe9bba 100644 --- a/libgo/go/net/interface_aix.go +++ b/libgo/go/net/interface_aix.go @@ -32,6 +32,8 @@ const _RTAX_NETMASK = 2 const _RTAX_IFA = 5 const _RTAX_MAX = 8 +const _SIOCGIFMTU = -0x3fd796aa + func getIfList() ([]byte, error) { needed, err := syscall.Getkerninfo(_KINFO_RT_IFLIST, 0, 0, 0) if err != nil { @@ -62,7 +64,7 @@ func interfaceTable(ifindex int) ([]Interface, error) { } if ifm.Type == syscall.RTM_IFINFO { if ifindex == 0 || ifindex == int(ifm.Index) { - sdl := (*rawSockaddrDatalink)(unsafe.Pointer(&tab[syscall.SizeofIfMsghdr])) + sdl := (*rawSockaddrDatalink)(unsafe.Pointer(&tab[unsafe.Sizeof(syscall.IfMsgHdr)])) ifi := &Interface{Index: int(ifm.Index), Flags: linkFlags(ifm.Flags)} ifi.Name = string(sdl.Data[:sdl.Nlen]) @@ -75,7 +77,7 @@ func interfaceTable(ifindex int) ([]Interface, error) { if err != nil { return nil, err } - err = unix.Ioctl(sock, syscall.SIOCGIFMTU, uintptr(unsafe.Pointer(ifr))) + err = unix.Ioctl(sock, _SIOCGIFMTU, uintptr(unsafe.Pointer(ifr))) if err != nil { return nil, err } @@ -131,7 +133,7 @@ func interfaceAddrTable(ifi *Interface) ([]Addr, error) { if ifm.Type == syscall.RTM_NEWADDR { if ifi == nil || ifi.Index == int(ifm.Index) { mask := ifm.Addrs - off := uint(syscall.SizeofIfMsghdr) + off := uint(unsafe.Sizeof(syscall.IfMsgHdr)) var iprsa, nmrsa *syscall.RawSockaddr for i := uint(0); i < _RTAX_MAX; i++ { diff --git a/libgo/go/net/interface_stub.go b/libgo/go/net/interface_stub.go index 0b3580e..d8afd5e 100644 --- a/libgo/go/net/interface_stub.go +++ b/libgo/go/net/interface_stub.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build aix nacl hurd js,wasm +// +build nacl hurd js,wasm package net diff --git a/libgo/go/net/sockoptip_aix.go b/libgo/go/net/sockoptip_aix.go deleted file mode 100644 index 1e28fe6..0000000 --- a/libgo/go/net/sockoptip_aix.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2017 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package net - -import "syscall" - -func setIPv4MulticastInterface(fd *netFD, ifi *Interface) error { - return syscall.ENOPROTOOPT -} - -func setIPv4MulticastLoopback(fd *netFD, v bool) error { - return syscall.ENOPROTOOPT -} |