Skip to content

Commit

Permalink
util/xdp_sample: remove <sys/sysinfo.h> for musl compatibility
Browse files Browse the repository at this point in the history
In the musl libc environment, `<sys/sysinfo.h>` also defines
the `sysinfo` struct, causing a redefinition conflict:

toolchain-x86_64_gcc-14.2.0_musl/include/linux/kernel.h:5,
                 from ../../headers/linux/hashtable.h:15,
                 from xdp_sample.c:33:
toolchain-x86_64_gcc-14.2.0_musl/include/linux/sysinfo.h:8:8: error: redefinition of 'struct sysinfo'
    8 | struct sysinfo {
      |        ^~~~~~~
In file included from xdp_sample.c:24:
toolchain-x86_64_gcc-14.2.0_musl/include/sys/sysinfo.h:10:8: note: originally defined here
   10 | struct sysinfo {
      |        ^~~~~~~

This commit removes the `<sys/sysinfo.h>` include. It seems that
none of its symbols are used in the xdp_sample code anyway.

Signed-off-by: Til Kaiser <[email protected]>
  • Loading branch information
tk154 authored and tohojo committed Oct 29, 2024
1 parent f8a65e8 commit 164c143
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion lib/util/xdp_sample.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include <arpa/inet.h>
#include <sys/ioctl.h>
#include <bpf/libbpf.h>
#include <sys/sysinfo.h>
#include <sys/timerfd.h>
#include <sys/utsname.h>
#include <linux/limits.h>
Expand Down

0 comments on commit 164c143

Please sign in to comment.