Protect _IOC's 'len' and 'inout' parameters so that _IOC can be used in
more flexible ways.
This commit is contained in:
parent
0b25211b11
commit
7660701e51
@ -50,8 +50,8 @@
|
||||
#define IOC_INOUT (IOC_IN|IOC_OUT)
|
||||
#define IOC_DIRMASK (IOC_VOID|IOC_OUT|IOC_IN)
|
||||
|
||||
#define _IOC(inout,group,num,len) \
|
||||
((unsigned long)(inout | ((len & IOCPARM_MASK) << 16) | ((group) << 8) | (num)))
|
||||
#define _IOC(inout,group,num,len) ((unsigned long) \
|
||||
((inout) | (((len) & IOCPARM_MASK) << 16) | ((group) << 8) | (num)))
|
||||
#define _IO(g,n) _IOC(IOC_VOID, (g), (n), 0)
|
||||
#define _IOWINT(g,n) _IOC(IOC_VOID, (g), (n), sizeof(int))
|
||||
#define _IOR(g,n,t) _IOC(IOC_OUT, (g), (n), sizeof(t))
|
||||
|
Loading…
Reference in New Issue
Block a user