mirror of
https://github.com/fluencelabs/wasmer
synced 2025-03-16 16:20:49 +00:00
implement fd_renumber
This commit is contained in:
parent
dd7cfac505
commit
ce4676d469
@ -41,6 +41,7 @@ pub enum Kind {
|
||||
},
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct Fd {
|
||||
pub rights: __wasi_rights_t,
|
||||
pub rights_inheriting: __wasi_rights_t,
|
||||
|
@ -657,8 +657,12 @@ pub fn fd_readdir(
|
||||
/// - `__wasi_fd_t to`
|
||||
/// Location to copy file descriptor to
|
||||
pub fn fd_renumber(ctx: &mut Ctx, from: __wasi_fd_t, to: __wasi_fd_t) -> __wasi_errno_t {
|
||||
debug!("wasi::fd_renumber");
|
||||
unimplemented!()
|
||||
debug!("wasi::fd_renumber: from={}, to={}", from, to);
|
||||
let state = get_wasi_state(ctx);
|
||||
let fd_entry = wasi_try!(state.fs.fd_map.get(&from).ok_or(__WASI_EBADF));
|
||||
|
||||
state.fs.fd_map.insert(to, fd_entry.clone());
|
||||
__WASI_ESUCCESS
|
||||
}
|
||||
|
||||
/// ### `fd_seek()`
|
||||
|
Loading…
x
Reference in New Issue
Block a user