My Project
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
epollops.h
Go to the documentation of this file.
1 /*
2 START OF LICENSE STUB
3  DeDOS: Declarative Dispersion-Oriented Software
4  Copyright (C) 2017 University of Pennsylvania, Georgetown University
5 
6  This program is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
18 END OF LICENSE STUB
19 */
26 #ifndef EPOLL_OPS_H
27 #define EPOLL_OPS_H
28 #include <stdint.h>
29 #include <stdbool.h>
30 
39 int enable_epoll(int epoll_fd, int new_fd, uint32_t events);
40 
49 int add_to_epoll(int epoll_fd, int new_fd, uint32_t events, bool oneshot);
50 
67 int epoll_loop(int socket_fd, int epoll_fd, int batch_size, int timeout,
68  bool oneshot,
69  int (*connection_handler)(int, void*),
70  int (*accept_handler)(int, void*),
71  void *data);
72 
80 int init_epoll(int socket_fd);
81 
82 #endif
int epoll_fd
The epoll file descriptor monitoring sockets.
int init_epoll(int socket_fd)
Initializes a new instance of an epoll file descriptor and adds a socket to it, listening for input o...
Definition: epollops.c:182
int epoll_loop(int socket_fd, int epoll_fd, int batch_size, int timeout, bool oneshot, int(*connection_handler)(int, void *), int(*accept_handler)(int, void *), void *data)
The event-based loop for epoll_wait.
Definition: epollops.c:132
int add_to_epoll(int epoll_fd, int new_fd, uint32_t events, bool oneshot)
Adds a file descriptor to an epoll instance.
Definition: epollops.c:59
unsigned int uint32_t
Definition: uthash.h:96
int enable_epoll(int epoll_fd, int new_fd, uint32_t events)
Enables a file descriptor which has already been aded to an epoll instance.
Definition: epollops.c:42