The ioctl system call.
authorThadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Tue, 1 Dec 2009 10:52:22 +0000 (08:52 -0200)
committerThadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Tue, 1 Dec 2009 10:52:22 +0000 (08:52 -0200)
_ldd.xml

index f5a8bff..fbc7570 100644 (file)
--- a/_ldd.xml
+++ b/_ldd.xml
@@ -167,4 +167,27 @@ lseek (fd, 0, SEEK\_END);
 </para>
 </foil>
 
+<foil>
+<title>ioctl</title>
+<para>
+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.
+</para>
+<para>
+int ioctl (int fd, int request, char *arg);
+</para>
+<para>
+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.
+</para>
+<para>
+Example:
+</para>
+<para>
+struct ifreq req; ioctl (fd, SIOCGIFFLAGS, \&#38;req);
+</para>
+</foil>
+
 </slides>