tsan: add interceptor stubs for stat family of functions

llvm-svn: 173782
This commit is contained in:
Dmitry Vyukov 2013-01-29 09:23:09 +00:00
parent 5d7ff00456
commit b130fc3c0d
3 changed files with 96 additions and 0 deletions

View File

@ -1065,6 +1065,66 @@ TSAN_INTERCEPTOR(int, sem_getvalue, void *s, int *sval) {
return res;
}
TSAN_INTERCEPTOR(int, __xstat, int version, const char *path, void *buf) {
SCOPED_TSAN_INTERCEPTOR(__xstat, version, path, buf);
return REAL(__xstat)(version, path, buf);
}
TSAN_INTERCEPTOR(int, stat, const char *path, void *buf) {
SCOPED_TSAN_INTERCEPTOR(__xstat, 0, path, buf);
return REAL(__xstat)(0, path, buf);
}
TSAN_INTERCEPTOR(int, __xstat64, int version, const char *path, void *buf) {
SCOPED_TSAN_INTERCEPTOR(__xstat64, version, path, buf);
return REAL(__xstat64)(version, path, buf);
}
TSAN_INTERCEPTOR(int, stat64, const char *path, void *buf) {
SCOPED_TSAN_INTERCEPTOR(__xstat64, 0, path, buf);
return REAL(__xstat64)(0, path, buf);
}
TSAN_INTERCEPTOR(int, __lxstat, int version, const char *path, void *buf) {
SCOPED_TSAN_INTERCEPTOR(__lxstat, version, path, buf);
return REAL(__lxstat)(version, path, buf);
}
TSAN_INTERCEPTOR(int, lstat, const char *path, void *buf) {
SCOPED_TSAN_INTERCEPTOR(__lxstat, 0, path, buf);
return REAL(__lxstat)(0, path, buf);
}
TSAN_INTERCEPTOR(int, __lxstat64, int version, const char *path, void *buf) {
SCOPED_TSAN_INTERCEPTOR(__lxstat64, version, path, buf);
return REAL(__lxstat64)(version, path, buf);
}
TSAN_INTERCEPTOR(int, lstat64, const char *path, void *buf) {
SCOPED_TSAN_INTERCEPTOR(__lxstat64, 0, path, buf);
return REAL(__lxstat64)(0, path, buf);
}
TSAN_INTERCEPTOR(int, __fxstat, int version, int fd, void *buf) {
SCOPED_TSAN_INTERCEPTOR(__fxstat, version, fd, buf);
return REAL(__fxstat)(version, fd, buf);
}
TSAN_INTERCEPTOR(int, fstat, int fd, void *buf) {
SCOPED_TSAN_INTERCEPTOR(__fxstat, 0, fd, buf);
return REAL(__fxstat)(0, fd, buf);
}
TSAN_INTERCEPTOR(int, __fxstat64, int version, int fd, void *buf) {
SCOPED_TSAN_INTERCEPTOR(__fxstat64, version, fd, buf);
return REAL(__fxstat64)(version, fd, buf);
}
TSAN_INTERCEPTOR(int, fstat64, int fd, void *buf) {
SCOPED_TSAN_INTERCEPTOR(__fxstat64, 0, fd, buf);
return REAL(__fxstat64)(0, fd, buf);
}
TSAN_INTERCEPTOR(int, open, const char *name, int flags, int mode) {
SCOPED_TSAN_INTERCEPTOR(open, name, flags, mode);
int fd = REAL(open)(name, flags, mode);
@ -1768,6 +1828,18 @@ void InitializeInterceptors() {
TSAN_INTERCEPT(sem_post);
TSAN_INTERCEPT(sem_getvalue);
TSAN_INTERCEPT(stat);
TSAN_INTERCEPT(__xstat);
TSAN_INTERCEPT(stat64);
TSAN_INTERCEPT(__xstat64);
TSAN_INTERCEPT(lstat);
TSAN_INTERCEPT(__lxstat);
TSAN_INTERCEPT(lstat64);
TSAN_INTERCEPT(__lxstat64);
TSAN_INTERCEPT(fstat);
TSAN_INTERCEPT(__fxstat);
TSAN_INTERCEPT(fstat64);
TSAN_INTERCEPT(__fxstat64);
TSAN_INTERCEPT(open);
TSAN_INTERCEPT(open64);
TSAN_INTERCEPT(creat);

View File

@ -181,6 +181,18 @@ void StatOutput(u64 *stat) {
name[StatInt_sem_timedwait] = " sem_timedwait ";
name[StatInt_sem_post] = " sem_post ";
name[StatInt_sem_getvalue] = " sem_getvalue ";
name[StatInt_stat] = " stat ";
name[StatInt___xstat] = " __xstat ";
name[StatInt_stat64] = " stat64 ";
name[StatInt___xstat64] = " __xstat64 ";
name[StatInt_lstat] = " lstat ";
name[StatInt___lxstat] = " __lxstat ";
name[StatInt_lstat64] = " lstat64 ";
name[StatInt___lxstat64] = " __lxstat64 ";
name[StatInt_fstat] = " fstat ";
name[StatInt___fxstat] = " __fxstat ";
name[StatInt_fstat64] = " fstat64 ";
name[StatInt___fxstat64] = " __fxstat64 ";
name[StatInt_open] = " open ";
name[StatInt_open64] = " open64 ";
name[StatInt_creat] = " creat ";

View File

@ -176,6 +176,18 @@ enum StatType {
StatInt_sem_timedwait,
StatInt_sem_post,
StatInt_sem_getvalue,
StatInt_stat,
StatInt___xstat,
StatInt_stat64,
StatInt___xstat64,
StatInt_lstat,
StatInt___lxstat,
StatInt_lstat64,
StatInt___lxstat64,
StatInt_fstat,
StatInt___fxstat,
StatInt_fstat64,
StatInt___fxstat64,
StatInt_open,
StatInt_open64,
StatInt_creat,