Skip to content

Commit

Permalink
Fix fstat64 handling on macOS with Apple Silicon
Browse files Browse the repository at this point in the history
The Apple Silicon toolchain removes the *64 stat symbols (deprecated
since 10.6) in favour of their unprefixed form.

This change might not work properly before 10.6, but 10.5 has been out
of support for over a decade, so that hopefully shouldn't be relevant.

Fixes #1752.
  • Loading branch information
emilazy committed Sep 14, 2021
1 parent 949dc7c commit 0abc07d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion misc/fts.c
Expand Up @@ -32,7 +32,7 @@ static char sccsid[] = "@(#)fts.c 8.6 (Berkeley) 8/14/94";
#endif /* LIBC_SCCS and not lint */

/* Conditional to set up proper fstat64 implementation */
#if defined(hpux) || defined(sun)
#if defined(hpux) || defined(sun) || defined(__APPLE__)
# define FTS_FSTAT64(_fd, _sbp) fstat((_fd), (_sbp))
#else
# define FTS_FSTAT64(_fd, _sbp) fstat64((_fd), (_sbp))
Expand Down Expand Up @@ -63,6 +63,7 @@ static char sccsid[] = "@(#)fts.c 8.6 (Berkeley) 8/14/94";
#endif
#if defined(__APPLE__)
# define __errno_location() (__error())
# define stat64 stat
#endif

#include "system.h"
Expand Down

0 comments on commit 0abc07d

Please sign in to comment.