I was wondering if there was a macro that could assign my device a random 'magic' number that linux was currently not using. This is obviously in the interest of portability. Also if this is not possible, I would like to know where I can find out which magic numbers are not used. The text file I want to consult I believe is called ioctl-number.txt, but I could only find those files in the source tree I downloaded ... not the compiled kernel that I actually run. It would be interesting to find where those files may hide in the compiled version.
Thanks for any help!
Could you select an existing ioctl macro that your device driver does not (and will never) use, and assign its value to a macro for the ioctl you require?
I have a limited knowledge of how ioclt works with device drivers, so maybe this doesn't work.
Can you look at the source for another device driver that has custom ioctl values, and see how they've selected their numbers? Maybe there's a range that the OS doesn't use, so they're available for each device driver to interpret however it wishes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With