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 {...@@ -35,7 +35,7 @@ pub const File = struct {
35 .windows => os.windows.LARGE_INTEGER,35 .windows => os.windows.LARGE_INTEGER,
36 // TODO: Handle possibility of 128 bit numbers? ReFS on windows server 2012 uses a 128 bit file36 // TODO: Handle possibility of 128 bit numbers? ReFS on windows server 2012 uses a 128 bit file
37 // index. See https://docs.microsoft.com/en-us/windows/win32/api/fileapi/ns-fileapi-by_handle_file_information37 // 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,
39 };39 };
4040
41 pub const default_mode = switch (builtin.os.tag) {41 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 {...@@ -53,6 +53,7 @@ pub const mach_timebase_info_data = extern struct {
53};53};
5454
55pub const off_t = i64;55pub const off_t = i64;
56pub const ino_t = u64;
5657
57/// Renamed to Stat to not conflict with the stat function.58/// Renamed to Stat to not conflict with the stat function.
58/// atime, mtime, and ctime have functions to return `timespec`,59/// atime, mtime, and ctime have functions to return `timespec`,
...@@ -64,7 +65,7 @@ pub const Stat = extern struct {...@@ -64,7 +65,7 @@ pub const Stat = extern struct {
64 dev: i32,65 dev: i32,
65 mode: u16,66 mode: u16,
66 nlink: u16,67 nlink: u16,
67 ino: u64,68 ino: ino_t,
68 uid: u32,69 uid: u32,
69 gid: u32,70 gid: u32,
70 rdev: i32,71 rdev: i32,
lib/std/os/bits/dragonfly.zig+3-1
...@@ -138,8 +138,10 @@ pub const MAP_SIZEALIGN = 262144;...@@ -138,8 +138,10 @@ pub const MAP_SIZEALIGN = 262144;
138138
139pub const PATH_MAX = 1024;139pub const PATH_MAX = 1024;
140140
141pub const ino_t = c_ulong;
142
141pub const Stat = extern struct {143pub const Stat = extern struct {
142 ino: c_ulong,144 ino: ino_t,
143 nlink: c_uint,145 nlink: c_uint,
144 dev: c_uint,146 dev: c_uint,
145 mode: c_ushort,147 mode: c_ushort,
lib/std/os/bits/freebsd.zig+2-1
...@@ -98,6 +98,7 @@ pub const msghdr_const = extern struct {...@@ -98,6 +98,7 @@ pub const msghdr_const = extern struct {
98};98};
9999
100pub const off_t = i64;100pub const off_t = i64;
101pub const ino_t = u64;
101102
102/// Renamed to Stat to not conflict with the stat function.103/// Renamed to Stat to not conflict with the stat function.
103/// atime, mtime, and ctime have functions to return `timespec`,104/// atime, mtime, and ctime have functions to return `timespec`,
...@@ -107,7 +108,7 @@ pub const off_t = i64;...@@ -107,7 +108,7 @@ pub const off_t = i64;
107/// methods to accomplish this.108/// methods to accomplish this.
108pub const Stat = extern struct {109pub const Stat = extern struct {
109 dev: u64,110 dev: u64,
110 ino: u64,111 ino: ino_t,
111 nlink: usize,112 nlink: usize,
112113
113 mode: u16,114 mode: u16,
lib/std/os/bits/linux/x86_64.zig+2-1
...@@ -481,6 +481,7 @@ pub const msghdr_const = extern struct {...@@ -481,6 +481,7 @@ pub const msghdr_const = extern struct {
481};481};
482482
483pub const off_t = i64;483pub const off_t = i64;
484pub const ino_t = u64;
484485
485/// Renamed to Stat to not conflict with the stat function.486/// Renamed to Stat to not conflict with the stat function.
486/// atime, mtime, and ctime have functions to return `timespec`,487/// atime, mtime, and ctime have functions to return `timespec`,
...@@ -490,7 +491,7 @@ pub const off_t = i64;...@@ -490,7 +491,7 @@ pub const off_t = i64;
490/// methods to accomplish this.491/// methods to accomplish this.
491pub const Stat = extern struct {492pub const Stat = extern struct {
492 dev: u64,493 dev: u64,
493 ino: u64,494 ino: ino_t,
494 nlink: usize,495 nlink: usize,
495496
496 mode: u32,497 mode: u32,
lib/std/os/bits/netbsd.zig+2-1
...@@ -69,6 +69,7 @@ pub const msghdr_const = extern struct {...@@ -69,6 +69,7 @@ pub const msghdr_const = extern struct {
69};69};
7070
71pub const off_t = i64;71pub const off_t = i64;
72pub const ino_t = u64;
7273
73/// Renamed to Stat to not conflict with the stat function.74/// Renamed to Stat to not conflict with the stat function.
74/// atime, mtime, and ctime have functions to return `timespec`,75/// atime, mtime, and ctime have functions to return `timespec`,
...@@ -79,7 +80,7 @@ pub const off_t = i64;...@@ -79,7 +80,7 @@ pub const off_t = i64;
79pub const Stat = extern struct {80pub const Stat = extern struct {
80 dev: u64,81 dev: u64,
81 mode: u32,82 mode: u32,
82 ino: u64,83 ino: ino_t,
83 nlink: usize,84 nlink: usize,
8485
85 uid: u32,86 uid: u32,
lib/std/os/bits/wasi.zig+1
...@@ -178,6 +178,7 @@ pub const FILESTAT_SET_MTIM: fstflags_t = 0x0004;...@@ -178,6 +178,7 @@ pub const FILESTAT_SET_MTIM: fstflags_t = 0x0004;
178pub const FILESTAT_SET_MTIM_NOW: fstflags_t = 0x0008;178pub const FILESTAT_SET_MTIM_NOW: fstflags_t = 0x0008;
179179
180pub const inode_t = u64;180pub const inode_t = u64;
181pub const ino_t = inode_t;
181182
182pub const linkcount_t = u32;183pub const linkcount_t = u32;
183184