pathnames.h, use O_NONBLOCK, extra error checking, cleanups