> Every system call that I'm aware of either has a special return value which
> indicates whether it failed (which is usually -1), or modifies an argument
> appropriately, or has some other kind of indication of failure. Even
> exec(2), which shouldn't return *at all* unless there was a failure, makes
> a point of returning -1. What exceptions do you know of?
One I'm aware of is the BSD getpriority(2) which returns a value which
can legitimately be -1 on a successful return.
Anyhow, this is mooted by the ANSI C standard [ANSI X3.159-1989 if you
want to be really picky; I don't have a more recent standard at hand]:
quoting from the 1989 version of the ansi c spec:
4.1.3 Errors <errno.h>
The header <errno.h> defines several macros ...
which expands to a modifiable lvalue that has type int
 the macro errno need not be the identifier of an object; It might
expand to a modifiable lvalue resulting from a function call (for
example, *errno() ).