There is no installing Linux libraries in the BSD here; this file is in the GNU C library's contents/compiler. This is a set of constants on the sticky bit permissions management. Most likely what is happening is that on Linux the file is #included by some other #include file. To see if this is the case do the following. In the code (the file you mentioned that uses the constant) put this: #ifdef _SYS_STAT_H # warning "My missing file has already been included" #endif Here is how to fix your code to compile properly. In the place where this file is included, use this: #ifdef __USE_BSD # include <sys/stat.h> #endif You are done.