mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-18 11:21:21 +00:00
implement map-dir for WASI; fix bug in path_open
This commit is contained in:
@ -14,6 +14,7 @@ use self::state::{WasiFs, WasiState};
|
||||
use self::syscalls::*;
|
||||
|
||||
use std::ffi::c_void;
|
||||
use std::path::PathBuf;
|
||||
|
||||
pub use self::utils::is_wasi_module;
|
||||
|
||||
@ -29,6 +30,7 @@ pub fn generate_import_object(
|
||||
args: Vec<Vec<u8>>,
|
||||
envs: Vec<Vec<u8>>,
|
||||
preopened_files: Vec<String>,
|
||||
mapped_dirs: Vec<(PathBuf, String)>,
|
||||
) -> ImportObject {
|
||||
let state_gen = move || {
|
||||
fn state_destructor(data: *mut c_void) {
|
||||
@ -38,7 +40,7 @@ pub fn generate_import_object(
|
||||
}
|
||||
|
||||
let state = Box::new(WasiState {
|
||||
fs: WasiFs::new(&preopened_files).unwrap(),
|
||||
fs: WasiFs::new(&preopened_files, &mapped_dirs).unwrap(),
|
||||
args: &args[..],
|
||||
envs: &envs[..],
|
||||
});
|
||||
|
Reference in New Issue
Block a user