| From 42976ed0a0160864b41680604ea9cdb3c175cb94 Mon Sep 17 00:00:00 2001 |
| From: Khem Raj <raj.khem@gmail.com> |
| Date: Wed, 15 Jan 2020 17:48:28 -0800 |
| Subject: [PATCH] Use overloadable attribute with clang |
| |
| This is overriding the libc implementation |
| |
| Upstream-Status: Pending |
| Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| --- |
| librdmacm/preload.c | 8 +++++++- |
| 1 file changed, 7 insertions(+), 1 deletion(-) |
| |
| diff --git a/librdmacm/preload.c b/librdmacm/preload.c |
| index d46beb1b..b451de50 100644 |
| --- a/librdmacm/preload.c |
| +++ b/librdmacm/preload.c |
| @@ -59,6 +59,12 @@ |
| #include "cma.h" |
| #include "indexer.h" |
| |
| +#ifdef __clang__ |
| +#define OVERLOAD __attribute__((overloadable)) |
| +#else |
| +#define OVERLOAD |
| +#endif |
| + |
| struct socket_calls { |
| int (*socket)(int domain, int type, int protocol); |
| int (*bind)(int socket, const struct sockaddr *addr, socklen_t addrlen); |
| @@ -793,7 +799,7 @@ ssize_t recv(int socket, void *buf, size_t len, int flags) |
| rrecv(fd, buf, len, flags) : real.recv(fd, buf, len, flags); |
| } |
| |
| -ssize_t recvfrom(int socket, void *buf, size_t len, int flags, |
| +ssize_t OVERLOAD recvfrom(int socket, void *buf, size_t len, int flags, |
| struct sockaddr *src_addr, socklen_t *addrlen) |
| { |
| int fd; |
| -- |
| 2.25.0 |
| |