Skip to content

Commit

Permalink
Use nanoseconds in filestat
Browse files Browse the repository at this point in the history
This commit fixes the `filestat` type which contains three timestamps.
Per [WASI spec], they should be in nanoseconds.  This is only a problem
for directories.

[WASI spec]: https://github.com/WebAssembly/WASI/blob/main/legacy/preview1/docs.md#-timestamp-u64

Signed-off-by: Yage Hu <[email protected]>
  • Loading branch information
yagehu committed Dec 17, 2023
1 parent 1abcd2c commit 9059f61
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/virtual-fs/src/mem_fs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ fn time() -> u64 {
std::time::SystemTime::now()
.duration_since(std::time::SystemTime::UNIX_EPOCH)
.unwrap()
.as_secs()
.as_nanos() as u64
}

#[cfg(feature = "no-time")]
Expand Down

0 comments on commit 9059f61

Please sign in to comment.