From fd13f1b8dd6462474a473a7a2af3b112770756b3 Mon Sep 17 00:00:00 2001 From: Ibuki Omatsu Date: Tue, 9 Sep 2025 13:36:12 +0000 Subject: [PATCH] Add getens. --- Cargo.toml | 2 +- src/lib.rs | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 31945e3261..e9465ff5b4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "libredox" authors = ["4lDO2 <4lDO2@protonmail.com>"] -version = "0.1.9" +version = "0.1.10" edition = "2021" license = "MIT" description = "Redox stable ABI" diff --git a/src/lib.rs b/src/lib.rs index 98748f90c9..3d6a82049b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -258,6 +258,8 @@ extern "C" { fn redox_get_egid_v1() -> RawResult; fn redox_get_rgid_v1() -> RawResult; + fn redox_get_ens_v0() -> RawResult; + // This function is used to get the credentials, pid, euid, egid etc. of the process with the target pid. fn redox_get_proc_credentials_v1(cap_fd: usize, target_pid: usize, buf: &mut [u8]) -> RawResult; @@ -591,6 +593,10 @@ pub mod call { pub fn getpid() -> Result { Error::demux(unsafe { redox_get_pid_v1() }) } + #[inline] + pub fn getens() -> Result { + Error::demux(unsafe { redox_get_ens_v0() }) + } #[inline] // [u8; size_of::()]