From: Thadeu Lima de Souza Cascardo Date: Tue, 1 Dec 2009 10:52:22 +0000 (-0200) Subject: The ioctl system call. X-Git-Url: http://git.cascardo.eti.br/?p=cascardo%2Fkernel%2Fold_slides%2F.git;a=commitdiff_plain;h=bf0e24d8659e732694493d863b2c73cfcecf8bab The ioctl system call. --- diff --git a/_ldd.xml b/_ldd.xml index f5a8bff..fbc7570 100644 --- a/_ldd.xml +++ b/_ldd.xml @@ -167,4 +167,27 @@ lseek (fd, 0, SEEK\_END); + +ioctl + +The ioctl system call is a catch-all operation. For those operations +which doesn't fit in the read/write model, the ioctl allows the user to +send a command with an optional argument to the device. This command may +accept input or generate output. + + +int ioctl (int fd, int request, char *arg); + + +The last argument is optional and depends on the type of request. Every +device or device class may have its different set of ioctl's. + + +Example: + + +struct ifreq req; ioctl (fd, SIOCGIFFLAGS, \&req); + + +