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
signaturelock-open 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 {
4141 blksize: i32,
4242 blocks: i64,
4343
44 atimesec: time_t,
45 atimensec: isize,
46 mtimesec: time_t,
47 mtimensec: isize,
48 ctimesec: time_t,
49 ctimensec: isize,
44 atim: timespec,
45 mtim: timespec,
46 ctim: timespec,
5047
5148 pub fn atime(self: @This()) timespec {
52 return timespec{
53 .tv_sec = self.atimesec,
54 .tv_nsec = self.atimensec,
55 };
49 return self.atim;
5650 }
5751
5852 pub fn mtime(self: @This()) timespec {
59 return timespec{
60 .tv_sec = self.mtimesec,
61 .tv_nsec = self.mtimensec,
62 };
53 return self.mtim;
6354 }
6455
6556 pub fn ctime(self: @This()) timespec {
66 return timespec{
67 .tv_sec = self.ctimesec,
68 .tv_nsec = self.ctimensec,
69 };
57 return self.ctim;
7058 }
7159};
7260
lib/std/os/wasi.zig+1-1
......@@ -88,7 +88,7 @@ pub const mode_t = u32;
8888
8989pub const time_t = i64; // match https://github.com/CraneStation/wasi-libc
9090
91pub const timespec = struct {
91pub const timespec = extern struct {
9292 tv_sec: time_t,
9393 tv_nsec: isize,
9494