From 25d9ab95dd8a691963453c4507d519051eaebb0c Mon Sep 17 00:00:00 2001 From: LeRoyce Pearson Date: Sun, 8 Mar 2020 21:52:36 -0600 Subject: [PATCH] Use os.ino_t for everything Also, define ino_t for windows --- lib/std/fs/file.zig | 11 +---------- lib/std/os/bits/windows.zig | 1 + 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/lib/std/fs/file.zig b/lib/std/fs/file.zig index 33307a9dd6..8f7a46ad3e 100644 --- a/lib/std/fs/file.zig +++ b/lib/std/fs/file.zig @@ -29,15 +29,6 @@ pub const File = struct { pub const Mode = os.mode_t; - /// The type that is used to represent the inode/file index number. On windows this is a - /// LARGE_INTEGER (i64), and on linux this is a u64. - pub const INode = switch (builtin.os.tag) { - .windows => os.windows.LARGE_INTEGER, - // TODO: Handle possibility of 128 bit numbers? ReFS on windows server 2012 uses a 128 bit file - // index. See https://docs.microsoft.com/en-us/windows/win32/api/fileapi/ns-fileapi-by_handle_file_information - else => os.ino_t, - }; - pub const default_mode = switch (builtin.os.tag) { .windows => 0, else => 0o666, @@ -162,7 +153,7 @@ pub const File = struct { /// you see here: the index number of the inode. /// /// The FileIndex on Windows is similar. It is a number for a file that is unique to each filesystem. - inode: INode, + inode: os.ino_t, size: u64, mode: Mode, diff --git a/lib/std/os/bits/windows.zig b/lib/std/os/bits/windows.zig index ba2725e0a9..05486c8f7b 100644 --- a/lib/std/os/bits/windows.zig +++ b/lib/std/os/bits/windows.zig @@ -4,6 +4,7 @@ usingnamespace @import("../windows/bits.zig"); const ws2_32 = @import("../windows/ws2_32.zig"); pub const fd_t = HANDLE; +pub const ino_t = LARGE_INTEGER; pub const pid_t = HANDLE; pub const mode_t = u0;