Both. This is not a compat issue.
I'm suggesting that you set the condition codes based upon whether
there is an error or not. That is the critical thing x86 doesn't do
that all the other platforms do.
x86 relies on interpretation of purely the integer returned from the
system call to userspace, and that means a certain chunk of the return
value space can never represent valid values.
If you use the condition codes to signal "the return value is an
error" you don't have these problems.
--