3 ms·
>"In computing, ioctl (an abbreviation of input/output control) is a system call for device-specific input/output operations and other operations which cannot b
by peter_d_sherman 6y ago
>"In computing, ioctl (an abbreviation of input/output control) is a system call for device-specific input/output operations and other operations which cannot be expressed by regular system calls. It takes a parameter specifying a request code; the effect of a call depends completely on the request code. Request codes are often device-specific. For instance, a CD-ROM device driver which can instruct a physical device to eject a disc would provide an ioctl request code to do that. Device-independent request codes are sometimes used to give userspace access to kernel functions which are only used by core system software or still under development.
The ioctl system call first appeared in Version 7 of Unix under that name. It is supported by most Unix and Unix-like systems, including Linux and macOS, though the available request codes differ from system to system. Microsoft Windows provides a similar function, named "DeviceIoControl()", in its Win32 API."
PDS: Observation: ioctl() -- and its relatives on other OS's such as DeviceIoControl() -- in effect provide a secondary API/syscall interface -- on top of the existing API/syscall interface...
A meta-API, or meta-syscall interface, if you will...
[...]
>"Other vectored call interfaces
Devices and kernel extensions may be linked to userspace using additional new system calls, although this approach is rarely taken, because operating system developers try to keep the system call interface focused and efficient.
On Unix operating systems, two other vectored call interfaces are popular: the fcntl() ("file control") system call configures open files, and is used in situations such as enabling non-blocking I/O; and the setsockopt() ("set socket option") system call configures open network sockets..."
Related: CPU Model-Specific Registers; i.e., 'rdmsr' / 'wrmsr' instructions on x86; for more information see:
https://en.wikipedia.org/wiki/Model-specific_register https://en.wikipedia.org/wiki/Model-specific_register or Google 'rdmsr' / 'wrmsr'...
But all of these things -- are sort of like API's on top of other API's... "meta-API's" or "meta-syscalls" (for lack of a better term) -- if you think about it...