@@ -208,10 +208,12 @@ static int (*real_xstat) (int, const char *, struct stat *);
208208static int (* real_fxstat ) (int , int , struct stat * );
209209static int (* real_fxstatat ) (int , int , const char * , struct stat * , int );
210210static int (* real_lxstat ) (int , const char * , struct stat * );
211+ #if !defined(__APPLE__ ) || !__DARWIN_ONLY_64_BIT_INO_T
211212static int (* real_xstat64 ) (int , const char * , struct stat64 * );
212213static int (* real_fxstat64 ) (int , int , struct stat64 * );
213214static int (* real_fxstatat64 ) (int , int , const char * , struct stat64 * , int );
214215static int (* real_lxstat64 ) (int , const char * , struct stat64 * );
216+ #endif
215217#ifdef STATX_TYPE
216218static int (* real_statx ) (int dirfd , const char * pathname , int flags , unsigned int mask , struct statx * statxbuf );
217219#endif
@@ -983,6 +985,7 @@ static inline void fake_statbuf (struct stat *buf) {
983985#endif
984986}
985987
988+ #ifndef __APPLE__
986989static inline void fake_stat64buf (struct stat64 * buf ) {
987990#ifndef st_atime
988991 lock_for_stat ();
@@ -992,18 +995,13 @@ static inline void fake_stat64buf (struct stat64 *buf) {
992995 unlock_for_stat ();
993996#else
994997 lock_for_stat ();
995- #ifndef __APPLE__
996- fake_clock_gettime (CLOCK_REALTIME , & buf -> st_ctim );
997- fake_clock_gettime (CLOCK_REALTIME , & buf -> st_atim );
998- fake_clock_gettime (CLOCK_REALTIME , & buf -> st_mtim );
999- #else
1000998 fake_clock_gettime (CLOCK_REALTIME , & buf -> st_ctimespec );
1001999 fake_clock_gettime (CLOCK_REALTIME , & buf -> st_atimespec );
10021000 fake_clock_gettime (CLOCK_REALTIME , & buf -> st_mtimespec );
1003- #endif
10041001 unlock_for_stat ();
10051002#endif
10061003}
1004+ #endif
10071005
10081006/* macOS dyld interposing uses the function's real name instead of real_name */
10091007#ifdef MACOS_DYLD_INTERPOSE
@@ -1113,42 +1111,34 @@ int __lxstat (int ver, const char *path, struct stat *buf)
11131111{
11141112 STAT_HANDLER (lxstat , buf , ver , path , buf );
11151113}
1116- #endif
11171114
1118- #ifndef __APPLE__
11191115/* Contributed by Philipp Hachtmann in version 0.6 */
11201116int __xstat64 (int ver , const char * path , struct stat64 * buf )
11211117{
11221118 STAT64_HANDLER (xstat64 , buf , ver , path , buf );
11231119}
1124- #endif
11251120
1126- #ifndef __APPLE__
11271121/* Contributed by Philipp Hachtmann in version 0.6 */
11281122int __fxstat64 (int ver , int fildes , struct stat64 * buf )
11291123{
11301124 STAT64_HANDLER (fxstat64 , buf , ver , fildes , buf );
11311125}
1132- #endif
11331126
1134- #ifndef __APPLE__
11351127/* Added in v0.8 as suggested by Daniel Kahn Gillmor */
11361128#ifndef NO_ATFILE
11371129int __fxstatat64 (int ver , int fildes , const char * filename , struct stat64 * buf , int flag )
11381130{
11391131 STAT64_HANDLER (fxstatat64 , buf , ver , fildes , filename , buf , flag );
11401132}
11411133#endif
1142- #endif
11431134
1144- #ifndef __APPLE__
11451135/* Contributed by Philipp Hachtmann in version 0.6 */
11461136int __lxstat64 (int ver , const char * path , struct stat64 * buf )
11471137{
11481138 STAT64_HANDLER (lxstat64 , buf , ver , path , buf );
11491139}
1150- #endif
1151- #endif
1140+ #endif /* ifndef __APPLE__ */
1141+ #endif /* ifdef FAKE_STAT */
11521142
11531143#ifdef STATX_TYPE
11541144static inline void fake_statx_timestamp (struct statx_timestamp * p )
@@ -2689,10 +2679,12 @@ static void ftpl_really_init(void)
26892679 real_fxstat = dlsym (RTLD_NEXT , "__fxstat" );
26902680 real_fxstatat = dlsym (RTLD_NEXT , "__fxstatat" );
26912681 real_lxstat = dlsym (RTLD_NEXT , "__lxstat" );
2682+ #if !defined(__APPLE__ ) || !__DARWIN_ONLY_64_BIT_INO_T
26922683 real_xstat64 = dlsym (RTLD_NEXT ,"__xstat64" );
26932684 real_fxstat64 = dlsym (RTLD_NEXT , "__fxstat64" );
26942685 real_fxstatat64 = dlsym (RTLD_NEXT , "__fxstatat64" );
26952686 real_lxstat64 = dlsym (RTLD_NEXT , "__lxstat64" );
2687+ #endif
26962688#ifdef STATX_TYPE
26972689 real_statx = dlsym (RTLD_NEXT , "statx" );
26982690#endif
0 commit comments