blob: 6b349c6092ffee3be0be76b4ff85d5493c418c64 [file] [log] [blame]
Willy Tarreaubaaee002006-06-26 02:48:02 +02001/*
2 include/proto/polling.h
3 Polling functions.
4
5 Copyright (C) 2000-2006 Willy Tarreau - w@1wt.eu
6
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
10 exclusively.
11
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.
16
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
20*/
21
22#ifndef _PROTO_POLLING_H
23#define _PROTO_POLLING_H
24
25#include <types/polling.h>
26
27/*
28 * Main select() loop.
29 * does 3 actions :
30 * 0 (POLL_LOOP_ACTION_INIT) : initializes necessary private structures
31 * 1 (POLL_LOOP_ACTION_RUN) : runs the loop
32 * 2 (POLL_LOOP_ACTION_CLEAN) : cleans up
33 *
34 * returns 0 if initialization failed, !0 otherwise.
35 */
36int select_loop(int action);
37
38#if defined(ENABLE_POLL)
39/*
40 * Main poll() loop.
41 * does 3 actions :
42 * 0 (POLL_LOOP_ACTION_INIT) : initializes necessary private structures
43 * 1 (POLL_LOOP_ACTION_RUN) : runs the loop
44 * 2 (POLL_LOOP_ACTION_CLEAN) : cleans up
45 *
46 * returns 0 if initialization failed, !0 otherwise.
47 */
48int poll_loop(int action);
49#endif
50
51#if defined(ENABLE_EPOLL)
52/*
53 * Main epoll() loop.
54 * does 3 actions :
55 * 0 (POLL_LOOP_ACTION_INIT) : initializes necessary private structures
56 * 1 (POLL_LOOP_ACTION_RUN) : runs the loop
57 * 2 (POLL_LOOP_ACTION_CLEAN) : cleans up
58 *
59 * returns 0 if initialization failed, !0 otherwise.
60 */
61int epoll_loop(int action);
62#endif
63
64
65#endif /* _PROTO_POLLING_H */
66
67/*
68 * Local variables:
69 * c-indent-level: 8
70 * c-basic-offset: 8
71 * End:
72 */