Skip to content

Commit

Permalink
fs: add new unsupported locking api
Browse files Browse the repository at this point in the history
This API was added in the latest nightly.

Signed-off-by: Sean Cross <[email protected]>
  • Loading branch information
xobs committed Nov 12, 2024
1 parent c3fbf5d commit 0ca1e1a
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 11 deletions.
37 changes: 27 additions & 10 deletions 0003-xous-fs-add-initial-filesystem-support.patch
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
From a30bd1caabe9d801c0fd57d89eadbce48d8aa010 Mon Sep 17 00:00:00 2001
From d1db9dbb558fa1cdef82459da443d751dcf2af8b Mon Sep 17 00:00:00 2001
From: Sean Cross <[email protected]>
Date: Tue, 7 Nov 2023 10:41:10 +0800
Subject: [PATCH 3/5] xous: fs: add initial filesystem support
Subject: [PATCH 3/4] xous: fs: add initial filesystem support

Signed-off-by: Sean Cross <[email protected]>
---
library/std/src/os/xous/fs.rs | 33 ++
library/std/src/os/xous/mod.rs | 3 +
library/std/src/os/xous/path.rs | 42 ++
library/std/src/os/xous/services.rs | 3 +
library/std/src/os/xous/services/pddb.rs | 88 ++++
library/std/src/sys/pal/xous/fs.rs | 629 +++++++++++++++++++++++
library/std/src/os/xous/services/pddb.rs | 88 +++
library/std/src/sys/pal/xous/fs.rs | 646 +++++++++++++++++++++++
library/std/src/sys/pal/xous/mod.rs | 1 -
7 files changed, 798 insertions(+), 1 deletion(-)
7 files changed, 815 insertions(+), 1 deletion(-)
create mode 100644 library/std/src/os/xous/fs.rs
create mode 100644 library/std/src/os/xous/path.rs
create mode 100644 library/std/src/os/xous/services/pddb.rs
Expand Down Expand Up @@ -229,10 +229,10 @@ index 00000000000..f8459b5bac9
+}
diff --git a/library/std/src/sys/pal/xous/fs.rs b/library/std/src/sys/pal/xous/fs.rs
new file mode 100644
index 00000000000..fb2182e2091
index 00000000000..d2543909a92
--- /dev/null
+++ b/library/std/src/sys/pal/xous/fs.rs
@@ -0,0 +1,629 @@
@@ -0,0 +1,646 @@
+use alloc::str::FromStr;
+
+use crate::ffi::OsString;
Expand Down Expand Up @@ -489,17 +489,34 @@ index 00000000000..fb2182e2091
+ }
+
+ pub fn fsync(&self) -> io::Result<()> {
+ // println!("rust: File::fsync()");
+ unsupported()
+ }
+
+ pub fn datasync(&self) -> io::Result<()> {
+ // println!("rust: File::datasync()");
+ unsupported()
+ }
+
+ pub fn lock(&self) -> io::Result<()> {
+ unsupported()
+ }
+
+ pub fn lock_shared(&self) -> io::Result<()> {
+ unsupported()
+ }
+
+ pub fn try_lock(&self) -> io::Result<bool> {
+ unsupported()
+ }
+
+ pub fn try_lock_shared(&self) -> io::Result<bool> {
+ unsupported()
+ }
+
+ pub fn unlock(&self) -> io::Result<()> {
+ unsupported()
+ }
+
+ pub fn truncate(&self, _size: u64) -> io::Result<()> {
+ // println!("rust: File::truncate()");
+ unsupported()
+ }
+
Expand Down
2 changes: 1 addition & 1 deletion rust
Submodule rust updated 3683 files

0 comments on commit 0ca1e1a

Please sign in to comment.