summaryrefslogtreecommitdiff
path: root/src/unix/bsd/freebsdlike/freebsd/mod.rs
diff options
context:
space:
mode:
authorDavid CARLIER <devnexen@gmail.com>2022-11-10 19:20:16 +0000
committerDavid CARLIER <devnexen@gmail.com>2022-11-13 17:45:38 +0000
commit4c8c9bff258c6d48c771ee54010bc63486703aea (patch)
tree57124d5e020a9824d10ac1e5f5ee5330a9b3a24e /src/unix/bsd/freebsdlike/freebsd/mod.rs
parent8b6bfd7d9f33a5319e52ac8df8336fac53be0c82 (diff)
downloadrust-libc-4c8c9bff258c6d48c771ee54010bc63486703aea.tar.gz
freebsd subset of memstat api addition
Diffstat (limited to 'src/unix/bsd/freebsdlike/freebsd/mod.rs')
-rw-r--r--src/unix/bsd/freebsdlike/freebsd/mod.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs
index 1e791ab0c0..4064a3fe4e 100644
--- a/src/unix/bsd/freebsdlike/freebsd/mod.rs
+++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs
@@ -998,6 +998,15 @@ s! {
pub alloc_policy: ::c_int,
__pad: [::c_int; 10],
}
+
+ pub struct memory_type {
+ __priva: [::uintptr_t; 32],
+ __privb: [::uintptr_t; 26],
+ }
+
+ pub struct memory_type_list {
+ __priv: [::uintptr_t; 2],
+ }
}
s_no_extra_traits! {
@@ -4369,6 +4378,22 @@ extern "C" {
) -> ::c_int;
}
+#[link(name = "memstat")]
+extern "C" {
+ pub fn memstat_strerror(error: ::c_int) -> *const ::c_char;
+ pub fn memstat_mtl_alloc() -> *mut memory_type_list;
+ pub fn memstat_mtl_first(list: *mut memory_type_list) -> *mut memory_type;
+ pub fn memstat_mtl_next(mtp: *mut memory_type) -> *mut memory_type;
+ pub fn memstat_mtl_find(
+ list: *mut memory_type_list,
+ allocator: ::c_int,
+ name: *const ::c_char,
+ ) -> *mut memory_type;
+ pub fn memstat_mtl_free(list: *mut memory_type_list);
+ pub fn memstat_mtl_geterror(list: *mut memory_type_list) -> ::c_int;
+ pub fn memstat_get_name(mtp: *const memory_type) -> *const ::c_char;
+}
+
#[link(name = "kvm")]
extern "C" {
pub fn kvm_dpcpu_setcpu(kd: *mut ::kvm_t, cpu: ::c_uint) -> ::c_int;