Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我环顾四周,我注意到有些驱动程序使用_IO _IOR _IOW _IORW宏声明其 ioctl 编号,而有些驱动程序使用#defines 手动声明它们。文档表明我必须使用这些宏,但现在我很困惑。
_IO _IOR _IOW _IORW
#define
根据 Rubini 的书,宏的存在是为了不让不同的驱动程序有相同的编号,也不会导致人们在不同的节点上用相同的编号做完全不同的事情。我的理解是它们被推荐为良好的做法。