test: Add mocks for sendmsg and recvmsg

These will be used from the posix sock layer.

Change-Id: I6427d9e9aee889e11ba7e36876112a5aba449e31
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/471751
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Ben Walker 2019-10-17 13:58:46 -07:00 committed by Jim Harris
parent e58deb0257
commit 913f780e10
3 changed files with 11 additions and 0 deletions

View File

@ -116,6 +116,10 @@ DECLARE_WRAPPER(pthread_mutex_init, int,
DECLARE_WRAPPER(pthread_mutexattr_init, int,
(pthread_mutexattr_t *attr));
DECLARE_WRAPPER(recvmsg, ssize_t, (int sockfd, struct msghdr *msg, int flags));
DECLARE_WRAPPER(sendmsg, ssize_t, (int sockfd, const struct msghdr *msg, int flags));
DECLARE_WRAPPER(writev, ssize_t, (int fd, const struct iovec *iov, int iovcnt));
#endif /* SPDK_INTERNAL_MOCK_H */

View File

@ -42,4 +42,9 @@ DEFINE_WRAPPER(pthread_mutex_init, int,
DEFINE_WRAPPER(pthread_mutexattr_init, int,
(pthread_mutexattr_t *attr), (attr))
DEFINE_WRAPPER(recvmsg, ssize_t, (int sockfd, struct msghdr *msg, int flags), (sockfd, msg, flags))
DEFINE_WRAPPER(sendmsg, ssize_t, (int sockfd, const struct msghdr *msg, int flags), (sockfd, msg,
flags))
DEFINE_WRAPPER(writev, ssize_t, (int fd, const struct iovec *iov, int iovcnt), (fd, iov, iovcnt))

View File

@ -34,4 +34,6 @@ LDFLAGS += \
-Wl,--wrap,calloc \
-Wl,--wrap,pthread_mutexattr_init \
-Wl,--wrap,pthread_mutex_init \
-Wl,--wrap,recvmsg \
-Wl,--wrap,sendmsg \
-Wl,--wrap,writev