Skip to content

Commit 4913051

Browse files
cjihrigaddaleax
authored andcommitted
wasi: add __wasi_fd_filestat_set_times() test
PR-URL: #34623 Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Jiawen Geng <[email protected]> Reviewed-By: David Carlier <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent f710dbf commit 4913051

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

‎test/wasi/c/stat.c‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#defineSIZE 500
1212

1313
intmain(void){
14+
structtimespectimes[2];
1415
structstatst;
1516
intfd;
1617
intret;
@@ -33,6 +34,15 @@ int main(void){
3334
assert(ret==0);
3435
assert(st.st_size==SIZE);
3536

37+
times[0].tv_sec=4;
38+
times[0].tv_nsec=0;
39+
times[1].tv_sec=9;
40+
times[1].tv_nsec=0;
41+
assert(0==futimens(fd, times));
42+
assert(0==fstat(fd, &st));
43+
assert(4==st.st_atime);
44+
assert(9==st.st_mtime);
45+
3646
ret=close(fd);
3747
assert(ret==0);
3848

‎test/wasi/wasm/stat.wasm‎

2.89 KB
Binary file not shown.

0 commit comments

Comments
(0)