geterrno() - gets system error number
geterrno() enables the programmer to find out exactly what the last failure was.
This is often necessary since some subroutines just indicate success or
failure, rather than directly return definitive error codes.
For example, comerr() uses geterrno() to retrieve the last error
so that an appropriate message can be printed.
Returns the error code for the last system error that occurred in the current
process, e.g., after a call to fileopen() failed.
comerr(3), comerrno(3), error(3), errmsg(3)
The value returned by geterrno() is only valid after the immediately preceding
system call failed.