mirror of
https://github.com/ziglang/zig.git
synced 2026-01-20 22:35:24 +00:00
std.c.Wasi.Stat: use timespec
This commit is contained in:
parent
3dd3c5063b
commit
d978fdaa67
@ -41,32 +41,20 @@ pub const Stat = extern struct {
|
||||
blksize: i32,
|
||||
blocks: i64,
|
||||
|
||||
atimesec: time_t,
|
||||
atimensec: isize,
|
||||
mtimesec: time_t,
|
||||
mtimensec: isize,
|
||||
ctimesec: time_t,
|
||||
ctimensec: isize,
|
||||
atim: timespec,
|
||||
mtim: timespec,
|
||||
ctim: timespec,
|
||||
|
||||
pub fn atime(self: @This()) timespec {
|
||||
return timespec{
|
||||
.tv_sec = self.atimesec,
|
||||
.tv_nsec = self.atimensec,
|
||||
};
|
||||
return self.atim;
|
||||
}
|
||||
|
||||
pub fn mtime(self: @This()) timespec {
|
||||
return timespec{
|
||||
.tv_sec = self.mtimesec,
|
||||
.tv_nsec = self.mtimensec,
|
||||
};
|
||||
return self.mtim;
|
||||
}
|
||||
|
||||
pub fn ctime(self: @This()) timespec {
|
||||
return timespec{
|
||||
.tv_sec = self.ctimesec,
|
||||
.tv_nsec = self.ctimensec,
|
||||
};
|
||||
return self.ctim;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -88,7 +88,7 @@ pub const mode_t = u32;
|
||||
|
||||
pub const time_t = i64; // match https://github.com/CraneStation/wasi-libc
|
||||
|
||||
pub const timespec = struct {
|
||||
pub const timespec = extern struct {
|
||||
tv_sec: time_t,
|
||||
tv_nsec: isize,
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user