Modern g++ needs unistd.h to be #include'd explicitly.