diff options
| author | Baruch Siach <baruch@tkos.co.il> | 2017-02-16 19:07:19 +0200 |
|---|---|---|
| committer | Baruch Siach <baruch@tkos.co.il> | 2017-02-16 19:14:20 +0200 |
| commit | c414ecd9b9151b05542ead65da1e7bf20ee21861 (patch) | |
| tree | 338c18b041c3b9ff0733d6ea376f2b947975c406 /psutil/_psutil_linux.c | |
| parent | d964eeb6e85a98b3e27e16ecbf89cf06c37c06f1 (diff) | |
| download | psutil-c414ecd9b9151b05542ead65da1e7bf20ee21861.tar.gz | |
Fix build with musl libc
Suppress inclusion of linux/sysinfo.h to fix redefinition of struct sysinfo
that musl libc defines in sys/sysinfo.h, which least to the following build
failure (paths abbreviated):
In file included from .../usr/include/linux/kernel.h:4:0,
from .../usr/include/linux/ethtool.h:16,
from psutil/_psutil_linux.c:35:
.../usr/include/linux/sysinfo.h:7:8: error: redefinition of ‘struct sysinfo’
struct sysinfo {
^
In file included from psutil/_psutil_linux.c:21:0:
.../usr/include/sys/sysinfo.h:10:8: note: originally defined here
struct sysinfo {
^
Fixes #872
Diffstat (limited to 'psutil/_psutil_linux.c')
| -rw-r--r-- | psutil/_psutil_linux.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/psutil/_psutil_linux.c b/psutil/_psutil_linux.c index 4923ead6..0296dd54 100644 --- a/psutil/_psutil_linux.c +++ b/psutil/_psutil_linux.c @@ -32,6 +32,8 @@ typedef __u16 u16; typedef __u8 u8; #endif +/* Avoid redefinition of struct sysinfo with musl libc */ +#define _LINUX_SYSINFO_H #include <linux/ethtool.h> /* The minimum number of CPUs allocated in a cpu_set_t */ |
