@@ -1359,6 +1359,12 @@ INTERCEPTOR(int, timerfd_gettime, int fd, struct itimerspec *val) {
1359
1359
__rtsan_notify_intercepted_call (" timerfd_gettime" );
1360
1360
return REAL (timerfd_gettime)(fd, val);
1361
1361
}
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
+ }
1362
1368
#define RTSAN_MAYBE_INTERCEPT_INOTIFY_INIT INTERCEPT_FUNCTION (inotify_init)
1363
1369
#define RTSAN_MAYBE_INTERCEPT_INOTIFY_INIT1 INTERCEPT_FUNCTION (inotify_init1)
1364
1370
#define RTSAN_MAYBE_INTERCEPT_INOTIFY_ADD_WATCH \
@@ -1370,6 +1376,7 @@ INTERCEPTOR(int, timerfd_gettime, int fd, struct itimerspec *val) {
1370
1376
INTERCEPT_FUNCTION (timerfd_settime)
1371
1377
#define RTSAN_MAYBE_INTERCEPT_TIMERFD_GETTIME \
1372
1378
INTERCEPT_FUNCTION (timerfd_gettime)
1379
+ #define RTSAN_MAYBE_INTERCEPT_EVENTFD INTERCEPT_FUNCTION (eventfd)
1373
1380
#else
1374
1381
#define RTSAN_MAYBE_INTERCEPT_INOTIFY_INIT
1375
1382
#define RTSAN_MAYBE_INTERCEPT_INOTIFY_INIT1
@@ -1378,6 +1385,7 @@ INTERCEPTOR(int, timerfd_gettime, int fd, struct itimerspec *val) {
1378
1385
#define RTSAN_MAYBE_INTERCEPT_TIMERFD_CREATE
1379
1386
#define RTSAN_MAYBE_INTERCEPT_TIMERFD_SETTIME
1380
1387
#define RTSAN_MAYBE_INTERCEPT_TIMERFD_GETTIME
1388
+ #define RTSAN_MAYBE_INTERCEPT_EVENTFD
1381
1389
#endif
1382
1390
1383
1391
INTERCEPTOR (int , pipe , int pipefd[2 ]) {
@@ -1644,6 +1652,7 @@ void __rtsan::InitializeInterceptors() {
1644
1652
RTSAN_MAYBE_INTERCEPT_TIMERFD_CREATE;
1645
1653
RTSAN_MAYBE_INTERCEPT_TIMERFD_SETTIME;
1646
1654
RTSAN_MAYBE_INTERCEPT_TIMERFD_GETTIME;
1655
+ RTSAN_MAYBE_INTERCEPT_EVENTFD;
1647
1656
1648
1657
INTERCEPT_FUNCTION (pipe );
1649
1658
INTERCEPT_FUNCTION (mkfifo);
0 commit comments