Skip to content

Commit f0422d5

Browse files
espindolatgross35
authored andcommitted
Add iopl/ioperm to musl x86_64
Note that I think this is available on more than x86_64, but that is all that I have to test. This also matches what was done for glibc systems. (backport <#3720>) (cherry picked from commit 083499a)
1 parent 1447f78 commit f0422d5

File tree

4 files changed

+14
-2
lines changed

4 files changed

+14
-2
lines changed

libc-test/semver/linux-i686.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,8 @@ fsblkcnt64_t
214214
fsfilcnt64_t
215215
getcontext
216216
greg_t
217+
ioperm
218+
iopl
217219
makecontext
218220
max_align_t
219221
mcontext_t

libc-test/semver/linux-x86_64.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ TIOCGRS485
139139
TIOCSBRK
140140
TIOCSRS485
141141
greg_t
142+
ioperm
143+
iopl
142144
max_align_t
143145
mcontext_t
144146
ucontext_t

src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -802,8 +802,6 @@ extern "C" {
802802
pub fn setcontext(ucp: *const ucontext_t) -> ::c_int;
803803
pub fn makecontext(ucp: *mut ucontext_t, func: extern "C" fn(), argc: ::c_int, ...);
804804
pub fn swapcontext(uocp: *mut ucontext_t, ucp: *const ucontext_t) -> ::c_int;
805-
pub fn iopl(level: ::c_int) -> ::c_int;
806-
pub fn ioperm(from: ::c_ulong, num: ::c_ulong, turn_on: ::c_int) -> ::c_int;
807805
}
808806

809807
cfg_if! {

src/unix/linux_like/linux/mod.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1556,6 +1556,16 @@ cfg_if! {
15561556
}
15571557
}
15581558

1559+
cfg_if! {
1560+
if #[cfg(all(any(target_env = "gnu", target_env = "musl", target_env = "ohos"),
1561+
any(target_arch = "x86_64", target_arch = "x86")))] {
1562+
extern "C" {
1563+
pub fn iopl(level: ::c_int) -> ::c_int;
1564+
pub fn ioperm(from: ::c_ulong, num: ::c_ulong, turn_on: ::c_int) -> ::c_int;
1565+
}
1566+
}
1567+
}
1568+
15591569
cfg_if! {
15601570
if #[cfg(any(target_env = "gnu", target_env = "musl", target_env = "ohos"))] {
15611571
pub const ABDAY_1: ::nl_item = 0x20000;

0 commit comments

Comments
 (0)