Linux Blueprint for Programmers
English | 2017 | ASIN: B0744HT7G7 | 684 pages | AZW3 | 1.48 Mb
English | 2017 | ASIN: B0744HT7G7 | 684 pages | AZW3 | 1.48 Mb
The return value is -1 if an error occured and a value greater or equal than 0 if the request succeeded just like other system calls. The kernel distinguishes special and regular files. Special files are mainly found in /dev and /proc. They differ from regular files in that way that they hide an interface to a driver and not to a real (regular) file that contains text or binary data. This is the UNIX philosophy and allows to use normal read/write operations on every file. But if you need to do more with a special file or a regular file you can do it with … yes, ioctl. You more often need ioctl for special files than for regular files, but it’s possible to use ioctl on regular files as well.