From 0a7a42c227c0f08e00a3e000485d858597c22f9c Mon Sep 17 00:00:00 2001 From: pjht Date: Mon, 30 Sep 2024 13:33:02 -0500 Subject: [PATCH] Add seek function --- src/main.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 78c2c84..673830b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -114,7 +114,7 @@ impl dev_driver_rpc::Server for Serv { } impl file_rpc::Server for Serv { - fn read(&self, fd: u64, _pos: u64, len: usize) -> Result, ()> { + fn read(&self, fd: u64, len: usize) -> Result, ()> { if fd as usize >= usize::MAX / 2 { let ptys = self.ptys.read(); let pty = &ptys[fd as usize - usize::MAX / 2]; @@ -126,7 +126,7 @@ impl file_rpc::Server for Serv { } } - fn write(&self, fd: u64, _pos: u64, data: &[u8]) -> Result<(), ()> { + fn write(&self, fd: u64, data: &[u8]) -> Result<(), ()> { if fd as usize >= usize::MAX / 2 { let ptys = self.ptys.read(); let pty = &ptys[fd as usize - usize::MAX / 2]; @@ -187,6 +187,8 @@ impl file_rpc::Server for Serv { fn cancel_poll(&self, poll_id: u64) { self.polls.lock().remove(poll_id as usize); } + + fn seek(&self, _fd: u64, _pos: file_rpc::SeekFrom) -> u64 { 0 } } fn main() {