Description
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (go version
)?
go 1.8, master
What operating system and processor architecture are you using (go env
)?
Ubuntu and RH ppc64le and ppc64
What did you do?
Tried to use ioctl syscall with TCGETS on ppc64le.
What did you expect to see?
Valid result.
What did you see instead?
Error message: inappropriate ioctl for device
This error occurs when using the syscall package but works when using golang.org/x/sys/unix due to the fact that these two packages define different values for TCGETS and TCSETS:
In golang syscall package, ztypes_linux_ppc64le.go and ztypes_linux_ppc64.go:
TCGETS = 0x403c7413
TCSETS = 0x803c7414
In golang.org/sys/unix/zerrors_linux_ppc64le.go and zerrors_linux_ppc64.go
TCGETS = 0x402c7413
TCSETS = 0x802c7414
I see there is a comment in the golang.org documentation about the use of the syscall package being "locked down". My assumption is that the syscall package should be fixed since it is now incorrect.
Testcase:
ioctlbug.go.txt
Failing execution:
Error on get: inappropriate ioctl for device
importing from golang.org/x/sys/unix allows the test to work.