From: Matt Layher Date: Mon, 9 Aug 2021 21:12:37 +0000 (-0400) Subject: internal/syscall/unix: change Ioctl arg type to unsafe.Pointer on AIX X-Git-Tag: go1.18beta1~1769 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=a0adf91d85;p=gostls13.git internal/syscall/unix: change Ioctl arg type to unsafe.Pointer on AIX Without this change, this code is technically in violation of the unsafe.Pointer rules since the conversion from unsafe.Pointer to uintptr has to happen when calling into the syscall6 assembly implementation. Change-Id: I4821f5bf9788c8fa2efeb041f811ed092e07ae74 Reviewed-on: https://go-review.googlesource.com/c/go/+/340949 Trust: Matt Layher Run-TryBot: Ian Lance Taylor TryBot-Result: Go Bot Reviewed-by: Ian Lance Taylor --- diff --git a/src/internal/syscall/unix/ioctl_aix.go b/src/internal/syscall/unix/ioctl_aix.go index 19d56c36a1..d361533b5c 100644 --- a/src/internal/syscall/unix/ioctl_aix.go +++ b/src/internal/syscall/unix/ioctl_aix.go @@ -16,7 +16,7 @@ var libc_ioctl uintptr // Implemented in syscall/syscall_aix.go. func syscall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) -func Ioctl(fd int, cmd int, args uintptr) (err error) { +func Ioctl(fd int, cmd int, args unsafe.Pointer) (err error) { _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_ioctl)), 3, uintptr(fd), uintptr(cmd), uintptr(args), 0, 0, 0) if e1 != 0 { err = e1 diff --git a/src/net/interface_aix.go b/src/net/interface_aix.go index 49f78c2abb..7ad45d1175 100644 --- a/src/net/interface_aix.go +++ b/src/net/interface_aix.go @@ -78,7 +78,7 @@ func interfaceTable(ifindex int) ([]Interface, error) { // Retrieve MTU ifr := &ifreq{} copy(ifr.Name[:], ifi.Name) - err = unix.Ioctl(sock, syscall.SIOCGIFMTU, uintptr(unsafe.Pointer(ifr))) + err = unix.Ioctl(sock, syscall.SIOCGIFMTU, unsafe.Pointer(ifr)) if err != nil { return nil, err }