Merge branch 'redox_get_socket_token' into 'master'

refactor: Use redox_get_socket_token from relibc

See merge request redox-os/libredox!8
This commit is contained in:
Jeremy Soller
2025-07-19 07:36:33 -06:00
2 changed files with 4 additions and 14 deletions
+1 -2
View File
@@ -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 }
+3 -12
View File
@@ -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<usize> {
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()) })
}
}