ioctl is a system call; why the funny name ioctl? It's an abbreviation for input-output control. While the read and write system calls (among others) are used to effectively transfer data from and to a device (or file; remember the UNIX paradigm if it's not a process, it's a file!), the ioctl system call is used to issue commands to the device (via its driver). For example, changing a console device's terminal characteristics, writing a track to a disk when formatting it, sending a control command to a stepper motor, controlling a camera or audio device, and so on, are all instances of commands being sent to a device.
Let's consider a fictitious example. We have a device and are developing a (character) device driver for it. The device has various registers, small – typically 8-, 16-, or 32-bit pieces of hardware memory on the device – some of which are control registers. By appropriately...