Skip to content

Commit

Permalink
Merge pull request #4014 from tgross35/backport-swiss-chard
Browse files Browse the repository at this point in the history
[0.2] Backports
  • Loading branch information
tgross35 authored Nov 7, 2024
2 parents f3d58c2 + f035b10 commit e009851
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 2 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ targets = [
"thumbv7neon-unknown-linux-gnueabihf",
"wasm32-unknown-emscripten",
"wasm32-unknown-unknown",
"wasm32-wasi",
"x86_64-apple-darwin",
"x86_64-apple-ios",
"x86_64-fortanix-unknown-sgx",
Expand Down
1 change: 0 additions & 1 deletion ci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ armv5te-unknown-linux-gnueabi \
armv5te-unknown-linux-musleabi \
i686-pc-windows-gnu \
riscv64gc-unknown-linux-gnu \
wasm32-wasi \
x86_64-fortanix-unknown-sgx \
x86_64-unknown-fuchsia \
x86_64-pc-solaris \
Expand Down
7 changes: 7 additions & 0 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3864,6 +3864,9 @@ fn test_linux(target: &str) {
// kernel so we can drop this and test the type once this new version is used in CI.
"sched_attr" => true,

// FIXME: Requires >= 6.9 kernel headers.
"epoll_params" => true,

_ => false,
}
});
Expand Down Expand Up @@ -4306,6 +4309,10 @@ fn test_linux(target: &str) {
| "SCHED_FLAG_UTIL_CLAMP"
| "SCHED_FLAG_ALL" if musl => true, // Needs more recent linux headers.

// FIXME: Requires >= 6.9 kernel headers.
"EPIOCSPARAMS"
| "EPIOCGPARAMS" => true,

_ => false,
}
});
Expand Down
3 changes: 3 additions & 0 deletions libc-test/semver/apple.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1983,6 +1983,9 @@ getxattr
glob
glob_t
globfree
host_cpu_load_info
host_cpu_load_info_data_t
host_cpu_load_info_t
iconv
iconv_close
iconv_open
Expand Down
3 changes: 3 additions & 0 deletions libc-test/semver/linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,8 @@ ENOTSUP
ENOTUNIQ
EOF
EOWNERDEAD
EPIOCGPARAMS
EPIOCSPARAMS
EPOLLERR
EPOLLET
EPOLLEXCLUSIVE
Expand Down Expand Up @@ -3489,6 +3491,7 @@ epoll_create
epoll_create1
epoll_ctl
epoll_event
epoll_params
epoll_pwait
epoll_wait
erand48
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 @@ -72,6 +72,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 @@ -1189,6 +1194,11 @@ s! {
pub tcpi_rxoutoforderbytes: u64,
pub tcpi_rxretransmitpackets: u64,
}

// 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
13 changes: 13 additions & 0 deletions src/unix/linux_like/linux/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -880,6 +880,15 @@ s! {
pub salt: [::c_uchar; TLS_CIPHER_CHACHA20_POLY1305_SALT_SIZE],
pub rec_seq: [::c_uchar; TLS_CIPHER_CHACHA20_POLY1305_REC_SEQ_SIZE],
}

// #include <linux/eventpoll.h>

pub struct epoll_params {
pub busy_poll_usecs: u32,
pub busy_poll_budget: u16,
pub prefer_busy_poll: u8,
pub __pad: u8, // Must be zero
}
}

s_no_extra_traits! {
Expand Down Expand Up @@ -4936,6 +4945,10 @@ pub const SCHED_FLAG_ALL: ::c_int = SCHED_FLAG_RESET_ON_FORK
| SCHED_FLAG_KEEP_ALL
| SCHED_FLAG_UTIL_CLAMP;

// ioctl_eventpoll: added in Linux 6.9
pub const EPIOCSPARAMS: ::Ioctl = 0x40088a01;
pub const EPIOCGPARAMS: ::Ioctl = 0x80088a02;

f! {
pub fn NLA_ALIGN(len: ::c_int) -> ::c_int {
return ((len) + NLA_ALIGNTO - 1) & !(NLA_ALIGNTO - 1)
Expand Down

0 comments on commit e009851

Please sign in to comment.