authorgravatar for 37453713+ominitay@users.noreply.github.comominitay <37453713+ominitay@users.noreply.github.com> 2022-01-08 21:18:42+00:00
committergravatar for 37453713+ominitay@users.noreply.github.comominitay <37453713+ominitay@users.noreply.github.com> 2022-02-13 20:40:44+00:00
logd978fdaa67f087cd17a122fec9ce65eabf9053ea
tree89706d871b65a7d34aa7b0cb228d1a0ac953a76e
parent3dd3c5063b1ab939e41461d0c3a3318708d9f76f
signature Commit is signed but in an unrecognized format.

std.c.Wasi.Stat: use timespec


2 files changed, 7 insertions(+), 19 deletions(-)

lib/std/c/wasi.zig+6-18
...@@ -41,32 +41,20 @@ pub const Stat = extern struct {...@@ -41,32 +41,20 @@ pub const Stat = extern struct {
41 blksize: i32,41 blksize: i32,
42 blocks: i64,42 blocks: i64,
4343
44 atimesec: time_t,44 atim: timespec,
45 atimensec: isize,45 mtim: timespec,
46 mtimesec: time_t,46 ctim: timespec,
47 mtimensec: isize,
48 ctimesec: time_t,
49 ctimensec: isize,
5047
51 pub fn atime(self: @This()) timespec {48 pub fn atime(self: @This()) timespec {
52 return timespec{49 return self.atim;
53 .tv_sec = self.atimesec,
54 .tv_nsec = self.atimensec,
55 };
56 }50 }
5751
58 pub fn mtime(self: @This()) timespec {52 pub fn mtime(self: @This()) timespec {
59 return timespec{53 return self.mtim;
60 .tv_sec = self.mtimesec,
61 .tv_nsec = self.mtimensec,
62 };
63 }54 }
6455
65 pub fn ctime(self: @This()) timespec {56 pub fn ctime(self: @This()) timespec {
66 return timespec{57 return self.ctim;
67 .tv_sec = self.ctimesec,
68 .tv_nsec = self.ctimensec,
69 };
70 }58 }
71};59};
7260
lib/std/os/wasi.zig+1-1
...@@ -88,7 +88,7 @@ pub const mode_t = u32;...@@ -88,7 +88,7 @@ pub const mode_t = u32;
8888
89pub const time_t = i64; // match https://github.com/CraneStation/wasi-libc89pub const time_t = i64; // match https://github.com/CraneStation/wasi-libc
9090
91pub const timespec = struct {91pub const timespec = extern struct {
92 tv_sec: time_t,92 tv_sec: time_t,
93 tv_nsec: isize,93 tv_nsec: isize,
9494