alnyan/yggdrasil: implement mount/unmount system calls

This commit is contained in:
2023-07-20 12:38:12 +03:00
parent e137e6480a
commit 7a442f76a6
6 changed files with 27 additions and 8 deletions
+1 -1
View File
@@ -142,7 +142,7 @@ pub mod vxworks;
#[cfg(target_os = "watchos")]
pub(crate) mod watchos;
#[cfg(target_os = "yggdrasil")]
pub(crate) mod yggdrasil;
pub mod yggdrasil;
#[cfg(any(unix, target_os = "wasi", doc))]
pub mod fd;
+1 -1
View File
@@ -47,7 +47,7 @@ mod net {
}
pub mod raw {
pub type RawFd = yggdrasil_rt::RawFd;
pub type RawFd = yggdrasil_rt::io::RawFd;
pub trait AsRawFd {
fn as_raw_fd(&self) -> RawFd;
+18 -2
View File
@@ -1,3 +1,19 @@
#![stable(feature = "os_fd", since = "1.66.0")]
#![stable(feature = "os", since = "1.0.0")]
pub mod io;
pub(crate) mod io;
#[stable(feature = "yggdrasil_platform", since = "1.70.0")]
pub use yggdrasil_rt::{
io::{MountOptions, UnmountOptions},
Error,
};
#[stable(feature = "yggdrasil_platform", since = "1.70.0")]
pub unsafe fn mount(options: MountOptions) -> Result<(), Error> {
yggdrasil_rt::sys::mount(&options)
}
#[stable(feature = "yggdrasil_platform", since = "1.70.0")]
pub unsafe fn unmount(options: UnmountOptions) -> Result<(), Error> {
yggdrasil_rt::sys::unmount(&options)
}
+3 -3
View File
@@ -52,9 +52,9 @@ impl OpenOptions {
}
}
impl Into<yggdrasil_rt::OpenFlags> for OpenOptions {
fn into(self) -> yggdrasil_rt::OpenFlags {
let mut res = yggdrasil_rt::OpenFlags::new();
impl Into<yggdrasil_rt::io::OpenFlags> for OpenOptions {
fn into(self) -> yggdrasil_rt::io::OpenFlags {
let mut res = yggdrasil_rt::io::OpenFlags::new();
if self.read {
res = res.read();
}
+3
View File
@@ -91,6 +91,9 @@ fn cvt_io_err(e: OsError) -> crate::io::Error {
OsError::NotImplemented => {
crate::io::const_io_error!(ErrorKind::Unsupported, "feature not implemented")
}
OsError::NotADirectory => {
crate::io::const_io_error!(ErrorKind::NotADirectory, "not a directory")
}
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
use crate::io;
use crate::io::{IoSlice, IoSliceMut};
use yggdrasil_rt::RawFd;
use yggdrasil_rt::io::RawFd;
// const FILENO_STDIN: i32 = 0;