Skip to content

Commit 1ec4aa2

Browse files
committed
[compiler-rt][rtsan] intercept accept4 syscall.
1 parent bd15c7c commit 1ec4aa2

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
@@ -643,6 +643,14 @@ INTERCEPTOR(int, shutdown, int socket, int how) {
643643
return REAL(shutdown)(socket, how);
644644
}
645645

646+
#if SANITIZER_INTERCEPT_ACCEPT4
647+
INTERCEPTOR(int, accept4, int socket, struct sockaddr *address,
648+
socklen_t *address_len, int flags) {
649+
__rtsan_notify_intercepted_call("accept4");
650+
return REAL(accept4)(socket, address, address_len, flags);
651+
}
652+
#endif
653+
646654
// I/O Multiplexing
647655

648656
INTERCEPTOR(int, poll, struct pollfd *fds, nfds_t nfds, int timeout) {
@@ -840,6 +848,9 @@ void __rtsan::InitializeInterceptors() {
840848
INTERCEPT_FUNCTION(sendto);
841849
INTERCEPT_FUNCTION(shutdown);
842850
INTERCEPT_FUNCTION(socket);
851+
#if SANITIZER_INTERCEPT_ACCEPT4
852+
INTERCEPT_FUNCTION(accept4);
853+
#endif
843854

844855
RTSAN_MAYBE_INTERCEPT_SELECT;
845856
INTERCEPT_FUNCTION(pselect);

0 commit comments

Comments
 (0)