Add prestat_t

This commit is contained in:
Lachlan Sneff 2019-03-29 11:03:21 -07:00
parent 39ccf403f3
commit b1030d3181
2 changed files with 24 additions and 2 deletions

View File

@ -238,7 +238,7 @@ pub fn fd_pread(
pub fn fd_prestat_get(
ctx: &mut Ctx,
fd: __wasi_fd_t,
buf: WasmPtr<__wasi_fdstat_t>,
buf: WasmPtr<__wasi_prestat_t>,
) -> __wasi_errno_t {
unimplemented!()
}

View File

@ -34,7 +34,7 @@ pub const __WASI_DIRCOOKIE_START: u64 = 0;
pub struct __wasi_dirent_t {
pub d_next: __wasi_dircookie_t,
pub d_ino: __wasi_inode_t,
pub _namlen: u32,
pub d_namlen: u32,
pub d_type: __wasi_filetype_t,
}
@ -161,6 +161,28 @@ pub const __WASI_FDFLAG_NONBLOCK: u16 = 1 << 2;
pub const __WASI_FDFLAG_RSYNC: u16 = 1 << 3;
pub const __WASI_FDFLAG_SYNC: u16 = 1 << 4;
pub type __wasi_preopentype_t = u8;
pub const __WASI_PREOPENTYPE_DIR: u8 = 0;
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
#[repr(C)]
pub struct __wasi_prestat_u_dir_t {
pr_name_len: u32,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub union __wasi_prestat_u {
dir: __wasi_prestat_u_dir_t,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct __wasi_prestat_t {
pr_type: __wasi_preopentype_t,
u: __wasi_prestat_u,
}
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
#[repr(C)]
pub struct __wasi_fdstat_t {