Friday 25 November 2016

IOCTLs

So you know how Linux is a programmer's operating system? No? Really? Don't worry, even I have my doubts. But the doubts are almost entirely on my qualifications as a programmer and not on Linux' services to me.
Anyway, when using an operating system and I mean actually using it for anything other than web browsing and movies, one often requires to be able to send commands to the very core of the operating system i.e. the kernel. Such commands are called System calls.
In Linux, there are about 300 to 400 different kinds of system calls. One such system call kinds are the IOCTLs.
An IOCTL stands for Input Output Control. Not so fancy right? So far so good. Now IOCTLs aren't your ordinary system calls that generally concern with the user wanting to do cool stuff from their application point of view. These are device specific.
Linux supports more number of devices than any other OS kernel. It makes sense since it is the most widely used kernel architecture. As such you expect there to be an enormous variety in the number of unique functions this plethora of supported devices will offer to the user. And obviously their can't be a system call made specially for each one of these enormous number of unique actions. So instead there exist IOCTLs.
So to conclude, IOCTLs are device-specific system calls that are there to extend to the user, the unique functionality a device has to offer.

No comments:

Post a Comment