mirror of
https://github.com/fluencelabs/wasmer
synced 2025-07-31 23:32:04 +00:00
add missing fields
This commit is contained in:
@@ -95,29 +95,34 @@ pub unsafe fn copy_terminated_array_of_cstrs(
|
||||
#[repr(C)]
|
||||
pub struct GuestStat {
|
||||
st_dev: u64,
|
||||
st_ino: u32,
|
||||
__st_dev_padding: u32,
|
||||
__st_ino_truncated: u32,
|
||||
st_mode: u32,
|
||||
st_nlink: u32,
|
||||
st_uid: u32,
|
||||
st_gid: u32,
|
||||
st_rdev: u64,
|
||||
st_rdev: u32,
|
||||
__st_rdev_padding: u32,
|
||||
st_size: u32,
|
||||
st_blksize: u32,
|
||||
st_blocks: u32,
|
||||
st_atime: u64,
|
||||
st_mtime: u64,
|
||||
st_ctime: u64,
|
||||
st_ino: u64,
|
||||
}
|
||||
|
||||
pub unsafe fn copy_stat_into_wasm(instance: &mut Instance, buf: u32, stat: &stat) {
|
||||
let stat_ptr = instance.memory_offset_addr(0, buf as _) as *mut GuestStat;
|
||||
(*stat_ptr).st_dev = stat.st_dev as _;
|
||||
(*stat_ptr).st_ino = stat.st_ino as _;
|
||||
(*stat_ptr).__st_dev_padding = 0;
|
||||
(*stat_ptr).__st_ino_truncated = stat.st_ino as _;
|
||||
(*stat_ptr).st_mode = stat.st_mode as _;
|
||||
(*stat_ptr).st_nlink = stat.st_nlink as _;
|
||||
(*stat_ptr).st_uid = stat.st_uid as _;
|
||||
(*stat_ptr).st_gid = stat.st_gid as _;
|
||||
(*stat_ptr).st_rdev = stat.st_rdev as _;
|
||||
(*stat_ptr).__st_rdev_padding = 0;
|
||||
(*stat_ptr).st_size = stat.st_size as _;
|
||||
(*stat_ptr).st_blksize = 4096;
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
@@ -131,6 +136,7 @@ pub unsafe fn copy_stat_into_wasm(instance: &mut Instance, buf: u32, stat: &stat
|
||||
(*stat_ptr).st_atime = stat.st_atime as _;
|
||||
(*stat_ptr).st_mtime = stat.st_mtime as _;
|
||||
(*stat_ptr).st_ctime = stat.st_ctime as _;
|
||||
(*stat_ptr).st_ino = stat.st_ino as _;
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
Reference in New Issue
Block a user