Add mode to open operation
This commit is contained in:
parent
13238344bf
commit
30a3677fe0
@ -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>, u64), Errno> {
|
||||
fn open(&self, path: &std::path::Path, mode: FileOpenMode, _mount_id: u64) -> Result<(Option<u64>, 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))
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user