mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-13 18:07:51 +08:00
6331c1515b
Signed-off-by: Shengjing Zhu <i@zhsj.me>
20 lines
308 B
Go
20 lines
308 B
Go
// +build !windows,!plan9
|
|
|
|
package sys
|
|
|
|
import (
|
|
"os"
|
|
|
|
"golang.org/x/sys/unix"
|
|
)
|
|
|
|
// Ioctl wraps the ioctl syscall.
|
|
func Ioctl(fd int, req uintptr, arg uintptr) error {
|
|
_, _, e := unix.Syscall(
|
|
unix.SYS_IOCTL, uintptr(fd), req, arg)
|
|
if e != 0 {
|
|
return os.NewSyscallError("ioctl", e)
|
|
}
|
|
return nil
|
|
}
|