The stat(2) man page says: SYNOPSIS #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> int stat(const char *pathname, struct stat *statbuf); int fstat(int fd, struct stat *statbuf); int lstat(const char *pathname, struct stat *statbuf); But I don't see anything there that would require <unistd.h>. POSIX doesn't require it (and since POSIX.1-2001 no longer requires <sys/types.h>, saying "Although <sys/types.h> was required for conforming implementations of previous POSIX specifications, it was not required for UNIX applications.") Is the inclusion of <unistd.h> there a mistake? I've been trying to track down why a libstdc++ header includes <unistd.h> for no apparent reason, and my best guess is that it's a result of this man page saying to do it.