From 230adf0ee0582be5d6d77b9b3a456cc5671d218b Mon Sep 17 00:00:00 2001 From: pjht Date: Sat, 9 Nov 2024 22:13:39 -0600 Subject: [PATCH] Drop set/get_stdio RPC calls --- src/main.rs | 12 ------------ vfs_rpc/src/lib.rs | 34 ---------------------------------- 2 files changed, 46 deletions(-) diff --git a/src/main.rs b/src/main.rs index 9052981..9f16c5c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -10,7 +10,6 @@ use parking_lot::RwLock; struct Serv { fs_map: RwLock>, mount_list: RwLock>, - process_stdio: RwLock; 3]>>, syslog_client: syslog_rpc::Client } @@ -87,16 +86,6 @@ impl vfs_rpc::Server for Serv { Ok(()) } } - - fn set_stdio(&self, pid: u64, stdio: [Option<(u64, u64)>; 3]) -> Result<(), Errno> { - self.process_stdio.write().insert(pid, stdio); - Ok(()) - } - - fn get_stdio(&self, from: u64) -> [Option<(u64, u64)>; 3] { - let stdio = self.process_stdio.read().get(&from).copied().unwrap_or([None; 3]); - stdio - } } fn main() { @@ -109,7 +98,6 @@ fn main() { vfs_rpc::register_server(Box::new(Serv { fs_map: RwLock::new(HashMap::new()), mount_list: RwLock::new(HashMap::new()), - process_stdio: RwLock::new(HashMap::new()), syslog_client, })); syscalls::register(0); diff --git a/vfs_rpc/src/lib.rs b/vfs_rpc/src/lib.rs index 1d1ffdb..f258f12 100644 --- a/vfs_rpc/src/lib.rs +++ b/vfs_rpc/src/lib.rs @@ -16,8 +16,6 @@ pub trait Server: Send + Sync { fn mount(&self, dev: &Path, kind: &str, path: &Path) -> Result<(), Errno>; fn open(&self, path: &Path) -> Result<(u64, u64), Errno>; fn unmount(&self, path: &Path) -> Result<(), Errno>; - fn set_stdio(&self, pid: u64, stdio: [Option<(u64, u64)>; 3]) -> Result<(), Errno>; - fn get_stdio(&self, from: u64) -> [Option<(u64, u64)>; 3]; fn open_dir(&self, path: &Path) -> Result<(u64, u64), Errno>; } @@ -69,31 +67,6 @@ impl Client { .unwrap() } - pub fn set_stdio(&self, pid: u64, stdio: [Option<(u64, u64)>; 3]) -> Result<(), Errno> { - postcard::from_bytes( - &rpc::send_call( - self.0, - PROTO, - 4, - &postcard::to_stdvec(&(pid, stdio)).unwrap(), - ) - .get_return(), - ) - .unwrap() - } - - pub fn get_stdio(&self) -> [Option<(u64, u64)>; 3] { - postcard::from_bytes( - &rpc::send_call( - self.0, - PROTO, - 5, - &[], - ) - .get_return(), - ) - .unwrap() - } pub fn open_dir(self, path: &Path) -> Result<(u64, u64), Errno> { postcard::from_bytes( @@ -132,13 +105,6 @@ fn callback(call: IncomingCall) { let path = postcard::from_bytes(call.args()).unwrap(); let ret = postcard::to_stdvec(&server.unmount(path)).unwrap(); call.send_return(&ret); - } else if call.func == 4 { - let (pid, stdio) = postcard::from_bytes(call.args()).unwrap(); - let ret = postcard::to_stdvec(&server.set_stdio(pid, stdio)).unwrap(); - call.send_return(&ret); - } else if call.func == 5 { - let ret = postcard::to_stdvec(&server.get_stdio(call.from)).unwrap(); - call.send_return(&ret); } else if call.func == 6 { let path = postcard::from_bytes(call.args()).unwrap(); let ret = postcard::to_stdvec(&server.open_dir (path)).unwrap();