Online Documentation Server
 ПОИСК
ods.com.ua Web
 КАТЕГОРИИ
Home
Programming
Net technology
Unixes
Security
RFC, HOWTO
Web technology
Data bases
Other docs

 


 ПОДПИСКА

 О КОПИРАЙТАХ
Вся предоставленная на этом сервере информация собрана нами из разных источников. Если Вам кажется, что публикация каких-то документов нарушает чьи-либо авторские права, сообщите нам об этом.




next up previous contents
Next: 6 Linux Interprocess Communications Up: e Previous: 4 System calls

5 The ``swiss army knife'' ioctl

ioctl stands for input/output control and is used to manipulate a character device via a filedescriptor. The format of ioctl is
ioctl(unsigned int fd, unsigned int request, unsigned long argument).
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.

%


Converted on:
Fri Mar 29 14:43:04 EST 1996


With any suggestions or questions please feel free to contact us