Device Driver Tutorial

Reading the Device

When you access this qotd_3 device for reading, the command you use to access the device retrieves the data from the device node. The command then displays the data in the same way that the command displays any other input. To get the name of the device special file, look in the /devices directory:


% ls -l /devices/pseudo/qotd*
crw-------   1 root   sys   122,  0 date time /devices/pseudo/qotd_3@0:qotd_3

To read the qotd_3 device, you can use the cat(1) command:


# cat /devices/pseudo/qotd_3@0:qotd_3
On the whole, I'd rather be in Philadelphia. - W. C. Fields