mirror_iproute2/devlink
Baruch Siach d0272f5404 devlink: fix libc and kernel headers collision
Since commit 2f1242efe9 ("devlink: Add devlink health show command") we
use the sys/sysinfo.h header for the sysinfo(2) system call. But since
iproute2 carries a local version of the kernel struct sysinfo, this
causes a collision with libc that do not rely on kernel defined sysinfo
like musl libc:

In file included from devlink.c:25:0:
.../sysroot/usr/include/sys/sysinfo.h:10:8: error: redefinition of 'struct sysinfo'
 struct sysinfo {
        ^~~~~~~
In file included from ../include/uapi/linux/kernel.h:5:0,
                 from ../include/uapi/linux/netlink.h:5,
                 from ../include/uapi/linux/genetlink.h:6,
                 from devlink.c:21:
../include/uapi/linux/sysinfo.h:8:8: note: originally defined here
 struct sysinfo {
        ^~~~~~~

Move the sys/sysinfo.h userspace header before kernel headers, and
suppress the indirect include of linux/sysinfo.h.

Cc: Aya Levin <ayal@mellanox.com>
Cc: Moshe Shemesh <moshe@mellanox.com>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2019-06-28 15:20:00 -07:00
..
.gitignore devlink: ignore build result 2016-04-11 13:35:12 -07:00
devlink.c devlink: fix libc and kernel headers collision 2019-06-28 15:20:00 -07:00
Makefile iproute2: Installation errors without libmnl 2018-12-04 14:27:08 -08:00
mnlg.c devlink: mnlg: Catch returned error value of dumpit commands 2019-06-12 08:43:14 -07:00
mnlg.h add devlink tool 2016-03-27 10:57:15 -07:00