diff --git a/library/std/src/os/mod.rs b/library/std/src/os/mod.rs index b1f4b02ff91..fb30a9a3c07 100644 --- a/library/std/src/os/mod.rs +++ b/library/std/src/os/mod.rs @@ -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; diff --git a/library/std/src/os/yggdrasil/io.rs b/library/std/src/os/yggdrasil/io.rs index cb4a0a42193..571f774369b 100644 --- a/library/std/src/os/yggdrasil/io.rs +++ b/library/std/src/os/yggdrasil/io.rs @@ -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; diff --git a/library/std/src/os/yggdrasil/mod.rs b/library/std/src/os/yggdrasil/mod.rs index e3487a20aae..568faf5b347 100644 --- a/library/std/src/os/yggdrasil/mod.rs +++ b/library/std/src/os/yggdrasil/mod.rs @@ -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) +} diff --git a/library/std/src/sys/yggdrasil/fs/file.rs b/library/std/src/sys/yggdrasil/fs/file.rs index f3f3f4d3d90..91df078010d 100644 --- a/library/std/src/sys/yggdrasil/fs/file.rs +++ b/library/std/src/sys/yggdrasil/fs/file.rs @@ -52,9 +52,9 @@ impl OpenOptions { } } -impl Into for OpenOptions { - fn into(self) -> yggdrasil_rt::OpenFlags { - let mut res = yggdrasil_rt::OpenFlags::new(); +impl Into for OpenOptions { + fn into(self) -> yggdrasil_rt::io::OpenFlags { + let mut res = yggdrasil_rt::io::OpenFlags::new(); if self.read { res = res.read(); } diff --git a/library/std/src/sys/yggdrasil/mod.rs b/library/std/src/sys/yggdrasil/mod.rs index 4ebf0349e25..8e7b54d62bc 100644 --- a/library/std/src/sys/yggdrasil/mod.rs +++ b/library/std/src/sys/yggdrasil/mod.rs @@ -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") + } } } diff --git a/library/std/src/sys/yggdrasil/stdio.rs b/library/std/src/sys/yggdrasil/stdio.rs index a64a51abd30..e9561dd71c9 100644 --- a/library/std/src/sys/yggdrasil/stdio.rs +++ b/library/std/src/sys/yggdrasil/stdio.rs @@ -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;