Closed hroncok closed 1 year ago
Can you paste the compilation error? We don't use those functions in _psutil_linux.c
, but perhaps we do in arch/linux/*.c
files, so that should be added to those files, not _psutil_linux.c
(and perhaps other files in arch/{OS}/*.c
).
Ah, sorry, should have pasted that in the first place:
Those were the errors I started with in 5.9.6:
psutil/_psutil_linux.c: In function ‘ioprio_get’:
psutil/_psutil_linux.c:73:12: error: implicit declaration of function ‘syscall’ [-Werror=implicit-function-declaration]
73 | return syscall(__NR_ioprio_get, which, who);
| ^~~~~~~
psutil/_psutil_linux.c: In function ‘psutil_net_if_duplex_speed’:
psutil/_psutil_linux.c:488:5: error: implicit declaration of function ‘close’; did you mean ‘clone’? [-Werror=implicit-function-declaration]
488 | close(sock);
| ^~~~~
| clone
Then I checked on the master branch and haven't noticed the error is a tad different:
psutil/arch/linux/net.c: In function ‘psutil_net_if_duplex_speed’:
psutil/arch/linux/net.c:112:5: error: implicit declaration of function ‘close’; did you mean ‘pclose’? [-Werror=implicit-function-declaration]
112 | close(sock);
| ^~~~~
| pclose
Will move the include to psutil/arch/linux/net.c
and amend the commit message.
And the other one is:
psutil/arch/linux/proc.c: In function ‘ioprio_get’:
psutil/arch/linux/proc.c:22:12: error: implicit declaration of function ‘syscall’ [-Werror=implicit-function-declaration]
22 | return syscall(__NR_ioprio_get, which, who);
| ^~~~~~~
While you're at it, can you also update these guys?
psutil/arch/solaris/environ.c
psutil/_psutil_sunos.c
Done.
Thanks for merging.
Summary
-Werror=implicit-function-declaration
Description
See https://docs.python.org/3.13/whatsnew/3.13.html