]>
Commit | Line | Data |
---|---|---|
1e6d2d09 VD |
1 | /***************************************************************************** |
2 | Copyright (c) 2006 EMC Corporation. | |
3 | Copyright (c) 2011 Factor-SPE | |
4 | ||
5 | This program is free software; you can redistribute it and/or modify it | |
6 | under the terms of the GNU General Public License as published by the Free | |
7 | Software Foundation; either version 2 of the License, or (at your option) | |
8 | any later version. | |
9 | ||
10 | This program is distributed in the hope that it will be useful, but WITHOUT | |
11 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
12 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | |
13 | more details. | |
14 | ||
15 | You should have received a copy of the GNU General Public License along with | |
16 | this program; if not, write to the Free Software Foundation, Inc., 59 | |
17 | Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
18 | ||
19 | The full GNU General Public License is included in this distribution in the | |
20 | file called LICENSE. | |
21 | ||
22 | Authors: Srinivas Aji <Aji_Srinivas@emc.com> | |
23 | Authors: Vitalii Demianets <vitas@nppfactor.kiev.ua> | |
24 | ||
25 | ******************************************************************************/ | |
26 | ||
27 | #ifndef EPOLL_LOOP_H | |
28 | #define EPOLL_LOOP_H | |
29 | ||
30 | #include <sys/epoll.h> | |
31 | #include <errno.h> | |
32 | #include <sys/time.h> | |
33 | ||
34 | struct epoll_event_handler | |
35 | { | |
36 | int fd; | |
37 | void *arg; | |
38 | void (*handler) (uint32_t events, struct epoll_event_handler * p); | |
39 | struct epoll_event *ref_ev; /* if set, epoll loop has reference to this, | |
40 | so mark that ref as NULL while freeing */ | |
41 | }; | |
42 | ||
43 | int init_epoll(void); | |
44 | ||
45 | void clear_epoll(void); | |
46 | ||
47 | int epoll_main_loop(void); | |
48 | ||
49 | int add_epoll(struct epoll_event_handler *h); | |
50 | ||
51 | int remove_epoll(struct epoll_event_handler *h); | |
52 | ||
53 | #endif /* EPOLL_LOOP_H */ |