Skip to content

Commit 2a2286e

Browse files
committed
[tsan] Make __fxstat code path glibc only
This fixes Linux musl build after D118423. (cherry picked from commit da2a16f)
1 parent d6f290e commit 2a2286e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1554,16 +1554,16 @@ TSAN_INTERCEPTOR(int, __fxstat, int version, int fd, void *buf) {
15541554
#endif
15551555

15561556
TSAN_INTERCEPTOR(int, fstat, int fd, void *buf) {
1557-
#if SANITIZER_FREEBSD || SANITIZER_MAC || SANITIZER_ANDROID || SANITIZER_NETBSD
1558-
SCOPED_TSAN_INTERCEPTOR(fstat, fd, buf);
1557+
#if SANITIZER_GLIBC
1558+
SCOPED_TSAN_INTERCEPTOR(__fxstat, 0, fd, buf);
15591559
if (fd > 0)
15601560
FdAccess(thr, pc, fd);
1561-
return REAL(fstat)(fd, buf);
1561+
return REAL(__fxstat)(0, fd, buf);
15621562
#else
1563-
SCOPED_TSAN_INTERCEPTOR(__fxstat, 0, fd, buf);
1563+
SCOPED_TSAN_INTERCEPTOR(fstat, fd, buf);
15641564
if (fd > 0)
15651565
FdAccess(thr, pc, fd);
1566-
return REAL(__fxstat)(0, fd, buf);
1566+
return REAL(fstat)(fd, buf);
15671567
#endif
15681568
}
15691569

0 commit comments

Comments
 (0)