guard unistd.h behind __APPLE__