Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
#ifdef HAVE_SYS_STATFS_H
# include <sys/statfs.h>
#endif
-/* struct sysinfo is linux-specific */
-#ifdef __linux__
-# include <sys/sysinfo.h>
-#endif
+/* Don't do this here:
+ * #include <sys/sysinfo.h>
+ * Some linux/ includes pull in conflicting definition
+ * of struct sysinfo (only in some toolchanins), which breaks build.
+ * Include sys/sysinfo.h only in those files which need it.
+ */
#if ENABLE_SELINUX
# include <selinux/selinux.h>
# include <selinux/context.h>
#include <paths.h>
#include <sys/resource.h>
#ifdef __linux__
-#include <linux/vt.h>
+# include <linux/vt.h>
+# include <sys/sysinfo.h>
#endif
#include "reboot.h" /* reboot() constants */
//usage: "Total: 386144 257128 129016\n"
#include "libbb.h"
+#ifdef __linux__
+# include <sys/sysinfo.h>
+#endif
struct globals {
unsigned mem_unit;
#if ENABLE_DESKTOP
+#ifdef __linux__
+# include <sys/sysinfo.h>
+#endif
#include <sys/times.h> /* for times() */
#ifndef AT_CLKTCK
# define AT_CLKTCK 17
//usage: " 1:55pm up 2:30, load average: 0.09, 0.04, 0.00\n"
#include "libbb.h"
+#ifdef __linux__
+# include <sys/sysinfo.h>
+#endif
+
#ifndef FSHIFT
# define FSHIFT 16 /* nr of bits of precision */