diff --git a/src/scheme/proc.rs b/src/scheme/proc.rs index 8140a2f2fd..5b61ee8695 100644 --- a/src/scheme/proc.rs +++ b/src/scheme/proc.rs @@ -534,6 +534,15 @@ impl ProcScheme { token: &mut CleanLockToken, ) -> Result<(usize, InternalFlags)> { let operation_name = operation_str.ok_or(Error::new(EINVAL))?; + // /proc/self → resolve to /proc/ + if operation_name == "proc/self" || operation_name == "self" { + let pid = context::current().read(token.token()).pid; + let handle = Handle { + context: context::current(), + kind: ContextHandle::ProcDir { pid }, + }; + return new_handle((handle, InternalFlags::POSITIONED), token); + }; if let Some(kind) = Self::proc_open(operation_name) { let handle = Handle { context: context::current(),