Misc yanix fixes (#715)
* Correctly handle possibly misaligned pointers in readdir This reapplies #615, which was inadvertently reverted. * Tidy up unneeded `self::` qualifiers. * Make Dir's contents private. Also remove the `unsafe` from `impl_iter`. With `Dir`'s field being private, we can rely on the pointer being only what we've assigned to it. * Make `poll`'s timeout argument a `libc::c_int`. This clarifies that there are no subsequent conversions before calling the underlying libc API. * Use clock_gettime instead of clock_getres to get the time. * Mark FileType::from_raw as safe. It handles unknown values, so it can be marked safe.
This commit is contained in:
@@ -4,16 +4,16 @@ use cfg_if::cfg_if;
|
||||
cfg_if! {
|
||||
if #[cfg(unix)] {
|
||||
mod unix;
|
||||
pub(crate) use self::unix::*;
|
||||
pub use self::unix::preopen_dir;
|
||||
pub(crate) use unix::*;
|
||||
pub use unix::preopen_dir;
|
||||
|
||||
pub(crate) fn errno_from_host(err: i32) -> wasi::__wasi_errno_t {
|
||||
host_impl::errno_from_nix(yanix::Errno::from_i32(err)).as_wasi_errno()
|
||||
}
|
||||
} else if #[cfg(windows)] {
|
||||
mod windows;
|
||||
pub(crate) use self::windows::*;
|
||||
pub use self::windows::preopen_dir;
|
||||
pub(crate) use windows::*;
|
||||
pub use windows::preopen_dir;
|
||||
|
||||
pub(crate) fn errno_from_host(err: i32) -> wasi::__wasi_errno_t {
|
||||
host_impl::errno_from_win(winx::winerror::WinError::from_u32(err as u32))
|
||||
|
||||
Reference in New Issue
Block a user