I was playing with ioctl
and this question occurred to me.
Background
- I was told that the primary motivation for system calls is that the number of interrupt handlers allowed is very limited. So many OSes implement the abstraction of system calls (a.k.a. traps), which occupies only one interrupt number (
0x80
in case of Linux), but accept extra arguments to deliver different functionalities on demand. - this thread suggests the the number of system calls is actually very limited too, so the same reasoning above is applied again to invent
ioctl
.
Hence my question. Why don't OSes just offer enough system calls and get rid of ioctl
? (Or is it just merely to create a hierarchical structure to offer better scalability?)