Skip to content

Commit

Permalink
Merge pull request #3916 from stepancheg/host-cpu-load-info
Browse files Browse the repository at this point in the history
Apple: add `host_cpu_load_info`
  • Loading branch information
tgross35 authored Nov 6, 2024
2 parents 5d5c51b + f31fe2a commit 00d01ad
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libc-test/semver/apple.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1890,6 +1890,9 @@ getxattr
glob
glob_t
globfree
host_cpu_load_info
host_cpu_load_info_data_t
host_cpu_load_info_t
icmp6_ifstat
iconv_t
id_t
Expand Down
10 changes: 10 additions & 0 deletions src/unix/bsd/apple/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ pub type ledger_array_t = *mut ::ledger_t;

pub type iconv_t = *mut ::c_void;

// mach/host_info.h
pub type host_cpu_load_info_t = *mut host_cpu_load_info;
pub type host_cpu_load_info_data_t = host_cpu_load_info;

// mach/processor_info.h
pub type processor_cpu_load_info_t = *mut processor_cpu_load_info;
pub type processor_cpu_load_info_data_t = processor_cpu_load_info;
pub type processor_basic_info_t = *mut processor_basic_info;
Expand Down Expand Up @@ -1208,6 +1213,11 @@ s! {
pub ifs6_out_mldreport: ::u_quad_t,
pub ifs6_out_mlddone: ::u_quad_t,
}

// mach/host_info.h
pub struct host_cpu_load_info {
pub cpu_ticks: [::natural_t; CPU_STATE_MAX as usize],
}
}

s_no_extra_traits! {
Expand Down

0 comments on commit 00d01ad

Please sign in to comment.