Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 1 | /* |
| 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 | |
Willy Tarreau | e3ba5f0 | 2006-06-29 18:54:54 +0200 | [diff] [blame] | 25 | #include <common/config.h> |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 26 | #include <types/polling.h> |
| 27 | |
| 28 | /* |
| 29 | * Main select() loop. |
| 30 | * does 3 actions : |
| 31 | * 0 (POLL_LOOP_ACTION_INIT) : initializes necessary private structures |
| 32 | * 1 (POLL_LOOP_ACTION_RUN) : runs the loop |
| 33 | * 2 (POLL_LOOP_ACTION_CLEAN) : cleans up |
| 34 | * |
| 35 | * returns 0 if initialization failed, !0 otherwise. |
| 36 | */ |
| 37 | int select_loop(int action); |
| 38 | |
| 39 | #if defined(ENABLE_POLL) |
| 40 | /* |
| 41 | * Main poll() loop. |
| 42 | * does 3 actions : |
| 43 | * 0 (POLL_LOOP_ACTION_INIT) : initializes necessary private structures |
| 44 | * 1 (POLL_LOOP_ACTION_RUN) : runs the loop |
| 45 | * 2 (POLL_LOOP_ACTION_CLEAN) : cleans up |
| 46 | * |
| 47 | * returns 0 if initialization failed, !0 otherwise. |
| 48 | */ |
| 49 | int poll_loop(int action); |
| 50 | #endif |
| 51 | |
| 52 | #if defined(ENABLE_EPOLL) |
| 53 | /* |
| 54 | * Main epoll() loop. |
| 55 | * does 3 actions : |
| 56 | * 0 (POLL_LOOP_ACTION_INIT) : initializes necessary private structures |
| 57 | * 1 (POLL_LOOP_ACTION_RUN) : runs the loop |
| 58 | * 2 (POLL_LOOP_ACTION_CLEAN) : cleans up |
| 59 | * |
| 60 | * returns 0 if initialization failed, !0 otherwise. |
| 61 | */ |
| 62 | int epoll_loop(int action); |
| 63 | #endif |
| 64 | |
| 65 | |
| 66 | #endif /* _PROTO_POLLING_H */ |
| 67 | |
| 68 | /* |
| 69 | * Local variables: |
| 70 | * c-indent-level: 8 |
| 71 | * c-basic-offset: 8 |
| 72 | * End: |
| 73 | */ |