3
File descriptors states.
5
Copyright (C) 2000-2007 Willy Tarreau - w@1wt.eu
7
This library is free software; you can redistribute it and/or
8
modify it under the terms of the GNU Lesser General Public
9
License as published by the Free Software Foundation, version 2.1
12
This library is distributed in the hope that it will be useful,
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
Lesser General Public License for more details.
17
You should have received a copy of the GNU Lesser General Public
18
License along with this library; if not, write to the Free Software
19
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
27
#include <sys/types.h>
30
#include <common/config.h>
33
/* Deletes an FD from the fdsets, and recomputes the maxfd limit.
34
* The file descriptor is also closed.
36
void fd_delete(int fd);
38
/* disable the specified poller */
39
void disable_poller(const char *poller_name);
42
* Initialize the pollers till the best one is found.
43
* If none works, returns 0, otherwise 1.
44
* The pollers register themselves just before main() is called.
49
* Some pollers may lose their connection after a fork(). It may be necessary
50
* to create initialize part of them again. Returns 0 in case of failure,
51
* otherwise 1. The fork() function may be NULL if unused. In case of error,
52
* the the current poller is destroyed and the caller is responsible for trying
53
* another one by calling init_pollers() again.
58
* Lists the known pollers on <out>.
59
* Should be performed only before initialization.
61
int list_pollers(FILE *out);
64
* Runs the polling loop
68
#define EV_FD_SET(fd, ev) (cur_poller.set((fd), (ev)))
69
#define EV_FD_CLR(fd, ev) (cur_poller.clr((fd), (ev)))
70
#define EV_FD_ISSET(fd, ev) (cur_poller.is_set((fd), (ev)))
71
#define EV_FD_COND_S(fd, ev) (cur_poller.cond_s((fd), (ev)))
72
#define EV_FD_COND_C(fd, ev) (cur_poller.cond_c((fd), (ev)))
73
#define EV_FD_REM(fd) (cur_poller.rem(fd))
74
#define EV_FD_CLO(fd) (cur_poller.clo(fd))
77
/* recomputes the maxfd limit from the fd */
78
static inline void fd_insert(int fd)
85
#endif /* _PROTO_FD_H */