Skip to content

Commit 2ee36d4

Browse files
authored
[compiler-rt][rtsan] Fix sendmmsg and recvmmsg rtsan interceptor for MUSL (#123907)
MUSL have different signatures for sendmmsg and recvmmsg. This fixes build breakage from #123484.
1 parent 9178708 commit 2ee36d4

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -894,8 +894,13 @@ INTERCEPTOR(ssize_t, sendmsg, int socket, const struct msghdr *message,
894894
}
895895

896896
#if SANITIZER_INTERCEPT_SENDMMSG
897+
#if SANITIZER_MUSL
898+
INTERCEPTOR(int, sendmmsg, int socket, struct mmsghdr *message,
899+
unsigned int len, unsigned int flags) {
900+
#else
897901
INTERCEPTOR(int, sendmmsg, int socket, struct mmsghdr *message,
898902
unsigned int len, int flags) {
903+
#endif
899904
__rtsan_notify_intercepted_call("sendmmsg");
900905
return REAL(sendmmsg)(socket, message, len, flags);
901906
}
@@ -927,7 +932,10 @@ INTERCEPTOR(ssize_t, recvmsg, int socket, struct msghdr *message, int flags) {
927932
}
928933

929934
#if SANITIZER_INTERCEPT_RECVMMSG
930-
#if defined(__GLIBC_MINOR__) && __GLIBC_MINOR__ < 21
935+
#if SANITIZER_MUSL
936+
INTERCEPTOR(int, recvmmsg, int socket, struct mmsghdr *message,
937+
unsigned int len, unsigned int flags, struct timespec *timeout) {
938+
#elif defined(__GLIBC_MINOR__) && __GLIBC_MINOR__ < 21
931939
INTERCEPTOR(int, recvmmsg, int socket, struct mmsghdr *message,
932940
unsigned int len, int flags, const struct timespec *timeout) {
933941
#else

0 commit comments

Comments
 (0)