missing_syscall: verify our fallback numbers when possible
Instead of defining the numbers only as fallback, always define our fallback number, and if we have the real __NR_foo define, assert that our number matches the real one. This will result in warnings when our fallback number is not defined, even if the kernel headers are new enough to define __NR_foo. This will probably annoy people compiling for seldom-used architectures, but hopefully it'll provide motivation to add the missing fallback defines. The upside is that we have a higher chance of catching the cases where we got the number wrong. Calling the wrong syscall is quite problematic, and with some back luck, it might take us a long time to notice that we got the number wrong on some rarely used architecture. Also, rework some of the fallback wrappers to not call the syscall with a negative number (that'd fail, but we'd got to the kernel and back). It seems nicer to let the compiler know that this can never succeed.
Loading
Please sign in to comment