mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-26 22:26:05 +00:00
[msan][tsan] Refine __fxstat{,at}{,64} condition
In glibc before 2.33, include/sys/stat.h defines fstat/fstat64 to `__fxstat/__fxstat64` and provides `__fxstat/__fxstat64` in libc_nonshared.a. The symbols are glibc specific and not needed on other systems. Reviewed By: vitalybuka, #sanitizers Differential Revision: https://reviews.llvm.org/D118423
This commit is contained in:
parent
5d089d9a83
commit
c80d349859
@ -666,7 +666,7 @@ INTERCEPTOR(int, fstat, int fd, void *buf) {
|
|||||||
#define MSAN_MAYBE_INTERCEPT_FSTAT
|
#define MSAN_MAYBE_INTERCEPT_FSTAT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !SANITIZER_FREEBSD && !SANITIZER_NETBSD
|
#if SANITIZER_GLIBC
|
||||||
INTERCEPTOR(int, __fxstat, int magic, int fd, void *buf) {
|
INTERCEPTOR(int, __fxstat, int magic, int fd, void *buf) {
|
||||||
ENSURE_MSAN_INITED();
|
ENSURE_MSAN_INITED();
|
||||||
int res = REAL(__fxstat)(magic, fd, buf);
|
int res = REAL(__fxstat)(magic, fd, buf);
|
||||||
@ -679,7 +679,7 @@ INTERCEPTOR(int, __fxstat, int magic, int fd, void *buf) {
|
|||||||
#define MSAN_MAYBE_INTERCEPT___FXSTAT
|
#define MSAN_MAYBE_INTERCEPT___FXSTAT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !SANITIZER_FREEBSD && !SANITIZER_NETBSD
|
#if SANITIZER_GLIBC
|
||||||
INTERCEPTOR(int, __fxstat64, int magic, int fd, void *buf) {
|
INTERCEPTOR(int, __fxstat64, int magic, int fd, void *buf) {
|
||||||
ENSURE_MSAN_INITED();
|
ENSURE_MSAN_INITED();
|
||||||
int res = REAL(__fxstat64)(magic, fd, buf);
|
int res = REAL(__fxstat64)(magic, fd, buf);
|
||||||
@ -704,7 +704,7 @@ INTERCEPTOR(int, fstatat, int fd, char *pathname, void *buf, int flags) {
|
|||||||
# define MSAN_MAYBE_INTERCEPT_FSTATAT
|
# define MSAN_MAYBE_INTERCEPT_FSTATAT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !SANITIZER_FREEBSD && !SANITIZER_NETBSD
|
#if SANITIZER_GLIBC
|
||||||
INTERCEPTOR(int, __fxstatat, int magic, int fd, char *pathname, void *buf,
|
INTERCEPTOR(int, __fxstatat, int magic, int fd, char *pathname, void *buf,
|
||||||
int flags) {
|
int flags) {
|
||||||
ENSURE_MSAN_INITED();
|
ENSURE_MSAN_INITED();
|
||||||
@ -717,7 +717,7 @@ INTERCEPTOR(int, __fxstatat, int magic, int fd, char *pathname, void *buf,
|
|||||||
# define MSAN_MAYBE_INTERCEPT___FXSTATAT
|
# define MSAN_MAYBE_INTERCEPT___FXSTATAT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !SANITIZER_FREEBSD && !SANITIZER_NETBSD
|
#if SANITIZER_GLIBC
|
||||||
INTERCEPTOR(int, __fxstatat64, int magic, int fd, char *pathname, void *buf,
|
INTERCEPTOR(int, __fxstatat64, int magic, int fd, char *pathname, void *buf,
|
||||||
int flags) {
|
int flags) {
|
||||||
ENSURE_MSAN_INITED();
|
ENSURE_MSAN_INITED();
|
||||||
|
@ -1536,7 +1536,7 @@ TSAN_INTERCEPTOR(int, pthread_once, void *o, void (*f)()) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if SANITIZER_LINUX && !SANITIZER_ANDROID
|
#if SANITIZER_GLIBC
|
||||||
TSAN_INTERCEPTOR(int, __fxstat, int version, int fd, void *buf) {
|
TSAN_INTERCEPTOR(int, __fxstat, int version, int fd, void *buf) {
|
||||||
SCOPED_TSAN_INTERCEPTOR(__fxstat, version, fd, buf);
|
SCOPED_TSAN_INTERCEPTOR(__fxstat, version, fd, buf);
|
||||||
if (fd > 0)
|
if (fd > 0)
|
||||||
@ -1562,7 +1562,7 @@ TSAN_INTERCEPTOR(int, fstat, int fd, void *buf) {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if SANITIZER_LINUX && !SANITIZER_ANDROID
|
#if SANITIZER_GLIBC
|
||||||
TSAN_INTERCEPTOR(int, __fxstat64, int version, int fd, void *buf) {
|
TSAN_INTERCEPTOR(int, __fxstat64, int version, int fd, void *buf) {
|
||||||
SCOPED_TSAN_INTERCEPTOR(__fxstat64, version, fd, buf);
|
SCOPED_TSAN_INTERCEPTOR(__fxstat64, version, fd, buf);
|
||||||
if (fd > 0)
|
if (fd > 0)
|
||||||
@ -1574,7 +1574,7 @@ TSAN_INTERCEPTOR(int, __fxstat64, int version, int fd, void *buf) {
|
|||||||
#define TSAN_MAYBE_INTERCEPT___FXSTAT64
|
#define TSAN_MAYBE_INTERCEPT___FXSTAT64
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if SANITIZER_LINUX && !SANITIZER_ANDROID
|
#if SANITIZER_GLIBC
|
||||||
TSAN_INTERCEPTOR(int, fstat64, int fd, void *buf) {
|
TSAN_INTERCEPTOR(int, fstat64, int fd, void *buf) {
|
||||||
SCOPED_TSAN_INTERCEPTOR(__fxstat64, 0, fd, buf);
|
SCOPED_TSAN_INTERCEPTOR(__fxstat64, 0, fd, buf);
|
||||||
if (fd > 0)
|
if (fd > 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user