[compiler-rt] [compiler-rt][rtsan] intercept getpeername/recvmmsg/sendmmsg (PR #123484)

via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 20 11:20:26 PST 2025


Zentrik wrote:

It seems prior to glibc 2.21 (specifically https://github.com/bminor/glibc/commit/20e5a5f773ee800b2d7ff3e24156a8b024f6bf46), `recvmmsg` had a slightly different declaration.
```
[16:24:33] In file included from /workspace/srcdir/llvm-project/compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp:16:
[16:24:33] /workspace/srcdir/llvm-project/compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp:930:18: error: conflicting declaration of C function ‘int recvmmsg(int, mmsghdr*, unsigned int, int, timespec*)’
[16:24:33]   930 | INTERCEPTOR(int, recvmmsg, int socket, struct mmsghdr *message,
[16:24:33]       |                  ^~~~~~~~
[16:24:33] /workspace/srcdir/llvm-project/compiler-rt/lib/rtsan/../interception/interception.h:206:26: note: in definition of macro ‘DECLARE_WRAPPER’
[16:24:33]   206 |      extern "C" ret_type func(__VA_ARGS__);                                    \
[16:24:33]       |                          ^~~~
[16:24:33] /workspace/srcdir/llvm-project/compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp:930:1: note: in expansion of macro ‘INTERCEPTOR’
[16:24:33]   930 | INTERCEPTOR(int, recvmmsg, int socket, struct mmsghdr *message,
[16:24:33]       | ^~~~~~~~~~~
[16:24:33] In file included from /workspace/srcdir/llvm-project/compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp:50:
[16:24:33] /opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/usr/include/sys/socket.h:211:12: note: previous declaration ‘int recvmmsg(int, mmsghdr*, unsigned int, int, const timespec*)’
[16:24:33]   211 | extern int recvmmsg (int __fd, struct mmsghdr *__vmessages,
[16:24:33]       |            ^~~~~~~~
```

https://github.com/llvm/llvm-project/pull/123484


More information about the llvm-commits mailing list