added inclusion of unistd.h for compilation on Mac OS X 10.9