File tree 3 files changed +38
-0
lines changed
src/unix/bsd/freebsdlike/freebsd
3 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -1897,6 +1897,7 @@ fn test_freebsd(target: &str) {
1897
1897
"machine/elf.h" ,
1898
1898
"machine/reg.h" ,
1899
1899
"malloc_np.h" ,
1900
+ "memstat.h" ,
1900
1901
"mqueue.h" ,
1901
1902
"net/bpf.h" ,
1902
1903
"net/if.h" ,
@@ -2256,6 +2257,10 @@ fn test_freebsd(target: &str) {
2256
2257
// `shm_largepage_conf` was introduced in FreeBSD 13.
2257
2258
"shm_largepage_conf" if Some ( 13 ) > freebsd_ver => true ,
2258
2259
2260
+ // Those are private types
2261
+ "memory_type" => true ,
2262
+ "memory_type_list" => true ,
2263
+
2259
2264
_ => false ,
2260
2265
}
2261
2266
} ) ;
Original file line number Diff line number Diff line change @@ -1670,6 +1670,14 @@ mallocx
1670
1670
memmem
1671
1671
memrchr
1672
1672
memset_s
1673
+ memstat_get_name
1674
+ memstat_mtl_alloc
1675
+ memstat_mtl_find
1676
+ memstat_mtl_first
1677
+ memstat_mtl_free
1678
+ memstat_mtl_geterror
1679
+ memstat_mtl_next
1680
+ memstat_strerror
1673
1681
mincore
1674
1682
mkdirat
1675
1683
mkfifoat
Original file line number Diff line number Diff line change @@ -998,6 +998,15 @@ s! {
998
998
pub alloc_policy: :: c_int,
999
999
__pad: [ :: c_int; 10 ] ,
1000
1000
}
1001
+
1002
+ pub struct memory_type {
1003
+ __priva: [ :: uintptr_t; 32 ] ,
1004
+ __privb: [ :: uintptr_t; 26 ] ,
1005
+ }
1006
+
1007
+ pub struct memory_type_list {
1008
+ __priv: [ :: uintptr_t; 2 ] ,
1009
+ }
1001
1010
}
1002
1011
1003
1012
s_no_extra_traits ! {
@@ -4369,6 +4378,22 @@ extern "C" {
4369
4378
) -> :: c_int ;
4370
4379
}
4371
4380
4381
+ #[ link( name = "memstat" ) ]
4382
+ extern "C" {
4383
+ pub fn memstat_strerror ( error : :: c_int ) -> * const :: c_char ;
4384
+ pub fn memstat_mtl_alloc ( ) -> * mut memory_type_list ;
4385
+ pub fn memstat_mtl_first ( list : * mut memory_type_list ) -> * mut memory_type ;
4386
+ pub fn memstat_mtl_next ( mtp : * mut memory_type ) -> * mut memory_type ;
4387
+ pub fn memstat_mtl_find (
4388
+ list : * mut memory_type_list ,
4389
+ allocator : :: c_int ,
4390
+ name : * const :: c_char ,
4391
+ ) -> * mut memory_type ;
4392
+ pub fn memstat_mtl_free ( list : * mut memory_type_list ) ;
4393
+ pub fn memstat_mtl_geterror ( list : * mut memory_type_list ) -> :: c_int ;
4394
+ pub fn memstat_get_name ( mtp : * const memory_type ) -> * const :: c_char ;
4395
+ }
4396
+
4372
4397
#[ link( name = "kvm" ) ]
4373
4398
extern "C" {
4374
4399
pub fn kvm_dpcpu_setcpu ( kd : * mut :: kvm_t , cpu : :: c_uint ) -> :: c_int ;
You can’t perform that action at this time.
0 commit comments