[wasi-common]: add armv7 support to wasi-common (#1269)
* Add armv7 support to wasi-common This commit enables `target_pointer_width = 32` compatibility for `wasi-common` (and by transitivity, any crate found inside, e.g., `yanix`). I've also added a simplistic (bare minimum) check to our CI to ensure that `wasi-common` cross-compiles to `armv7-unknown-gnueabihf` fine. While here, I've done the same for `wasm32-unknown-emscripten`. * Clean arch-specific impls + reuse libc consts * Make SeekLoc::from_raw platform independent * Collapse CI cc jobs into one
This commit is contained in:
@@ -5,9 +5,6 @@ use crate::from_success_code;
|
||||
use std::fs::File;
|
||||
use std::io::Result;
|
||||
|
||||
pub(crate) const UTIME_NOW: i32 = 1_073_741_823;
|
||||
pub(crate) const UTIME_OMIT: i32 = 1_073_741_822;
|
||||
|
||||
/// Wrapper for `utimensat` syscall. In Emscripten, there is no point in dynamically resolving
|
||||
/// if `utimensat` is available as it always was and will be.
|
||||
pub fn utimensat(
|
||||
|
||||
@@ -5,21 +5,3 @@ pub(crate) mod fadvise;
|
||||
#[path = "../linux/file.rs"]
|
||||
pub(crate) mod file;
|
||||
pub(crate) mod filetime;
|
||||
|
||||
use crate::dir::SeekLoc;
|
||||
use std::convert::TryInto;
|
||||
use std::io::{Error, Result};
|
||||
|
||||
impl SeekLoc {
|
||||
pub unsafe fn from_raw(loc: i64) -> Result<Self> {
|
||||
// The cookie (or `loc`) is an opaque value, and applications aren't supposed to do
|
||||
// arithmetic on them or pick their own values or have any awareness of the numeric
|
||||
// range of the values. They're just supposed to pass back in the values that we
|
||||
// give them. And any value we give them will be convertable back to `long`,
|
||||
// because that's the type the OS gives them to us in. So return an `EINVAL`.
|
||||
let loc = loc
|
||||
.try_into()
|
||||
.map_err(|_| Error::from_raw_os_error(libc::EINVAL))?;
|
||||
Ok(Self(loc))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user