Portability of O_NONBLOCK was done wrong.