Function unix.IoctlSetPointerInt should be available on all supported UNIX like systems.
I've been contributing to the Elvish shell project and recently attempted to replace it's custom Ioctl() function (because it had no unit tests) with functionality provided by golang.org/x/sys. However, one of the ioctl's Elvish uses is unix.TIOCSPGRP which requires using unix.IoctlSetPointerInt(). That transformation works fine on Linux but fails to build on macOS and FreeBSD with "undefined: unix.IoctlSetPointerInt". This is because unix.IoctlSetPointerInt is only implemented in syscall_linux.go. -- something that is not obvious from looking at the public documentation. I can't see any reason why this particular function can't be implemented generically for every UNIX like OS.
Function
unix.IoctlSetPointerIntshould be available on all supported UNIX like systems.I've been contributing to the Elvish shell project and recently attempted to replace it's custom
Ioctl()function (because it had no unit tests) with functionality provided by golang.org/x/sys. However, one of the ioctl's Elvish uses isunix.TIOCSPGRPwhich requires usingunix.IoctlSetPointerInt(). That transformation works fine on Linux but fails to build on macOS and FreeBSD with "undefined: unix.IoctlSetPointerInt". This is becauseunix.IoctlSetPointerIntis only implemented in syscall_linux.go. -- something that is not obvious from looking at the public documentation. I can't see any reason why this particular function can't be implemented generically for every UNIX like OS.