elvish/sys/ioctl.go

18 lines
288 B
Go
Raw Normal View History

2015-02-26 23:58:24 +08:00
package sys
2014-09-28 00:17:55 +08:00
import "C"
import (
"os"
"syscall"
)
2015-02-25 05:56:38 +08:00
// 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)
}
2014-01-31 19:18:10 +08:00
return nil
}