Search code examples
linux-kernelkernelioctl

How mandatory are the asm/ioctl.h macros for generating ioctl numbers?


I'm looking around, and I'm noticing that there are some drivers that declare their ioctl numbers using the _IO _IOR _IOW _IORW macros, and some declare them manually using #defines. Documentation indicates that I must use those macros, but now I'm confused.


Solution

  • According to Rubini's book, the macro's are there not to let different drivers to have same numbers and not to cause people do completely different things with same numbers on different nodes. What I understand is they are recommended to be good practice.