Linux Poetry
{tags: unix programming }
prev | next

<sys/errno.h>
UNIX functions do not return exceptions,
instead they set a global symbol: errno,
a symbol which expands to an integer,
an integer which is an error code.

sys/errno.h is a map,
revealing the gaffe which each code implies,
1: "Operation not permitted",
2: "No such file or directory."

Worry not weary traveller,
there are guides who will show you the way,
perror, strerror, err, ....
but beware.

#include <stdio.h>
#include <sys/errno.h>
int main() {
errno = EOWNERDEAD /* 105 */;
perror("Last Error");
}
>> "Last Error: Previous owner died."
04-23-2014 , rss feed license