From c21fcb684764fe51422d25eb51fc652e9731ee68 Mon Sep 17 00:00:00 2001 From: Ibuki Omatsu Date: Sat, 19 Jul 2025 13:36:33 +0000 Subject: [PATCH] refactor: Use redox_get_socket_token from relibc --- Cargo.toml | 3 +-- src/lib.rs | 15 +++------------ 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 7a9343b92e..e6e0b54840 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "libredox" authors = ["4lDO2 <4lDO2@protonmail.com>"] -version = "0.1.5" +version = "0.1.6" edition = "2021" license = "MIT" description = "Redox stable ABI" @@ -20,5 +20,4 @@ mkns = ["ioslice"] bitflags = "2" libc = "0.2" redox_syscall = { version = "0.5", optional = true } -redox-rt = { git = "https://gitlab.redox-os.org/redox-os/relibc.git", default-features = false } ioslice = { version = "0.6", optional = true } diff --git a/src/lib.rs b/src/lib.rs index 7e9667482a..4ab99852fd 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -293,6 +293,8 @@ extern "C" { metadata: *const u64, metadata_len: usize, ) -> RawResult; + + fn redox_get_socket_token_v0(fd: usize, payload: *mut u8, payload_len: usize) -> RawResult; } #[cfg(feature = "call")] @@ -379,7 +381,6 @@ impl Drop for Fd { #[cfg(feature = "call")] pub mod call { use core::mem::MaybeUninit; - use redox_rt::protocol::SocketCall; use super::*; @@ -610,16 +611,6 @@ pub mod call { #[inline] pub fn get_socket_token(fd: usize, buf: &mut [u8]) -> Result { - let metadata = [SocketCall::GetToken as u64]; - Error::demux(unsafe { - redox_sys_call_v0( - fd, - buf.as_mut_ptr(), - buf.len(), - 0, - metadata.as_ptr(), - metadata.len(), - ) - }) + Error::demux(unsafe { redox_get_socket_token_v0(fd, buf.as_mut_ptr(), buf.len()) }) } }