On 02.04.2020 04:06, Mouse wrote: >> We should maintain a contract that all new ioctl operations are >> system wide unique. > > That is, unfortunately, unenforceable in the presence of a user base > that writes and shares code. If I #define IOCNEWTHING _IO('?',7) and > someone else #defines IOCOTHERTHING _IO('?',7), there really isn't any > way to prevent that, nor to prevent them from conflicting when - and > eventually it will happen - someone wants to run a system with both new > thing and other thing. >
This is partially enforceable. As once we generate catchall switch like: case FOO_OP: ... case BAR_OP: ... a compiler will report error whenever FOO_OP = BAR_OP.