Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add iopl/ioperm to all linuxes #3720

Merged
merged 1 commit into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions libc-test/semver/linux-i686.txt
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ fsblkcnt64_t
fsfilcnt64_t
getcontext
greg_t
ioperm
iopl
makecontext
max_align_t
mcontext_t
Expand Down
2 changes: 2 additions & 0 deletions libc-test/semver/linux-x86_64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ TIOCGRS485
TIOCSBRK
TIOCSRS485
greg_t
ioperm
iopl
max_align_t
mcontext_t
ucontext_t
Expand Down
2 changes: 0 additions & 2 deletions src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -802,8 +802,6 @@ extern "C" {
pub fn setcontext(ucp: *const ucontext_t) -> ::c_int;
pub fn makecontext(ucp: *mut ucontext_t, func: extern "C" fn(), argc: ::c_int, ...);
pub fn swapcontext(uocp: *mut ucontext_t, ucp: *const ucontext_t) -> ::c_int;
pub fn iopl(level: ::c_int) -> ::c_int;
pub fn ioperm(from: ::c_ulong, num: ::c_ulong, turn_on: ::c_int) -> ::c_int;
}

cfg_if! {
Expand Down
10 changes: 10 additions & 0 deletions src/unix/linux_like/linux/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1777,6 +1777,16 @@ cfg_if! {
}
}

cfg_if! {
if #[cfg(all(any(target_env = "gnu", target_env = "musl", target_env = "ohos"),
any(target_arch = "x86_64", target_arch = "x86")))] {
extern "C" {
pub fn iopl(level: ::c_int) -> ::c_int;
pub fn ioperm(from: ::c_ulong, num: ::c_ulong, turn_on: ::c_int) -> ::c_int;
}
}
}

cfg_if! {
if #[cfg(any(target_env = "gnu", target_env = "musl", target_env = "ohos"))] {
pub const ABDAY_1: ::nl_item = 0x20000;
Expand Down