openbsd: add missing HW_* sysctl constants - #5371
Conversation
|
Do you really need all of these constants ? or it is just for completeness ? Additionallly, Thanks. |
|
The only one I personally needed was GuillaumeGomez/sysinfo#1318 for example needs several of these to gain support for OpenBSD. |
There was a problem hiding this comment.
Could you add these to src/new/openbsd/sys/sysctl.h instead? We're trying to slowly reorganize. (feel free to move the existing HW_NCPUONLINE as well)
Also I suppose this list should ideally be restricted a bit based on @semarie's concerns
|
Reminder, once the PR becomes ready for a review, use |
For what it's worth, I have no problem removing constants after a few releases if they are removed upstream. Or gating on the target_env version once we have that. With that in mind I don't think the situation should be too different than anything written in C out-of-tree? |
|
Moving to My use case was I need to write an OpenBSD fallback case for The Tor Project's Arti where we fetch the amount of system RAM using the sysinfo crate [1]. sysinfo doesn't support OpenBSD so I attempted to inline the libc calls myself but Not familiar with best practices on bindings so I don't know how to decide what should{, not} be added, my instinct was a complete list. |
|
From the list, it could make sense to have:
Thanks. |
This comment has been minimized.
This comment has been minimized.
Move OpenBSD HW_* sysctl constants into sys/sysctl.rs and add some missing definitions from sys/sysctl.h. Ref: https://github.com/openbsd/src/blob/544119925528153b873297bc630370abacfd5a7f/sys/sys/sysctl.h
|
@rustbot ready |
Adds missing
HW_*sysctl constants.The constants are defined in:
https://cvsweb.openbsd.org/annotate/src/sys/sys/sysctl.h
@rustbot label +stable-nominated