elvish/sys/ioctl.go
zhsj 3f73d8474b Use golang.org/x/sys in sys package (#477)
Signed-off-by: Shengjing Zhu <i@zhsj.me>
2017-09-30 20:40:38 +08:00

18 lines
286 B
Go

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