From 373134b161ac11f892ca1da1ff34c9e182196d1a Mon Sep 17 00:00:00 2001 From: Didactic Drunk <1479616+didactic-drunk@users.noreply.github.com> Date: Sun, 20 Oct 2019 12:11:18 -0700 Subject: [PATCH] Provide access to 64 bit inode numbers. --- src/lib_c/x86_64-darwin/c/dirent.cr | 7 ++++--- src/lib_c/x86_64-darwin/c/sys/stat.cr | 9 +++++---- src/lib_c/x86_64-darwin/c/sys/types.cr | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/lib_c/x86_64-darwin/c/dirent.cr b/src/lib_c/x86_64-darwin/c/dirent.cr index 0d254086fac2..309689fa24f7 100644 --- a/src/lib_c/x86_64-darwin/c/dirent.cr +++ b/src/lib_c/x86_64-darwin/c/dirent.cr @@ -7,14 +7,15 @@ lib LibC struct Dirent d_ino : InoT + d_seekoff : UInt64 d_reclen : UShort + d_namlen : UShort d_type : UChar - d_namlen : UChar d_name : StaticArray(Char, 256) end fun closedir(x0 : DIR*) : Int - fun opendir(x0 : Char*) : DIR* - fun readdir(x0 : DIR*) : Dirent* + fun opendir = "opendir$INODE64"(x0 : Char*) : DIR* + fun readdir = "readdir$INODE64"(x0 : DIR*) : Dirent* fun rewinddir(x0 : DIR*) : Void end diff --git a/src/lib_c/x86_64-darwin/c/sys/stat.cr b/src/lib_c/x86_64-darwin/c/sys/stat.cr index cf352007a72b..2c6f8778ac91 100644 --- a/src/lib_c/x86_64-darwin/c/sys/stat.cr +++ b/src/lib_c/x86_64-darwin/c/sys/stat.cr @@ -28,15 +28,16 @@ lib LibC struct Stat st_dev : DevT - st_ino : InoT st_mode : ModeT st_nlink : NlinkT + st_ino : InoT st_uid : UidT st_gid : GidT st_rdev : DevT st_atimespec : Timespec st_mtimespec : Timespec st_ctimespec : Timespec + st_birthtimespec : Timespec st_size : OffT st_blocks : BlkcntT st_blksize : BlksizeT @@ -47,11 +48,11 @@ lib LibC end fun chmod(x0 : Char*, x1 : ModeT) : Int - fun fstat(x0 : Int, x1 : Stat*) : Int - fun lstat(x0 : Char*, x1 : Stat*) : Int + fun fstat = fstat64(x0 : Int, x1 : Stat*) : Int + fun lstat = lstat64(x0 : Char*, x1 : Stat*) : Int fun mkdir(x0 : Char*, x1 : ModeT) : Int fun mkfifo(x0 : Char*, x1 : ModeT) : Int fun mknod(x0 : Char*, x1 : ModeT, x2 : DevT) : Int - fun stat(x0 : Char*, x1 : Stat*) : Int + fun stat = stat64(x0 : Char*, x1 : Stat*) : Int fun umask(x0 : ModeT) : ModeT end diff --git a/src/lib_c/x86_64-darwin/c/sys/types.cr b/src/lib_c/x86_64-darwin/c/sys/types.cr index 0eaec24901ad..836ac0c1c43d 100644 --- a/src/lib_c/x86_64-darwin/c/sys/types.cr +++ b/src/lib_c/x86_64-darwin/c/sys/types.cr @@ -8,7 +8,7 @@ lib LibC alias DevT = Int alias GidT = UInt alias IdT = UInt - alias InoT = UInt + alias InoT = UInt64 alias ModeT = UShort alias NlinkT = UShort alias OffT = LongLong