Skip to content

Commit 623d9c4

Browse files
authored
Fix the fstatat declaration on macOS/x64. (dlang#22689)
The x64 version of fstatat() needs to be mangled with the "INODE64" suffix in order to match the stat_t layout defined by Druntime. See https://github.com/apple-oss-distributions/xnu/blob/f6217f891ac0bb64f3d375211650a4c1ff8ca1ea/bsd/sys/stat.h#L573
1 parent 6bb9fd7 commit 623d9c4

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • druntime/src/core/sys/posix/sys

druntime/src/core/sys/posix/sys/stat.d

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2008,24 +2008,26 @@ else version (Darwin)
20082008
version (AArch64)
20092009
{
20102010
int fstat(int, stat_t*);
2011+
int fstatat(int, const scope char*, stat_t*, int);
20112012
int lstat(const scope char*, stat_t*);
20122013
int stat(const scope char*, stat_t*);
20132014
}
20142015
else
20152016
{
20162017
pragma(mangle, "fstat$INODE64") int fstat(int, stat_t*);
2018+
pragma(mangle, "fstatat$INODE64") int fstatat(int, const scope char*, stat_t*, int);
20172019
pragma(mangle, "lstat$INODE64") int lstat(const scope char*, stat_t*);
20182020
pragma(mangle, "stat$INODE64") int stat(const scope char*, stat_t*);
20192021
}
20202022
}
20212023
else
20222024
{
20232025
int fstat(int, stat_t*);
2026+
int fstatat(int, const scope char*, stat_t*, int);
20242027
int lstat(const scope char*, stat_t*);
20252028
int stat(const scope char*, stat_t*);
20262029
}
20272030
int fchmodat(int, const scope char*, mode_t, int);
2028-
int fstatat(int, const scope char*, stat_t*, int);
20292031
int futimens(int, ref const(timespec)[2]);
20302032
int mkdirat(int, const scope char*, mode_t);
20312033
int mkfifoat(int, const scope char*, mode_t);

0 commit comments

Comments
 (0)