From d1273ca08b85b9366b54d801b32ef804fd32f2c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Tue, 12 Jan 2021 17:23:07 +0100 Subject: [PATCH] Fix the declaration of fstatat on macOS. Was referencing the classic declaration that doesn't fit the current stat struct, leading to wrong stat results. --- source/vibe/core/file.d | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source/vibe/core/file.d b/source/vibe/core/file.d index 830cc52..1acfded 100644 --- a/source/vibe/core/file.d +++ b/source/vibe/core/file.d @@ -1089,8 +1089,12 @@ version (Posix) { extern(C) @safe nothrow @nogc { static if (!is(typeof(dirfd))) int dirfd(DIR*); - static if (!is(typeof(fstatat))) - int fstatat(int dirfd, const(char)* pathname, stat_t *statbuf, int flags); + static if (!is(typeof(fstatat))) { + version (OSX) { + pragma(mangle, "fstatat$INODE64") + int fstatat(int dirfd, const(char)* pathname, stat_t *statbuf, int flags); + } else int fstatat(int dirfd, const(char)* pathname, stat_t *statbuf, int flags); + } } version (darwin) {