26 #include <arpa/inet.h>
31 #include <sys/socket.h>
32 #include <sys/types.h>
36 #define MOCK_SYSCALL(ret, name, ARG_TYPES, ARG_NAMES) \
37 extern ret(*fake_##name) ARG_TYPES; \
38 extern int name##_calls; \
39 ret count_##name ARG_TYPES;
40 #endif // MOCK_SYSCALL
48 (
int sockfd,
struct sockaddr* addr, socklen_t* addrlen),
49 (sockfd, addr, addrlen));
52 (
int sockfd,
const struct sockaddr* addr, socklen_t addrlen),
53 (sockfd, addr, addrlen));
57 (
int sockfd,
const struct sockaddr* addr, socklen_t addrlen),
58 (sockfd, addr, addrlen));
63 const struct addrinfo* hints,
64 struct addrinfo** res),
65 (node, service, hints, res));
68 (
int sockfd,
struct sockaddr* addr, socklen_t* addrlen),
69 (sockfd, addr, addrlen));
70 MOCK_SYSCALL(
int, listen, (
int sockfd,
int backlog), (sockfd, backlog));
73 (
int fd,
void* buf,
size_t count),
78 (
int sockfd,
int level,
int optname,
const void* optval, socklen_t optlen),
79 (sockfd, level, optname, optval, optlen));
86 struct timeval* timeout),
87 (nfds, readfds, writefds, exceptfds, timeout));
90 (
int domain,
int type,
int protocol),
91 (domain, type, protocol));
94 (
int fd,
const void* buf,
size_t count),
99 extern int (*
fake_fcntl)(
int fd,
int cmd,
unsigned long);
101 int count_fcntl(
int fd,
int cmd,
unsigned long arg);