|
@@ -107,6 +107,45 @@ func setattrlistTimes(path string, times []Timespec, flags int) error {
|
|
|
return ENOSYS
|
|
return ENOSYS
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+//sys ioctl(fd int, req uint, arg uintptr) (err error)
|
|
|
|
|
+
|
|
|
|
|
+// ioctl itself should not be exposed directly, but additional get/set
|
|
|
|
|
+// functions for specific types are permissible.
|
|
|
|
|
+
|
|
|
|
|
+// IoctlSetInt performs an ioctl operation which sets an integer value
|
|
|
|
|
+// on fd, using the specified request number.
|
|
|
|
|
+func IoctlSetInt(fd int, req uint, value int) error {
|
|
|
|
|
+ return ioctl(fd, req, uintptr(value))
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+func IoctlSetWinsize(fd int, req uint, value *Winsize) error {
|
|
|
|
|
+ return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+func IoctlSetTermios(fd int, req uint, value *Termios) error {
|
|
|
|
|
+ return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// IoctlGetInt performs an ioctl operation which gets an integer value
|
|
|
|
|
+// from fd, using the specified request number.
|
|
|
|
|
+func IoctlGetInt(fd int, req uint) (int, error) {
|
|
|
|
|
+ var value int
|
|
|
|
|
+ err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
|
|
|
|
+ return value, err
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+func IoctlGetWinsize(fd int, req uint) (*Winsize, error) {
|
|
|
|
|
+ var value Winsize
|
|
|
|
|
+ err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
|
|
|
|
+ return &value, err
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+func IoctlGetTermios(fd int, req uint) (*Termios, error) {
|
|
|
|
|
+ var value Termios
|
|
|
|
|
+ err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
|
|
|
|
+ return &value, err
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
/*
|
|
/*
|
|
|
* Exposed directly
|
|
* Exposed directly
|
|
|
*/
|
|
*/
|
|
@@ -227,7 +266,6 @@ func setattrlistTimes(path string, times []Timespec, flags int) error {
|
|
|
// getresuid
|
|
// getresuid
|
|
|
// getrtable
|
|
// getrtable
|
|
|
// getthrid
|
|
// getthrid
|
|
|
-// ioctl
|
|
|
|
|
// ktrace
|
|
// ktrace
|
|
|
// lfs_bmapv
|
|
// lfs_bmapv
|
|
|
// lfs_markv
|
|
// lfs_markv
|