Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build on NetBSD. #2241

Merged
merged 1 commit into from
Apr 19, 2023
Merged

Fix build on NetBSD. #2241

merged 1 commit into from
Apr 19, 2023

Conversation

0-wiz-0
Copy link
Contributor

@0-wiz-0 0-wiz-0 commented Apr 18, 2023

On NetBSD 10.99.3/amd64 I saw:

psutil/arch/netbsd/cpu.c: In function 'psutil_per_cpu_times':
psutil/arch/netbsd/cpu.c:68:23: error: 'CPUSTATES' undeclared (first use in this function)
68 | uint64_t cpu_time[CPUSTATES];
| ^~~~~~~~~
psutil/arch/netbsd/cpu.c:68:23: note: each undeclared identifier is reported only once for each function it appears in
psutil/arch/netbsd/cpu.c:83:30: error: 'CP_USER' undeclared (first use in this function); did you mean 'T_USER'?
83 | (double)cpu_time[CP_USER] / CLOCKS_PER_SEC,
| ^~~~~~~
| T_USER
psutil/arch/netbsd/cpu.c:84:30: error: 'CP_NICE' undeclared (first use in this function)
84 | (double)cpu_time[CP_NICE] / CLOCKS_PER_SEC,
| ^~~~~~~
psutil/arch/netbsd/cpu.c:85:30: error: 'CP_SYS' undeclared (first use in this function)
85 | (double)cpu_time[CP_SYS] / CLOCKS_PER_SEC,
| ^~~~~~
psutil/arch/netbsd/cpu.c:86:30: error: 'CP_IDLE' undeclared (first use in this function); did you mean 'LW_IDLE'?
86 | (double)cpu_time[CP_IDLE] / CLOCKS_PER_SEC,
| ^~~~~~~
| LW_IDLE
psutil/arch/netbsd/cpu.c:87:30: error: 'CP_INTR' undeclared (first use in this function); did you mean 'LP_INTR'?
87 | (double)cpu_time[CP_INTR] / CLOCKS_PER_SEC
| ^~~~~~~
| LP_INTR

Adding this header fixes it.

@giampaolo giampaolo merged commit 968e4bb into giampaolo:master Apr 19, 2023
giampaolo added a commit that referenced this pull request Apr 19, 2023
ddelange added a commit to ddelange/psutil that referenced this pull request Apr 21, 2023
* 'master' of https://github.com/giampaolo/psutil: (22 commits)
  use glob.glob() in setup.py
  OSX / refact: get rid of process_info.c (giampaolo#2243)
  OSX C refact: reconstruct _psutil_osx.c to preserve history
  OSX: rename psutil/_psutil_osx.c to arch/osx/proc.c to preserve GIT history
  OSX big C refactoring (giampaolo#2242)
  fix failing users() test; update HISTORY; give CREDITS to @0-wiz-0 for giampaolo#2241
  win C refact: reconstruct _psutil_windows.c trying to preserve history
  rename _psutil_windows.c -> proc.c
  Win, C, refact: move proc funcs into proc.c file
  BSD big refact: move proc funcs in new proc.c file
  Fix build on NetBSD due to missing .h include. (giampaolo#2241)
  Win, C, refact: move boot_time() and users() in new sys.c
  Windows / refact: new sensors.c file
  C refact: remove useless cmdline / cwd / environ layers. Call direct functions
  pre release
  Add CI testing for OpenBSD and NetBSD (giampaolo#2240)
  Fix giampaolo#2239 / proc name(): don't fail with ZombieProcess on cmdline()
  giampaolo#2238: passed wrong value to Py_BuildValue
  fix giampaolo#2238 if cwd() cannot be determined always return "" instead of None
  Fix giampaolo#2237, OpenBSD, cwd(): return None instead of FileNotFoundError
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants