next up previous
Next: Example client calls and Up: Writing ioctl Callbacks Previous: Writing ioctl Callbacks

Using macros to generate ioctl command numbers

The Linux header file /usr/include/asm/ioctl.h defines macros that must be used to create the ioctl command number. These macros take various combinations of three arguments:

The macros used to generate command numbers are:


\begin{Program}
% latex2html id marker 567\listinginput[5]{1}{ioctl.h.example}...
...sing the {\tt \_IO} macros to generate {\tt ioctl}
command numbers}\end{Program}

Program 6 is an example header file showing the use of these macros. In real programs, the client executing an ioctl and the driver that services it must share the same header file.


next up previous
Next: Example client calls and Up: Writing ioctl Callbacks Previous: Writing ioctl Callbacks
Jeremy Elson 2003-08-20