From bf0e24d8659e732694493d863b2c73cfcecf8bab Mon Sep 17 00:00:00 2001 From: Thadeu Lima de Souza Cascardo Date: Tue, 1 Dec 2009 08:52:22 -0200 Subject: [PATCH] The ioctl system call. --- _ldd.xml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) 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); + + + -- 2.20.1