mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-12 17:27:50 +08:00
18 lines
288 B
Go
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
|
|
}
|