Use os.ino_t for everything

Also, define ino_t for windows
master
LeRoyce Pearson 2020-03-08 21:52:36 -06:00
parent cb84875eed
commit 25d9ab95dd
2 changed files with 2 additions and 10 deletions

View File

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

View File

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