|
|
@@ -352,6 +352,45 @@ func Llistxattr(link string, dest []byte) (sz int, err error) {
|
|
|
return s, e
|
|
|
}
|
|
|
|
|
|
+//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
|
|
|
*/
|