|
@@ -232,7 +232,18 @@ rt_sigprocmask :: proc "contextless" (mask_kind: Sig_Mask_Kind, new_set: ^Sig_Se
|
|
return Errno(-ret)
|
|
return Errno(-ret)
|
|
}
|
|
}
|
|
|
|
|
|
-// TODO(flysand): ioctl
|
|
|
|
|
|
+/*
|
|
|
|
+ Control devices. The ioctl syscall is a bit special because
|
|
|
|
+ its argument is usually a pointer to some driver-specific structure.
|
|
|
|
+ The request value is device-specific. Consult your LibC implementation's
|
|
|
|
+ ioctls.h file to learn more. The returned value of ioctl *may* be an error
|
|
|
|
+ code value instead of a memory address depending on the request type.
|
|
|
|
+ Available since Linux 1.0.
|
|
|
|
+*/
|
|
|
|
+ioctl :: proc "contextless" (fd: Fd, request: u32, arg: uintptr) -> (uintptr) {
|
|
|
|
+ ret := syscall(SYS_ioctl, fd, request, arg)
|
|
|
|
+ return uintptr(ret)
|
|
|
|
+}
|
|
|
|
|
|
/*
|
|
/*
|
|
Read the file at a specified offset.
|
|
Read the file at a specified offset.
|