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