I have the following Go code:
package main
import (
"syscall"
)
func main() {
_ = syscall.SYS_IOCTL // Assign to _ to avoid compiler error
}
This compiles fine for Linux, but fails to compile for Solaris:
$ GOOS=linux GOARCH=amd64 go build $ GOOS=solaris GOARCH=amd64 go build # ioctl-experimentation ./main.go:8:14: undefined: syscall.SYS_IOCTL
The ioctl
function is a POSIX function, so I would expect to find it defined for all Unixes. Also, ioctl
appears in section 2 of Solaris 11's man pages, and section 2 of Solaris 11's man pages is for system calls.
Why is syscall.SYS_IOCTL
defined for Linux but undefined for Solaris?