79edab1ca20f06e92072a4b03fee0a08bb46d823
[external/busybox.git] / packaging / sysinfo-multiple-define-error-fix.patch
1 diff --git a/include/libbb.h b/include/libbb.h
2 index e2a8322..18bed75 100644
3 --- a/include/libbb.h
4 +++ b/include/libbb.h
5 @@ -104,6 +104,10 @@ char *dirname(char *path);
6  #endif
7  /* Include our own copy of struct sysinfo to avoid binary compatibility
8   * problems with Linux 2.4, which changed things.  Grumble, grumble. */
9 +/* kernel-header-3.x provide sysinfo struct. So then include header which kernel provide
10 + *     - walyong.cho <walyong.cho@samsung.com> */
11 +#include <linux/version.h>
12 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,0,0)
13  struct sysinfo {
14         long uptime;                    /* Seconds since boot */
15         unsigned long loads[3];         /* 1, 5, and 15 minute load averages */
16 @@ -120,6 +124,9 @@ struct sysinfo {
17         unsigned int mem_unit;          /* Memory unit size in bytes */
18         char _f[20 - 2 * sizeof(long) - sizeof(int)]; /* Padding: libc5 uses this.. */
19  };
20 +#else
21 +#include <sys/sysinfo.h>
22 +#endif
23  int sysinfo(struct sysinfo* info);
24  #ifndef PATH_MAX
25  # define PATH_MAX 256
26 -- 
27 1.7.9.5
28