-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtesting.c
More file actions
47 lines (35 loc) · 918 Bytes
/
testing.c
File metadata and controls
47 lines (35 loc) · 918 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/uio.h>
#include <sys/time.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <strings.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <sys/select.h>
#define send send
#define bind bind
#define recv recv
#define select select
ssize_t mySend(int sockfd, const void *buf, size_t len, int flags)
{
return(send(sockfd, buf, len, flags));
}
ssize_t myRecv(int sockfd, void *buf, size_t len, int flags)
{
return(recv(sockfd, buf, len, flags));
}
int myBind(int sockfd, const struct sockaddr *addr, socklen_t addrlen)
{
return(bind(sockfd, addr, addrlen));
}
int mySelect(int nfds, fd_set *readfds, fd_set *writefds,
fd_set *exceptfds, struct timeval *timeout)
{
return(select(nfds, readfds, writefds, exceptfds, timeout));
}