Skip to content

Commit

Permalink
Handling broken musl toolchains that redefine sysinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
wberube committed Aug 27, 2024
1 parent 8ffa510 commit 286a052
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/region.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
#include <unistd.h>
#include <time.h>

#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0)
// Newer versions of musl have UAPI headers
// that redefine struct sysinfo
#if defined(__GLIBC__) || defined(__UCLIBC__) \
|| LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0)
#include <sys/sysinfo.h>
#else
#include <linux/sysinfo.h>
Expand Down
5 changes: 4 additions & 1 deletion src/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@
#include <time.h>
#include <unistd.h>

#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0)
// Newer versions of musl have UAPI headers
// that redefine struct sysinfo
#if defined(__GLIBC__) || defined(__UCLIBC__) \
|| LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0)
#include <sys/sysinfo.h>
#else
#include <linux/sysinfo.h>
Expand Down

0 comments on commit 286a052

Please sign in to comment.