From 30a3677fe007b5bed1ace588c595f32242c97437 Mon Sep 17 00:00:00 2001 From: pjht Date: Sat, 16 Nov 2024 11:53:21 -0600 Subject: [PATCH] Add mode to open operation --- src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index d04034d..db44930 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,6 @@ use std::{ collections::HashMap, - os::mikros::{ipc, syscalls, Errno}, + os::mikros::{ipc, syscalls, Errno, FileOpenMode}, sync::Arc, }; @@ -18,10 +18,10 @@ impl fs_rpc::Server for Serv { Ok(0) } - fn open(&self, path: &std::path::Path, _mount_id: u64) -> Result<(Option, u64), Errno> { + fn open(&self, path: &std::path::Path, mode: FileOpenMode, _mount_id: u64) -> Result<(Option, u64), Errno> { let name = path.to_str().ok_or(Errno::EINVALDAT)?; let device_pid = *self.devices.read().get(name).ok_or(Errno::ENOENT)?; - let fd = dev_driver_rpc::Client::new(device_pid).open(path)?; + let fd = dev_driver_rpc::Client::new(device_pid).open(path, mode)?; Ok((Some(device_pid), fd)) }