diff --git a/libc-test/semver/openbsd.txt b/libc-test/semver/openbsd.txt index b92a8d1edaa6..ef9083d28a29 100644 --- a/libc-test/semver/openbsd.txt +++ b/libc-test/semver/openbsd.txt @@ -260,8 +260,35 @@ GLOB_NOMATCH GLOB_NOSORT GLOB_NOSPACE GLOB_NOSYS +HW_BATTERY +HW_BATTERY_CHARGEMODE +HW_BATTERY_CHARGESTART +HW_BATTERY_CHARGESTOP +HW_BYTEORDER +HW_CPUSPEED +HW_DISKCOUNT +HW_DISKNAMES +HW_DISKSTATS +HW_MACHINE +HW_MODEL HW_NCPU +HW_NCPUFOUND HW_NCPUONLINE +HW_PAGESIZE +HW_PERFPOLICY +HW_PHYSMEM +HW_PHYSMEM64 +HW_POWER +HW_PRODUCT +HW_SENSORS +HW_SERIALNO +HW_SETPERF +HW_UCOMNAMES +HW_USERMEM +HW_USERMEM64 +HW_UUID +HW_VENDOR +HW_VERSION IFF_ALLMULTI IFF_BROADCAST IFF_DEBUG diff --git a/src/new/mod.rs b/src/new/mod.rs index 13479209d23c..3d1da7107b5e 100644 --- a/src/new/mod.rs +++ b/src/new/mod.rs @@ -223,6 +223,7 @@ cfg_if! { pub use utmpx_::*; } else if #[cfg(target_os = "openbsd")] { pub use sys::ipc::*; + pub use sys::sysctl::*; } else if #[cfg(any(target_os = "nto", target_os = "qnx"))] { pub use net::bpf::*; pub use net::if_::*; diff --git a/src/new/openbsd/sys/mod.rs b/src/new/openbsd/sys/mod.rs index d72038e43878..94d4e8db38a2 100644 --- a/src/new/openbsd/sys/mod.rs +++ b/src/new/openbsd/sys/mod.rs @@ -3,3 +3,4 @@ //! pub(crate) mod ipc; +pub(crate) mod sysctl; diff --git a/src/new/openbsd/sys/sysctl.rs b/src/new/openbsd/sys/sysctl.rs new file mode 100644 index 000000000000..f52fc26a2016 --- /dev/null +++ b/src/new/openbsd/sys/sysctl.rs @@ -0,0 +1,35 @@ +//! Header: `sys/sysctl.h` +//! +//! + +use crate::prelude::*; + +pub const HW_MACHINE: c_int = 1; +pub const HW_MODEL: c_int = 2; +pub const HW_BYTEORDER: c_int = 4; +pub const HW_PHYSMEM: c_int = 5; +pub const HW_USERMEM: c_int = 6; +pub const HW_PAGESIZE: c_int = 7; +pub const HW_DISKNAMES: c_int = 8; +pub const HW_DISKSTATS: c_int = 9; +pub const HW_DISKCOUNT: c_int = 10; +pub const HW_SENSORS: c_int = 11; +pub const HW_CPUSPEED: c_int = 12; +pub const HW_SETPERF: c_int = 13; +pub const HW_VENDOR: c_int = 14; +pub const HW_PRODUCT: c_int = 15; +pub const HW_VERSION: c_int = 16; +pub const HW_SERIALNO: c_int = 17; +pub const HW_UUID: c_int = 18; +pub const HW_PHYSMEM64: c_int = 19; +pub const HW_USERMEM64: c_int = 20; +pub const HW_NCPUFOUND: c_int = 21; +pub const HW_PERFPOLICY: c_int = 23; +pub const HW_NCPUONLINE: c_int = 25; +pub const HW_POWER: c_int = 26; +pub const HW_BATTERY: c_int = 27; +pub const HW_UCOMNAMES: c_int = 28; + +pub const HW_BATTERY_CHARGEMODE: c_int = 1; +pub const HW_BATTERY_CHARGESTART: c_int = 2; +pub const HW_BATTERY_CHARGESTOP: c_int = 3; diff --git a/src/unix/bsd/netbsdlike/openbsd/mod.rs b/src/unix/bsd/netbsdlike/openbsd/mod.rs index 4323ccda1872..67975d8af8af 100644 --- a/src/unix/bsd/netbsdlike/openbsd/mod.rs +++ b/src/unix/bsd/netbsdlike/openbsd/mod.rs @@ -1353,8 +1353,6 @@ pub const CTL_DDB: c_int = 9; pub const CTL_VFS: c_int = 10; pub const CTL_MAXID: c_int = 11; -pub const HW_NCPUONLINE: c_int = 25; - pub const KERN_OSTYPE: c_int = 1; pub const KERN_OSRELEASE: c_int = 2; pub const KERN_OSREV: c_int = 3;