Add ioctl package

This commit is contained in:
Alex X
2025-03-20 20:11:40 +03:00
parent 2473eee66b
commit bad7caa187
6 changed files with 77 additions and 0 deletions

14
pkg/ioctl/ioctl_linux.go Normal file
View File

@@ -0,0 +1,14 @@
package ioctl
import (
"syscall"
"unsafe"
)
func Ioctl(fd int, req uint, arg unsafe.Pointer) error {
_, _, err := syscall.Syscall(syscall.SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg))
if err != 0 {
return err
}
return nil
}