Skip to content

Commit f31fe2a

Browse files
committed
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; ```
1 parent f68f68c commit f31fe2a

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
@@ -1890,6 +1890,9 @@ getxattr
18901890
glob
18911891
glob_t
18921892
globfree
1893+
host_cpu_load_info
1894+
host_cpu_load_info_data_t
1895+
host_cpu_load_info_t
18931896
icmp6_ifstat
18941897
iconv_t
18951898
id_t

src/unix/bsd/apple/mod.rs

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

7575
pub type iconv_t = *mut ::c_void;
7676

77+
// mach/host_info.h
78+
pub type host_cpu_load_info_t = *mut host_cpu_load_info;
79+
pub type host_cpu_load_info_data_t = host_cpu_load_info;
80+
81+
// mach/processor_info.h
7782
pub type processor_cpu_load_info_t = *mut processor_cpu_load_info;
7883
pub type processor_cpu_load_info_data_t = processor_cpu_load_info;
7984
pub type processor_basic_info_t = *mut processor_basic_info;
@@ -1208,6 +1213,11 @@ s! {
12081213
pub ifs6_out_mldreport: ::u_quad_t,
12091214
pub ifs6_out_mlddone: ::u_quad_t,
12101215
}
1216+
1217+
// mach/host_info.h
1218+
pub struct host_cpu_load_info {
1219+
pub cpu_ticks: [::natural_t; CPU_STATE_MAX as usize],
1220+
}
12111221
}
12121222

12131223
s_no_extra_traits! {

0 commit comments

Comments
 (0)