-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommon.h
More file actions
27 lines (22 loc) · 689 Bytes
/
common.h
File metadata and controls
27 lines (22 loc) · 689 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
#include <sys/epoll.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <fcntl.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <unistd.h>
#include <errno.h>
#define IF(x, msg, then_do) \
if (x) \
{ \
perror(msg); \
then_do; \
}
int epoll_del_event(int epfd, int sock);
int epoll_add_event(int epfd, int sock, uint32_t flags);
int viva_listen(int port);
int viva_epoll_init(int sock);
int viva_wait_epoll_events(int lfd, int epfd, struct epoll_event *events, int max_events, int timeout);
int viva_make_socket_non_blocking(int fd);
int viva_accept_new_incom(int lsock);