At least for the INTERNAL_SYSCALL macro in glibc, the error check is:
#define INTERNAL_SYSCALL_ERROR_P(val, err) \
((unsigned int) (val) >= 0xfffff001u)
in sysdeps/unix/sysv/linux/i386/sysdep.h. Similarly the PSEUDO macro
in that file does a cmpl $-4095,%eax to test for error. (There is also
a PSEUDO_NOERRNO which doesn't test for error.)
So the convention on (32-bit) x86 is that -4095 .. -1 are error
values, and other values are successful return values.
Paul.
-