• Matthew Wilcox's avatar
    [PATCH] use size_t for the broken ioctl numbers · 015e32c1
    Matthew Wilcox authored
    The ioctl number-generating macros should be used like
    
    	#define XXXX _IOR(n,x,type-of-arg)
    
    which generates an ioctl number that has the size of the argument
    encoded within it.  But there are a number of ioctl #defines that look
    like
    
    	#define XXXX _IOR(n,x,sizeof(type-of-arg))
    
    which is very wrong: the _IO/_IOR/_IOW/_IOWR macros will do the sizeof()
    on the argtype themselves, so the end result is that we will be doing a
    sizeof(sizeof(argtype)), ie a sizeof(size_t).
    
    In other words, the argtype didn't matter at all, and ended up totally
    pointless.
    
    Clearly it's too late to change the ioctl definitions, but we can at
    least stop people from copying them and making the same mistake.
    015e32c1
ioctl-number.txt 6.97 KB