Included unistd.h for compilation on OS X