From db4292da492c6045d1c963038c81fc4147ba42a5 Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Sun, 8 Mar 2026 21:35:52 +0100 Subject: [PATCH] ipcd: Implement fsize for shm To fix seek support. --- ipcd/src/shm.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/ipcd/src/shm.rs b/ipcd/src/shm.rs index 0e80ddcf72..94cb57606b 100644 --- a/ipcd/src/shm.rs +++ b/ipcd/src/shm.rs @@ -173,6 +173,24 @@ impl SchemeSync for ShmScheme { Ok(()) } + fn fsize(&mut self, id: usize, _ctx: &CallerCtx) -> Result { + let path = self + .handles + .get(&id) + .and_then(Handle::as_shm) + .ok_or(Error::new(EBADF))?; + let size = match self + .maps + .get(path) + .expect("handle pointing to nothing") + .buffer + { + Some(ref map) => map.len(), + None => 0, + }; + + Ok(size as u64) + } fn ftruncate(&mut self, id: usize, len: u64, _ctx: &CallerCtx) -> Result<()> { let path = self .handles