mirror of
https://github.com/ziglang/zig.git
synced 2025-12-30 18:13:19 +00:00
std.c.darwin.Stat: use timespec
Uses timespec for times in `Stat` instead of two `isize` fields per time. This matches the <sys/stat.h> header file.
This commit is contained in:
parent
2a73700c0f
commit
f23005eba7
@ -372,14 +372,10 @@ pub const Stat = extern struct {
|
||||
uid: uid_t,
|
||||
gid: gid_t,
|
||||
rdev: i32,
|
||||
atimesec: isize,
|
||||
atimensec: isize,
|
||||
mtimesec: isize,
|
||||
mtimensec: isize,
|
||||
ctimesec: isize,
|
||||
ctimensec: isize,
|
||||
birthtimesec: isize,
|
||||
birthtimensec: isize,
|
||||
atimespec: timespec,
|
||||
mtimespec: timespec,
|
||||
ctimespec: timespec,
|
||||
birthtimespec: timespec,
|
||||
size: off_t,
|
||||
blocks: i64,
|
||||
blksize: i32,
|
||||
@ -389,24 +385,15 @@ pub const Stat = extern struct {
|
||||
qspare: [2]i64,
|
||||
|
||||
pub fn atime(self: @This()) timespec {
|
||||
return timespec{
|
||||
.tv_sec = self.atimesec,
|
||||
.tv_nsec = self.atimensec,
|
||||
};
|
||||
return self.atimespec;
|
||||
}
|
||||
|
||||
pub fn mtime(self: @This()) timespec {
|
||||
return timespec{
|
||||
.tv_sec = self.mtimesec,
|
||||
.tv_nsec = self.mtimensec,
|
||||
};
|
||||
return self.mtimespec;
|
||||
}
|
||||
|
||||
pub fn ctime(self: @This()) timespec {
|
||||
return timespec{
|
||||
.tv_sec = self.ctimesec,
|
||||
.tv_nsec = self.ctimensec,
|
||||
};
|
||||
return self.ctimespec;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user