@@ -1359,6 +1359,12 @@ INTERCEPTOR(int, timerfd_gettime, int fd, struct itimerspec *val) {
13591359 __rtsan_notify_intercepted_call (" timerfd_gettime" );
13601360 return REAL (timerfd_gettime)(fd, val);
13611361}
1362+
1363+ /* eventfd wrappers calls SYS_eventfd2 down the line */
1364+ INTERCEPTOR (int , eventfd, unsigned int count, int flags) {
1365+ __rtsan_notify_intercepted_call (" eventfd" );
1366+ return REAL (eventfd)(count, flags);
1367+ }
13621368#define RTSAN_MAYBE_INTERCEPT_INOTIFY_INIT INTERCEPT_FUNCTION (inotify_init)
13631369#define RTSAN_MAYBE_INTERCEPT_INOTIFY_INIT1 INTERCEPT_FUNCTION (inotify_init1)
13641370#define RTSAN_MAYBE_INTERCEPT_INOTIFY_ADD_WATCH \
@@ -1370,6 +1376,7 @@ INTERCEPTOR(int, timerfd_gettime, int fd, struct itimerspec *val) {
13701376 INTERCEPT_FUNCTION (timerfd_settime)
13711377#define RTSAN_MAYBE_INTERCEPT_TIMERFD_GETTIME \
13721378 INTERCEPT_FUNCTION (timerfd_gettime)
1379+ #define RTSAN_MAYBE_INTERCEPT_EVENTFD INTERCEPT_FUNCTION (eventfd)
13731380#else
13741381#define RTSAN_MAYBE_INTERCEPT_INOTIFY_INIT
13751382#define RTSAN_MAYBE_INTERCEPT_INOTIFY_INIT1
@@ -1378,6 +1385,7 @@ INTERCEPTOR(int, timerfd_gettime, int fd, struct itimerspec *val) {
13781385#define RTSAN_MAYBE_INTERCEPT_TIMERFD_CREATE
13791386#define RTSAN_MAYBE_INTERCEPT_TIMERFD_SETTIME
13801387#define RTSAN_MAYBE_INTERCEPT_TIMERFD_GETTIME
1388+ #define RTSAN_MAYBE_INTERCEPT_EVENTFD
13811389#endif
13821390
13831391INTERCEPTOR (int , pipe, int pipefd[2 ]) {
@@ -1644,6 +1652,7 @@ void __rtsan::InitializeInterceptors() {
16441652 RTSAN_MAYBE_INTERCEPT_TIMERFD_CREATE;
16451653 RTSAN_MAYBE_INTERCEPT_TIMERFD_SETTIME;
16461654 RTSAN_MAYBE_INTERCEPT_TIMERFD_GETTIME;
1655+ RTSAN_MAYBE_INTERCEPT_EVENTFD;
16471656
16481657 INTERCEPT_FUNCTION (pipe);
16491658 INTERCEPT_FUNCTION (mkfifo);
0 commit comments