Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions libc-test/build/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ fn test_openbsd(t: &Target) {
"sys/param.h",
"sys/auxv.h",
"paths.h",
"uvm/uvmexp.h",
);

cfg.rename_type(|ty| match ty {
Expand Down
15 changes: 15 additions & 0 deletions libc-test/semver/openbsd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1002,6 +1002,19 @@ UT_NAMESIZE
VDISCARD
VDSUSP
VLNEXT
VM_ANONMIN
VM_LOADAVG
VM_MALLOC_CONF
VM_MAXID
VM_MAXSLP
VM_METER
VM_NKMEMPAGES
VM_PSSTRINGS
VM_SWAPENCRYPT
VM_USPACE
VM_UVMEXP
VM_VNODEMIN
VM_VTEXTMIN
VREPRINT
VSTATUS
VWERASE
Expand Down Expand Up @@ -1154,6 +1167,7 @@ _SC_XOPEN_UNIX
_SC_XOPEN_UUCP
_SC_XOPEN_VERSION
__errno
_ps_strings
abs
accept4
acct
Expand Down Expand Up @@ -1464,6 +1478,7 @@ uselocale
utimensat
utmp
utrace
uvmexp
wait4
waitid
xucred
1 change: 1 addition & 0 deletions src/new/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ cfg_if! {
pub use sys::ipc::*;
pub use sys::sensors::*;
pub use sys::sysctl::*;
pub use uvm::uvmexp::*;
} else if #[cfg(any(target_os = "nto", target_os = "qnx"))] {
pub use net::bpf::*;
pub use net::if_::*;
Expand Down
1 change: 1 addition & 0 deletions src/new/openbsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@

pub(crate) mod sys;
pub(crate) mod unistd;
pub(crate) mod uvm;
Comment thread
nalysius marked this conversation as resolved.
Resolved
5 changes: 5 additions & 0 deletions src/new/openbsd/uvm/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
//! Directory: `uvm/`
//!
//! <https://github.com/openbsd/src/blob/master/sys/uvm>

pub(crate) mod uvmexp;
116 changes: 116 additions & 0 deletions src/new/openbsd/uvm/uvmexp.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
//! Header: `uvm/uvmexp.h`
//!
//! <https://github.com/openbsd/src/blob/master/sys/uvm/uvmexp.h>

use crate::prelude::*;

pub const VM_METER: c_int = 1;
pub const VM_LOADAVG: c_int = 2;
pub const VM_PSSTRINGS: c_int = 3;
pub const VM_UVMEXP: c_int = 4;
pub const VM_SWAPENCRYPT: c_int = 5;
pub const VM_NKMEMPAGES: c_int = 6;
pub const VM_ANONMIN: c_int = 7;
pub const VM_VTEXTMIN: c_int = 8;
pub const VM_VNODEMIN: c_int = 9;
pub const VM_MAXSLP: c_int = 10;
pub const VM_USPACE: c_int = 11;
pub const VM_MALLOC_CONF: c_int = 12;
/// Constants may change across releases.
/// See the [usage guidelines](crate#usage-guidelines) for details.
pub const VM_MAXID: c_int = 13;

s2! {
pub struct uvmexp {
pub pagesize: c_int,
pub pagemask: c_int,
pub pageshift: c_int,
pub npages: c_int,
pub free: c_int,
pub active: c_int,
pub inactive: c_int,
pub paging: c_int,
pub wired: c_int,
pub zeropages: c_int,
pub reserve_pagedaemon: c_int,
pub reserve_kernel: c_int,
pub percpucaches: c_int,
pub vnodepages: c_int,
pub vtextpages: c_int,
pub freemin: c_int,
pub freetarg: c_int,
pub inactarg: c_int,
pub wiredmax: c_int,
pub anonmin: c_int,
pub vtextmin: c_int,
pub vnodemin: c_int,
pub anonminpct: c_int,
pub vtextminpct: c_int,
pub vnodeminpct: c_int,
pub nswapdev: c_int,
pub swpages: c_int,
pub swpginuse: c_int,
pub swpgonly: c_int,
pub nswget: c_int,
pub nanon: c_int,
pub unused05: c_int,
pub unused06: c_int,
pub faults: c_int,
pub traps: c_int,
pub intrs: c_int,
pub swtch: c_int,
pub softs: c_int,
pub syscalls: c_int,
pub pageins: c_int,
pub pcphit: c_int,
pub pcpmiss: c_int,
pub pgswapin: c_int,
pub pgswapout: c_int,
pub forks: c_int,
pub forks_ppwait: c_int,
pub forks_sharevm: c_int,
pub pga_zerohit: c_int,
pub pga_zeromiss: c_int,
pub unused09: c_int,
pub fltnoram: c_int,
pub fltnoanon: c_int,
pub fltnoamap: c_int,
pub fltpgwait: c_int,
pub fltpgrele: c_int,
pub fltrelck: c_int,
pub fltnorelck: c_int,
pub fltanget: c_int,
pub fltanretry: c_int,
pub fltamcopy: c_int,
pub fltnamap: c_int,
pub fltnomap: c_int,
pub fltlget: c_int,
pub fltget: c_int,
pub flt_anon: c_int,
pub flt_acow: c_int,
pub flt_obj: c_int,
pub flt_prcopy: c_int,
pub flt_przero: c_int,
pub fltup: c_int,
pub fltnoup: c_int,
pub pdwoke: c_int,
pub pdrevs: c_int,
pub pdswout: c_int,
pub pdfreed: c_int,
pub pdscans: c_int,
pub pdanscan: c_int,
pub pdobscan: c_int,
pub pdreact: c_int,
pub pdbusy: c_int,
pub pdpageouts: c_int,
pub pdpending: c_int,
pub pddeact: c_int,
pub swpskip: c_int,
pub fpswtch: c_int,
pub kmapent: c_int,
}

pub struct _ps_strings {
pub val: *mut c_void,
}
}
Loading