diff --git a/wasmtime-wasi/build.rs b/wasmtime-wasi/build.rs index fa9d79f17f..1ed59201b4 100644 --- a/wasmtime-wasi/build.rs +++ b/wasmtime-wasi/build.rs @@ -103,7 +103,8 @@ fn main() { .blacklist_item("__WASI_ETIMEDOUT") .blacklist_item("__WASI_ETXTBSY") .blacklist_item("__WASI_EXDEV") - .blacklist_item("__WASI_ENOTCAPABLE"); + .blacklist_item("__WASI_ENOTCAPABLE") + .blacklist_item("__WASI_PREOPENTYPE_DIR"); let out_path = PathBuf::from(env::var("OUT_DIR").unwrap()); diff --git a/wasmtime-wasi/src/host.rs b/wasmtime-wasi/src/host.rs index 1b83c5491e..afd01bc163 100644 --- a/wasmtime-wasi/src/host.rs +++ b/wasmtime-wasi/src/host.rs @@ -83,3 +83,6 @@ pub const __WASI_ETIMEDOUT: __wasi_errno_t = 73; pub const __WASI_ETXTBSY: __wasi_errno_t = 74; pub const __WASI_EXDEV: __wasi_errno_t = 75; pub const __WASI_ENOTCAPABLE: __wasi_errno_t = 76; + +// pub type __wasi_preopentype_t = u8; +pub const __WASI_PREOPENTYPE_DIR: __wasi_preopentype_t = 0; diff --git a/wasmtime-wasi/src/host_impls.rs b/wasmtime-wasi/src/host_impls.rs index d614d6d0b1..eb0bae29e0 100644 --- a/wasmtime-wasi/src/host_impls.rs +++ b/wasmtime-wasi/src/host_impls.rs @@ -133,7 +133,7 @@ pub fn wasmtime_ssp_fd_prestat_get( rwlock_rdlock!(prestats); let ret_code = if let Some(prestat) = fd_prestats_get_entry(prestats, fd) { - (*buf).pr_type = host::__WASI_PREOPENTYPE_DIR as host::__wasi_preopentype_t; + (*buf).pr_type = host::__WASI_PREOPENTYPE_DIR; unsafe { let dir_name = ::std::ffi::CStr::from_ptr((*prestat).dir).to_str().unwrap(); (*buf).u.dir.pr_name_len = dir_name.len();