Define ino_t for systems not yet defining it

Also, use ino_t instead of u64 in fs.File.INode
master
LeRoyce Pearson 2020-03-08 18:31:18 -06:00
parent e1c1ca9903
commit cb84875eed
7 changed files with 13 additions and 6 deletions

View File

@ -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) {

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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;