[Linux] Build issue in 5.9.2/5.9.3. No speed_hi in struct ethtool_cmd
See original GitHub issueSummary
- OS: Linux CentOS 5
- Architecture: x86_64
- Psutil version: 5.9.2/5.9.3
- Python version: Custom build 3.11.0
- Type: build issue
Description
On CentOS 5 (yes, I know it’s old) ethtool.h does not have speed_hi in struct ethtool_cmd and it also does not have the inline function ethtool_cmd_speed.
On 5.9.2 I get:
gcc-4.8 -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=592 -DPSUTIL_LINUX=1 -DPSUTIL_ETHTOOL_MISSING_TYPES=1 -I/opt/python3/include/python3.11 -c psutil/_psutil_linux.c -o build/temp.linux-x86_64-cpython-311/psutil/_psutil_linux.o
psutil/_psutil_linux.c: In function ‘psutil_net_if_duplex_speed’:
psutil/_psutil_linux.c:444:9: warning: implicit declaration of function ‘ethtool_cmd_speed’ [-Wimplicit-function-declaration]
uint_speed = ethtool_cmd_speed(ðcmd);
^
On 5.9.3 I get:
3.11 -c psutil/_psutil_linux.c -o build/temp.linux-x86_64-cpython-311/psutil/_psutil_linux.o
psutil/_psutil_linux.c: In function ‘psutil_ethtool_cmd_speed’:
psutil/_psutil_linux.c:79:17: error: ‘const struct ethtool_cmd’ has no member named ‘speed_hi’
return (ecmd->speed_hi << 16) | ecmd->speed;
Version 5.9.1 is fine.
Thanks
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:10 (5 by maintainers)
Top Results From Across the Web
ethtool/ethtool_cmd.go at master · safchain/ethtool - GitHub
A simple ethtool "like" library for GO. Contribute to safchain/ethtool development by creating an account on GitHub.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Not bad. Most (all) of these are test adjustments which would need fixing on centos 5, but they don’t mean the underlying functionality is broken. CentOS 5 appears fully supported.
Ok, here we go. This is running in a CentOS 5 container: