diff --git a/lib/std/fs/file.zig b/lib/std/fs/file.zig index a4ce898682..33307a9dd6 100644 --- a/lib/std/fs/file.zig +++ b/lib/std/fs/file.zig @@ -35,7 +35,7 @@ pub const File = struct { .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 => u64, + else => os.ino_t, }; pub const default_mode = switch (builtin.os.tag) { diff --git a/lib/std/os/bits/darwin.zig b/lib/std/os/bits/darwin.zig index fb933c6698..6808af0315 100644 --- a/lib/std/os/bits/darwin.zig +++ b/lib/std/os/bits/darwin.zig @@ -53,6 +53,7 @@ pub const mach_timebase_info_data = extern struct { }; pub const off_t = i64; +pub const ino_t = u64; /// Renamed to Stat to not conflict with the stat function. /// atime, mtime, and ctime have functions to return `timespec`, @@ -64,7 +65,7 @@ pub const Stat = extern struct { dev: i32, mode: u16, nlink: u16, - ino: u64, + ino: ino_t, uid: u32, gid: u32, rdev: i32, diff --git a/lib/std/os/bits/dragonfly.zig b/lib/std/os/bits/dragonfly.zig index c6c23affa7..27b2733b76 100644 --- a/lib/std/os/bits/dragonfly.zig +++ b/lib/std/os/bits/dragonfly.zig @@ -138,8 +138,10 @@ pub const MAP_SIZEALIGN = 262144; pub const PATH_MAX = 1024; +pub const ino_t = c_ulong; + pub const Stat = extern struct { - ino: c_ulong, + ino: ino_t, nlink: c_uint, dev: c_uint, mode: c_ushort, diff --git a/lib/std/os/bits/freebsd.zig b/lib/std/os/bits/freebsd.zig index b7d14934f5..02fe7e75b3 100644 --- a/lib/std/os/bits/freebsd.zig +++ b/lib/std/os/bits/freebsd.zig @@ -98,6 +98,7 @@ pub const msghdr_const = extern struct { }; pub const off_t = i64; +pub const ino_t = u64; /// Renamed to Stat to not conflict with the stat function. /// atime, mtime, and ctime have functions to return `timespec`, @@ -107,7 +108,7 @@ pub const off_t = i64; /// methods to accomplish this. pub const Stat = extern struct { dev: u64, - ino: u64, + ino: ino_t, nlink: usize, mode: u16, diff --git a/lib/std/os/bits/linux/x86_64.zig b/lib/std/os/bits/linux/x86_64.zig index 608f74e2d3..e92591d94e 100644 --- a/lib/std/os/bits/linux/x86_64.zig +++ b/lib/std/os/bits/linux/x86_64.zig @@ -481,6 +481,7 @@ pub const msghdr_const = extern struct { }; pub const off_t = i64; +pub const ino_t = u64; /// Renamed to Stat to not conflict with the stat function. /// atime, mtime, and ctime have functions to return `timespec`, @@ -490,7 +491,7 @@ pub const off_t = i64; /// methods to accomplish this. pub const Stat = extern struct { dev: u64, - ino: u64, + ino: ino_t, nlink: usize, mode: u32, diff --git a/lib/std/os/bits/netbsd.zig b/lib/std/os/bits/netbsd.zig index 89e0998d6d..735485695a 100644 --- a/lib/std/os/bits/netbsd.zig +++ b/lib/std/os/bits/netbsd.zig @@ -69,6 +69,7 @@ pub const msghdr_const = extern struct { }; pub const off_t = i64; +pub const ino_t = u64; /// Renamed to Stat to not conflict with the stat function. /// atime, mtime, and ctime have functions to return `timespec`, @@ -79,7 +80,7 @@ pub const off_t = i64; pub const Stat = extern struct { dev: u64, mode: u32, - ino: u64, + ino: ino_t, nlink: usize, uid: u32, diff --git a/lib/std/os/bits/wasi.zig b/lib/std/os/bits/wasi.zig index f56e53504e..8fb85e1fcd 100644 --- a/lib/std/os/bits/wasi.zig +++ b/lib/std/os/bits/wasi.zig @@ -178,6 +178,7 @@ pub const FILESTAT_SET_MTIM: fstflags_t = 0x0004; pub const FILESTAT_SET_MTIM_NOW: fstflags_t = 0x0008; pub const inode_t = u64; +pub const ino_t = inode_t; pub const linkcount_t = u32;