github.com/oweisse/u-root@v0.0.0-20181109060735-d005ad25fef1/cmds/elvish/sys/ioctl.go (about) 1 // +build !windows,!plan9 2 3 package sys 4 5 import ( 6 "os" 7 8 "golang.org/x/sys/unix" 9 ) 10 11 // Ioctl wraps the ioctl syscall. 12 func Ioctl(fd int, req uintptr, arg uintptr) error { 13 _, _, e := unix.Syscall( 14 unix.SYS_IOCTL, uintptr(fd), req, arg) 15 if e != 0 { 16 return os.NewSyscallError("ioctl", e) 17 } 18 return nil 19 }