diff options
| author | ominitay <37453713+ominitay@users.noreply.github.com> | 2022-01-08 21:19:35 +0000 |
|---|---|---|
| committer | ominitay <37453713+ominitay@users.noreply.github.com> | 2022-02-13 20:40:45 +0000 |
| commit | b2610649fcf43c678fd81f3bef71f3ba42ee3606 (patch) | |
| tree | b4184fd7bbcff7b84e8edd8949cf259d4856672d /lib/std | |
| parent | d978fdaa67f087cd17a122fec9ce65eabf9053ea (diff) | |
| download | zig-b2610649fcf43c678fd81f3bef71f3ba42ee3606.tar.gz zig-b2610649fcf43c678fd81f3bef71f3ba42ee3606.zip | |
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.
Diffstat (limited to 'lib/std')
| -rw-r--r-- | lib/std/c/darwin.zig | 4 | ||||
| -rw-r--r-- | lib/std/c/freebsd.zig | 4 | ||||
| -rw-r--r-- | lib/std/c/netbsd.zig | 4 | ||||
| -rw-r--r-- | lib/std/c/openbsd.zig | 4 |
4 files changed, 16 insertions, 0 deletions
diff --git a/lib/std/c/darwin.zig b/lib/std/c/darwin.zig index 3f5b8b340a..2d72f69024 100644 --- a/lib/std/c/darwin.zig +++ b/lib/std/c/darwin.zig @@ -395,6 +395,10 @@ pub const Stat = extern struct { pub fn ctime(self: @This()) timespec { return self.ctimespec; } + + pub fn birthtime(self: @This()) timespec { + return self.birthtimespec; + } }; pub const timespec = extern struct { diff --git a/lib/std/c/freebsd.zig b/lib/std/c/freebsd.zig index a19ecd3bac..10ab830ab0 100644 --- a/lib/std/c/freebsd.zig +++ b/lib/std/c/freebsd.zig @@ -283,6 +283,10 @@ pub const Stat = extern struct { pub fn ctime(self: @This()) timespec { return self.ctim; } + + pub fn birthtime(self: @This()) timespec { + return self.birthtim; + } }; pub const timespec = extern struct { diff --git a/lib/std/c/netbsd.zig b/lib/std/c/netbsd.zig index 4fbc7594b0..17c3bfd83c 100644 --- a/lib/std/c/netbsd.zig +++ b/lib/std/c/netbsd.zig @@ -312,6 +312,10 @@ pub const Stat = extern struct { pub fn ctime(self: @This()) timespec { return self.ctim; } + + pub fn birthtime(self: @This()) timespec { + return self.birthtim; + } }; pub const timespec = extern struct { diff --git a/lib/std/c/openbsd.zig b/lib/std/c/openbsd.zig index 6ba11e8e5a..4ee3351023 100644 --- a/lib/std/c/openbsd.zig +++ b/lib/std/c/openbsd.zig @@ -235,6 +235,10 @@ pub const Stat = extern struct { pub fn ctime(self: @This()) timespec { return self.ctim; } + + pub fn birthtime(self: @This()) timespec { + return self.birthtim; + } }; pub const timespec = extern struct { |
