authorgravatar for leroycepearson@geemili.xyzLeRoyce Pearson <leroycepearson@geemili.xyz> 2020-03-08 18:31:18-06:00
committergravatar for leroycepearson@geemili.xyzLeRoyce Pearson <leroycepearson@geemili.xyz> 2020-03-08 18:31:18-06:00
logcb84875eed42b4721de5b2cc356c4a6719eb0516
treed048cc3d5a10d26fbe5eac162af02a5edd733d1a
parente1c1ca99031a76b44ba1bdce0d10acb4513af8d6

Define ino_t for systems not yet defining it

Also, use ino_t instead of u64 in fs.File.INode

7 files changed, 13 insertions(+), 6 deletions(-)

lib/std/fs/file.zig+1-1
......@@ -35,7 +35,7 @@ pub const File = struct {
3535 .windows => os.windows.LARGE_INTEGER,
3636 // TODO: Handle possibility of 128 bit numbers? ReFS on windows server 2012 uses a 128 bit file
3737 // index. See https://docs.microsoft.com/en-us/windows/win32/api/fileapi/ns-fileapi-by_handle_file_information
38 else => u64,
38 else => os.ino_t,
3939 };
4040
4141 pub const default_mode = switch (builtin.os.tag) {
lib/std/os/bits/darwin.zig+2-1
......@@ -53,6 +53,7 @@ pub const mach_timebase_info_data = extern struct {
5353};
5454
5555pub const off_t = i64;
56pub const ino_t = u64;
5657
5758/// Renamed to Stat to not conflict with the stat function.
5859/// atime, mtime, and ctime have functions to return `timespec`,
......@@ -64,7 +65,7 @@ pub const Stat = extern struct {
6465 dev: i32,
6566 mode: u16,
6667 nlink: u16,
67 ino: u64,
68 ino: ino_t,
6869 uid: u32,
6970 gid: u32,
7071 rdev: i32,
lib/std/os/bits/dragonfly.zig+3-1
......@@ -138,8 +138,10 @@ pub const MAP_SIZEALIGN = 262144;
138138
139139pub const PATH_MAX = 1024;
140140
141pub const ino_t = c_ulong;
142
141143pub const Stat = extern struct {
142 ino: c_ulong,
144 ino: ino_t,
143145 nlink: c_uint,
144146 dev: c_uint,
145147 mode: c_ushort,
lib/std/os/bits/freebsd.zig+2-1
......@@ -98,6 +98,7 @@ pub const msghdr_const = extern struct {
9898};
9999
100100pub const off_t = i64;
101pub const ino_t = u64;
101102
102103/// Renamed to Stat to not conflict with the stat function.
103104/// atime, mtime, and ctime have functions to return `timespec`,
......@@ -107,7 +108,7 @@ pub const off_t = i64;
107108/// methods to accomplish this.
108109pub const Stat = extern struct {
109110 dev: u64,
110 ino: u64,
111 ino: ino_t,
111112 nlink: usize,
112113
113114 mode: u16,
lib/std/os/bits/linux/x86_64.zig+2-1
......@@ -481,6 +481,7 @@ pub const msghdr_const = extern struct {
481481};
482482
483483pub const off_t = i64;
484pub const ino_t = u64;
484485
485486/// Renamed to Stat to not conflict with the stat function.
486487/// atime, mtime, and ctime have functions to return `timespec`,
......@@ -490,7 +491,7 @@ pub const off_t = i64;
490491/// methods to accomplish this.
491492pub const Stat = extern struct {
492493 dev: u64,
493 ino: u64,
494 ino: ino_t,
494495 nlink: usize,
495496
496497 mode: u32,
lib/std/os/bits/netbsd.zig+2-1
......@@ -69,6 +69,7 @@ pub const msghdr_const = extern struct {
6969};
7070
7171pub const off_t = i64;
72pub const ino_t = u64;
7273
7374/// Renamed to Stat to not conflict with the stat function.
7475/// atime, mtime, and ctime have functions to return `timespec`,
......@@ -79,7 +80,7 @@ pub const off_t = i64;
7980pub const Stat = extern struct {
8081 dev: u64,
8182 mode: u32,
82 ino: u64,
83 ino: ino_t,
8384 nlink: usize,
8485
8586 uid: u32,
lib/std/os/bits/wasi.zig+1
......@@ -178,6 +178,7 @@ pub const FILESTAT_SET_MTIM: fstflags_t = 0x0004;
178178pub const FILESTAT_SET_MTIM_NOW: fstflags_t = 0x0008;
179179
180180pub const inode_t = u64;
181pub const ino_t = inode_t;
181182
182183pub const linkcount_t = u32;
183184