Skip to content

Commit f035b10

Browse files
stepanchegtgross35
authored andcommitted
Add host_cpu_load_info on Apple
Snippet from `host_info.h`: ``` struct host_cpu_load_info { /* number of ticks while running... */ natural_t cpu_ticks[CPU_STATE_MAX]; /* ... in the given mode */ }; typedef struct host_cpu_load_info host_cpu_load_info_data_t; typedef struct host_cpu_load_info *host_cpu_load_info_t; ``` (backport <#3916>) (cherry picked from commit f31fe2a)
1 parent bcae06e commit f035b10

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

libc-test/semver/apple.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1983,6 +1983,9 @@ getxattr
19831983
glob
19841984
glob_t
19851985
globfree
1986+
host_cpu_load_info
1987+
host_cpu_load_info_data_t
1988+
host_cpu_load_info_t
19861989
iconv
19871990
iconv_close
19881991
iconv_open

src/unix/bsd/apple/mod.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ pub type ledger_array_t = *mut ::ledger_t;
7272

7373
pub type iconv_t = *mut ::c_void;
7474

75+
// mach/host_info.h
76+
pub type host_cpu_load_info_t = *mut host_cpu_load_info;
77+
pub type host_cpu_load_info_data_t = host_cpu_load_info;
78+
79+
// mach/processor_info.h
7580
pub type processor_cpu_load_info_t = *mut processor_cpu_load_info;
7681
pub type processor_cpu_load_info_data_t = processor_cpu_load_info;
7782
pub type processor_basic_info_t = *mut processor_basic_info;
@@ -1189,6 +1194,11 @@ s! {
11891194
pub tcpi_rxoutoforderbytes: u64,
11901195
pub tcpi_rxretransmitpackets: u64,
11911196
}
1197+
1198+
// mach/host_info.h
1199+
pub struct host_cpu_load_info {
1200+
pub cpu_ticks: [::natural_t; CPU_STATE_MAX as usize],
1201+
}
11921202
}
11931203

11941204
s_no_extra_traits! {

0 commit comments

Comments
 (0)