giampaolo / psutil

Cross-platform lib for process and system monitoring in Python
BSD 3-Clause "New" or "Revised" License
10.08k stars 1.37k forks source link

[CentOS 5] ethtool.h : error: unknown type name '__u32' #2371

Closed lmunch closed 3 months ago

lmunch commented 5 months ago

Summary

Description

gcc-4.9 -std=gnu11 -pthread -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O3 -Wall -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=597 -DPy_LIMITED_API=0x03060000 -DPSUTIL_ETHTOOL_MISSING_TYPES=1 -DPSUTIL_LINUX=1 -I/opt/python3/include/python3.12 -c psutil/_psutil_linux.c -o build/temp.linux-x86_64-cpython-312/psutil/_psutil_linux.o In file included from psutil/_psutil_linux.c:13:0: /usr/include/linux/ethtool.h:18:2: error: unknown type name 'u32' u32 cmd; ^ /usr/include/linux/ethtool.h:19:2: error: unknown type name 'u32' u32 supported; / Features this interface supports / ^ /usr/include/linux/ethtool.h:20:2: error: unknown type name 'u32' u32 advertising; / Features this interface advertises /

This commit broke build on CentOS 5: a7205fc9d77b13a161da1502bd0988db8b9b5971

linux/ethtool.h is included in psutil/_psutil_linux.c but without defining the types first as in psutil/arch/linux/net.c:

// see: https://github.com/giampaolo/psutil/issues/659

ifdef PSUTIL_ETHTOOL_MISSING_TYPES

#include <linux/types.h>
typedef __u64 u64;
typedef __u32 u32;
typedef __u16 u16;
typedef __u8 u8;

endif

giampaolo commented 3 months ago

According to wikipedia https://en.wikipedia.org/wiki/CentOS CentOS 5 was released in 2007 (!) and support ended on 2017. Too old. :)

Closing as won't fix.