Skip to content

Commit 011e9ce

Browse files
committed
[compiler-rt][rtsan] intercept accept4 syscall.
1 parent 7b8cf14 commit 011e9ce

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,14 @@ INTERCEPTOR(int, shutdown, int socket, int how) {
707707
return REAL(shutdown)(socket, how);
708708
}
709709

710+
#if SANITIZER_INTERCEPT_ACCEPT4
711+
INTERCEPTOR(int, accept4, int socket, struct sockaddr *address,
712+
socklen_t *address_len, int flags) {
713+
__rtsan_notify_intercepted_call("accept4");
714+
return REAL(accept4)(socket, address, address_len, flags);
715+
}
716+
#endif
717+
710718
// I/O Multiplexing
711719

712720
INTERCEPTOR(int, poll, struct pollfd *fds, nfds_t nfds, int timeout) {
@@ -956,6 +964,9 @@ void __rtsan::InitializeInterceptors() {
956964
INTERCEPT_FUNCTION(sendto);
957965
INTERCEPT_FUNCTION(shutdown);
958966
INTERCEPT_FUNCTION(socket);
967+
#if SANITIZER_INTERCEPT_ACCEPT4
968+
INTERCEPT_FUNCTION(accept4);
969+
#endif
959970

960971
RTSAN_MAYBE_INTERCEPT_SELECT;
961972
INTERCEPT_FUNCTION(pselect);

0 commit comments

Comments
 (0)