One cannot #include <sys/sysctl.h> before <sys/sysinfo.h> on Linux because <sys/sysctl.h> in glibc-2.3.2 #defines _LINUX_KERNEL_H which causes the inclusion of <sys/sysinfo.h> to be skipped. The following program demonstrates: #include <sys/sysctl.h> #include <sys/sysinfo.h> int main(int argc, char* argv[]) { struct sysinfo si; sysinfo(&si); return 0; } }
Fix commited to glibc CVS on 2004-04-29.