I\'m trying to understand what category I should use, when calling a C function that sets errno on Linux.
errno
I\'m not sure all the possible error codes are
This is a bug recently fixed in latest GCC 6, 7 and 8 point releases. It'll work as you expect if you're on the latest point release. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60555.