Posix error codes and handy functions for using them.
Error codes taken from http://fxr.watson.org/fxr/source/sys/errno.h