Device Driver Tutorial

Exit Print View

Updated: July 2014
 
 

Devices as Files

In UNIX, almost everything can be treated as a file. UNIX user applications access devices as if the devices were files. Files that represent devices are called special files or device nodes. Device special files are divided into two classes: block devices and character devices. See Character and Block Devices for more information.

Every I/O service request initially refers to a named file. Most I/O operations that read or write data perform equally well on ordinary or special files. For example, the same read(2) system call reads bytes from a file created with a text editor and reads bytes from a terminal device.

Control signals also are handled as files. Use the ioctl(9E) function to manipulate control signals.