authorgravatar for 37453713+ominitay@users.noreply.github.comominitay <37453713+ominitay@users.noreply.github.com> 2022-01-08 21:19:35+00:00
committergravatar for 37453713+ominitay@users.noreply.github.comominitay <37453713+ominitay@users.noreply.github.com> 2022-02-13 20:40:45+00:00
logb2610649fcf43c678fd81f3bef71f3ba42ee3606
treeb4184fd7bbcff7b84e8edd8949cf259d4856672d
parentd978fdaa67f087cd17a122fec9ce65eabf9053ea
signature Commit is signed but in an unrecognized format.

std.c.*: add birthtime function to Stat

Adds a birthtime function to the `Stat` structs of Unices which support this. This is done to match the `atime`, `mtime`, and `ctime` functions.

4 files changed, 16 insertions(+), 0 deletions(-)

lib/std/c/darwin.zig+4
...@@ -395,6 +395,10 @@ pub const Stat = extern struct {...@@ -395,6 +395,10 @@ pub const Stat = extern struct {
395 pub fn ctime(self: @This()) timespec {395 pub fn ctime(self: @This()) timespec {
396 return self.ctimespec;396 return self.ctimespec;
397 }397 }
398
399 pub fn birthtime(self: @This()) timespec {
400 return self.birthtimespec;
401 }
398};402};
399403
400pub const timespec = extern struct {404pub const timespec = extern struct {
lib/std/c/freebsd.zig+4
...@@ -283,6 +283,10 @@ pub const Stat = extern struct {...@@ -283,6 +283,10 @@ pub const Stat = extern struct {
283 pub fn ctime(self: @This()) timespec {283 pub fn ctime(self: @This()) timespec {
284 return self.ctim;284 return self.ctim;
285 }285 }
286
287 pub fn birthtime(self: @This()) timespec {
288 return self.birthtim;
289 }
286};290};
287291
288pub const timespec = extern struct {292pub const timespec = extern struct {
lib/std/c/netbsd.zig+4
...@@ -312,6 +312,10 @@ pub const Stat = extern struct {...@@ -312,6 +312,10 @@ pub const Stat = extern struct {
312 pub fn ctime(self: @This()) timespec {312 pub fn ctime(self: @This()) timespec {
313 return self.ctim;313 return self.ctim;
314 }314 }
315
316 pub fn birthtime(self: @This()) timespec {
317 return self.birthtim;
318 }
315};319};
316320
317pub const timespec = extern struct {321pub const timespec = extern struct {
lib/std/c/openbsd.zig+4
...@@ -235,6 +235,10 @@ pub const Stat = extern struct {...@@ -235,6 +235,10 @@ pub const Stat = extern struct {
235 pub fn ctime(self: @This()) timespec {235 pub fn ctime(self: @This()) timespec {
236 return self.ctim;236 return self.ctim;
237 }237 }
238
239 pub fn birthtime(self: @This()) timespec {
240 return self.birthtim;
241 }
238};242};
239243
240pub const timespec = extern struct {244pub const timespec = extern struct {