elvish/sys/ioctl.go
2015-02-26 16:58:24 +01:00

18 lines
288 B
Go

package sys
import "C"
import (
"os"
"syscall"
)
// Ioctl wraps the ioctl syscall.
func Ioctl(fd int, req int, arg uintptr) error {
_, _, e := syscall.Syscall(
syscall.SYS_IOCTL, uintptr(fd), uintptr(req), arg)
if e != 0 {
return os.NewSyscallError("ioctl", e)
}
return nil
}