authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-05-29 16:35:00 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-05-29 16:35:00 -07:00
log18b00c5c5d25e230ff4f3ea07fadb2a1d54a773d
tree35cedd92bc61d27215ff0a1b52ad653d3af51040
parentcd5a750bf6d58fa355efe2223c3f9c0626198f13
signaturebadge-check Signed by SSH key SHA256:4hHJbtBRU58AYXwjL7fkz2fnQHdiye8x1QpTCQ0sHNw

macos support


5 files changed, 17 insertions(+), 3 deletions(-)

Dir.zig+1
......@@ -9,6 +9,7 @@ const os = builtin.target.os.tag;
99
1010const sys = switch (os) {
1111 .linux => @import("sys-linux"),
12 .macos => @import("sys-darwin"),
1213 else => unreachable,
1314};
1415
File.zig+11
......@@ -11,6 +11,7 @@ const os = builtin.target.os.tag;
1111
1212const sys = switch (os) {
1313 .linux => @import("sys-linux"),
14 .macos => @import("sys-darwin"),
1415 else => unreachable,
1516};
1617
......@@ -151,6 +152,16 @@ pub const Stat = struct {
151152 .ctime = @as(i128, st.ctim.sec) * time.ns_per_s + st.ctim.nsec,
152153 };
153154 }
155 if (os == .macos) {
156 return .{
157 .inode = st.ino,
158 .size = @bitCast(st.size),
159 .mode = st.mode,
160 .atime = @as(i128, st.atimespec.sec) * time.ns_per_s + st.atimespec.nsec,
161 .mtime = @as(i128, st.mtimespec.sec) * time.ns_per_s + st.mtimespec.nsec,
162 .ctime = @as(i128, st.ctimespec.sec) * time.ns_per_s + st.ctimespec.nsec,
163 };
164 }
154165 }
155166
156167 pub fn kind(self: Stat) Kind {
licenses.txt+1
......@@ -6,6 +6,7 @@ MPL-2.0:
66MIT:
77= https://spdx.org/licenses/MIT
88- git https://github.com/nektro/zig-extras
9- git https://github.com/nektro/zig-sys-darwin
910- git https://github.com/nektro/zig-sys-linux
1011- git https://github.com/nektro/zig-time
1112
nfs.zig+3-3
......@@ -9,12 +9,12 @@ const os = builtin.target.os.tag;
99
1010const sys = switch (os) {
1111 .linux => sys_linux,
12 .macos => @import("sys-darwin"),
1213 else => unreachable,
1314};
1415
15pub const Handle = switch (os) {
16 .linux => enum(c_int) { _ },
17 else => unreachable,
16pub const Handle = enum(c_int) {
17 _,
1818};
1919
2020pub const Error = sys.errno.Error;
zigmod.yml+1
......@@ -9,3 +9,4 @@ dependencies:
99 - src: git https://github.com/nektro/zig-sys-linux
1010 - src: git https://github.com/nektro/zig-nio
1111 - src: git https://github.com/nektro/zig-time
12 - src: git https://github.com/nektro/zig-sys-darwin