On Mon, Jan 31, 2022 at 5:30 PM Matthew Wilcox <willy@xxxxxxxxxxxxx> wrote: > > It's probably worth reading this part of POSIX: > > : Implementations may support additional errors not included in this list, > : may generate errors included in this list under circumstances other > : than those described here, or may contain extensions or limitations that > : prevent some errors from occurring. > : > So while it's worth adding EINTR to the man page, I don't think it's > worth going through an exercise of trying to add every possible > errno to every syscall. > It's true that POSIX's error list is purely a guideline. But that doesn't mean Linux can't specify the precise set of possible error codes. There are currently 133 error codes defined, across an equally large number of syscalls - coding defensively and handling every combination is impossible. Not to mention that the meaning of the error codes differs from syscall to syscall. But with precise information there are likely only 5-10 codes per syscall, so handling every error appropriately is feasible. So the information can be quite useful. I agree the lists would be too much work to create / maintain by hand. What about a static analysis script that walks through the call tree and collects the set of possible error codes for each syscall? Dan Carpenter, is this something Smatch could do? -- Mathnerd314