fix(redox-driver-sys): restore redox_syscall alias in io.rs and fix Result type

io.rs uses redox_syscall::dup, ::CallFlags, ::ProcSchemeVerb but was
missing the 'use syscall as redox_syscall' alias (was removed earlier
because cargo check passed locally without it, but actual build needs it).

Also fixed: the non-redox arm of acquire_iopl was using crate::Result
which is a 1-generic type alias; std::result::Result with 2 generics
is what's needed here.

Removed leftover cfg attribute and duplicate use crate::Result.
This commit is contained in:
2026-06-18 18:39:44 +03:00
parent 6512746ad7
commit c43d3eddd9
@@ -1,10 +1,11 @@
#[cfg(all(target_arch = "x86_64", target_os = "redox"))]
use syscall as redox_syscall;
use crate::Result;
#[cfg(all(target_arch = "x86_64", target_os = "redox"))]
pub fn acquire_iopl() -> Result<()> {
pub fn acquire_iopl() -> Result<(), crate::DriverError> {
extern "C" {
fn redox_cur_thrfd_v0() -> usize;
}
@@ -20,8 +21,9 @@ pub fn acquire_iopl() -> Result<()> {
}
#[cfg(all(target_arch = "x86_64", not(target_os = "redox")))]
pub fn acquire_iopl() -> Result<(), crate::DriverError> {
Err(crate::DriverError::Other(String::from(
pub fn acquire_iopl() -> std::result::Result<(), crate::DriverError> {
use crate::DriverError;
Err(DriverError::Other(String::from(
"acquire_iopl: only available on Redox",
)))
}
@@ -67,8 +69,3 @@ pub fn inw(port: u16) -> u16 {
pub fn outw(port: u16, val: u16) {
unsafe { core::arch::asm!("outw {1:x}, {0:x}", in(reg) val, in(reg) port) };
}
#[cfg(all(target_arch = "x86_64", target_os = "redox"))]
use crate::Result;