mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-14 11:17:52 +08:00
3f73d8474b
Signed-off-by: Shengjing Zhu <i@zhsj.me>
18 lines
286 B
Go
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
|
|
}
|