Willy Tarreau | 4f60f16 | 2007-04-08 16:39:58 +0200 | [diff] [blame] | 1 | /* |
| 2 | * FD polling functions for linux epoll() |
| 3 | * |
| 4 | * Copyright 2000-2007 Willy Tarreau <w@1wt.eu> |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU General Public License |
| 8 | * as published by the Free Software Foundation; either version |
| 9 | * 2 of the License, or (at your option) any later version. |
| 10 | * |
| 11 | */ |
| 12 | |
| 13 | #include <unistd.h> |
| 14 | #include <sys/time.h> |
| 15 | #include <sys/types.h> |
| 16 | |
| 17 | #include <common/compat.h> |
| 18 | #include <common/config.h> |
Willy Tarreau | 58094f2 | 2007-04-10 01:33:20 +0200 | [diff] [blame] | 19 | #include <common/standard.h> |
Willy Tarreau | 4f60f16 | 2007-04-08 16:39:58 +0200 | [diff] [blame] | 20 | #include <common/time.h> |
| 21 | |
| 22 | #include <types/fd.h> |
| 23 | #include <types/global.h> |
| 24 | |
| 25 | #include <proto/fd.h> |
Willy Tarreau | 4f60f16 | 2007-04-08 16:39:58 +0200 | [diff] [blame] | 26 | #include <proto/task.h> |
| 27 | |
| 28 | #if defined(USE_MY_EPOLL) |
Willy Tarreau | 69801b8 | 2007-04-09 15:28:51 +0200 | [diff] [blame] | 29 | #include <common/epoll.h> |
Willy Tarreau | 4f60f16 | 2007-04-08 16:39:58 +0200 | [diff] [blame] | 30 | #include <errno.h> |
| 31 | #include <sys/syscall.h> |
Willy Tarreau | b40d420 | 2007-04-15 23:57:41 +0200 | [diff] [blame] | 32 | static _syscall1 (int, epoll_create, int, size); |
| 33 | static _syscall4 (int, epoll_ctl, int, epfd, int, op, int, fd, struct epoll_event *, event); |
| 34 | static _syscall4 (int, epoll_wait, int, epfd, struct epoll_event *, events, int, maxevents, int, timeout); |
Willy Tarreau | 69801b8 | 2007-04-09 15:28:51 +0200 | [diff] [blame] | 35 | #else |
| 36 | #include <sys/epoll.h> |
Willy Tarreau | 4f60f16 | 2007-04-08 16:39:58 +0200 | [diff] [blame] | 37 | #endif |
| 38 | |
Willy Tarreau | 58094f2 | 2007-04-10 01:33:20 +0200 | [diff] [blame] | 39 | /* This is what we store in a list. It consists in old values and fds to detect changes. */ |
| 40 | struct fd_chg { |
| 41 | unsigned int prev:2; // previous state mask. New one is in fd_evts. |
| 42 | unsigned int fd:30; // file descriptor |
| 43 | }; |
Willy Tarreau | 4f60f16 | 2007-04-08 16:39:58 +0200 | [diff] [blame] | 44 | |
Willy Tarreau | 58094f2 | 2007-04-10 01:33:20 +0200 | [diff] [blame] | 45 | static int nbchanges = 0; // number of changes pending |
| 46 | static struct fd_chg *chg_list = NULL; // list of changes |
| 47 | static struct fd_chg **chg_ptr = NULL; // per-fd changes |
| 48 | |
| 49 | /* Each 32-bit word contains 2-bit descriptors of the latest state for 16 FDs : |
| 50 | * desc = (u32 >> (2*fd)) & 3 |
| 51 | * desc = 0 : FD not set |
| 52 | * 1 : WRITE not set, READ set |
| 53 | * 2 : WRITE set, READ not set |
| 54 | * 3 : WRITE set, READ set |
| 55 | */ |
| 56 | |
| 57 | static uint32_t *fd_evts; |
Willy Tarreau | 4f60f16 | 2007-04-08 16:39:58 +0200 | [diff] [blame] | 58 | |
| 59 | /* private data */ |
| 60 | static struct epoll_event *epoll_events; |
| 61 | static int epoll_fd; |
| 62 | |
Willy Tarreau | 58094f2 | 2007-04-10 01:33:20 +0200 | [diff] [blame] | 63 | /* This structure may be used for any purpose. Warning! do not use it in |
| 64 | * recursive functions ! |
| 65 | */ |
| 66 | static struct epoll_event ev; |
| 67 | |
| 68 | /* converts a direction to a single bitmask. |
| 69 | * 0 => 1 |
| 70 | * 1 => 2 |
| 71 | */ |
| 72 | #define DIR2MSK(dir) ((dir) + 1) |
| 73 | |
| 74 | /* converts an FD to an fd_evts offset and to a bit shift */ |
| 75 | #define FD2OFS(fd) ((uint32_t)(fd) >> 4) |
| 76 | #define FD2BIT(fd) (((uint32_t)(fd) & 0xF) << 1) |
| 77 | #define FD2MSK(fd) (3 << FD2BIT(fd)) |
Willy Tarreau | 4f60f16 | 2007-04-08 16:39:58 +0200 | [diff] [blame] | 78 | |
| 79 | /* |
Willy Tarreau | 58094f2 | 2007-04-10 01:33:20 +0200 | [diff] [blame] | 80 | * Returns non-zero if direction <dir> is already set for <fd>. |
Willy Tarreau | 4f60f16 | 2007-04-08 16:39:58 +0200 | [diff] [blame] | 81 | */ |
Willy Tarreau | 63455a9 | 2007-04-09 15:34:49 +0200 | [diff] [blame] | 82 | REGPRM2 static int __fd_is_set(const int fd, int dir) |
Willy Tarreau | 4f60f16 | 2007-04-08 16:39:58 +0200 | [diff] [blame] | 83 | { |
Willy Tarreau | 58094f2 | 2007-04-10 01:33:20 +0200 | [diff] [blame] | 84 | return (fd_evts[FD2OFS(fd)] >> FD2BIT(fd)) & DIR2MSK(dir); |
Willy Tarreau | 4f60f16 | 2007-04-08 16:39:58 +0200 | [diff] [blame] | 85 | } |
| 86 | |
Willy Tarreau | 58094f2 | 2007-04-10 01:33:20 +0200 | [diff] [blame] | 87 | /* |
| 88 | * Adds, mods or deletes <fd> according to current status and to new desired |
| 89 | * mask <dmask> : |
| 90 | * |
| 91 | * 0 = nothing |
| 92 | * 1 = EPOLLIN |
| 93 | * 2 = EPOLLOUT |
| 94 | * 3 = EPOLLIN | EPOLLOUT |
| 95 | * |
| 96 | */ |
| 97 | static int dmsk2event[4] = { 0, EPOLLIN, EPOLLOUT, EPOLLIN | EPOLLOUT }; |
| 98 | |
| 99 | |
| 100 | REGPRM2 static void fd_flush_changes() |
Willy Tarreau | 4f60f16 | 2007-04-08 16:39:58 +0200 | [diff] [blame] | 101 | { |
Willy Tarreau | 58094f2 | 2007-04-10 01:33:20 +0200 | [diff] [blame] | 102 | uint32_t ofs; |
| 103 | int opcode; |
| 104 | int prev, next; |
| 105 | int chg, fd; |
| 106 | |
| 107 | for (chg = 0; chg < nbchanges; chg++) { |
| 108 | prev = chg_list[chg].prev; |
| 109 | fd = chg_list[chg].fd; |
| 110 | chg_ptr[fd] = NULL; |
| 111 | |
| 112 | ofs = FD2OFS(fd); |
| 113 | next = (fd_evts[ofs] >> FD2BIT(fd)) & 3; |
| 114 | |
| 115 | if (prev == next) |
| 116 | /* if the value was unchanged, do nothing */ |
| 117 | continue; |
| 118 | |
| 119 | ev.events = dmsk2event[next]; |
| 120 | ev.data.fd = fd; |
| 121 | |
| 122 | if (prev) { |
| 123 | if (!next) { |
| 124 | /* we want to delete it now */ |
| 125 | opcode = EPOLL_CTL_DEL; |
| 126 | } else { |
| 127 | /* we want to switch it */ |
| 128 | opcode = EPOLL_CTL_MOD; |
| 129 | } |
| 130 | } else { |
| 131 | /* the FD did not exist, let's add it */ |
| 132 | opcode = EPOLL_CTL_ADD; |
| 133 | } |
| 134 | |
| 135 | epoll_ctl(epoll_fd, opcode, fd, &ev); |
| 136 | } |
| 137 | nbchanges = 0; |
Willy Tarreau | 4f60f16 | 2007-04-08 16:39:58 +0200 | [diff] [blame] | 138 | } |
| 139 | |
Willy Tarreau | 58094f2 | 2007-04-10 01:33:20 +0200 | [diff] [blame] | 140 | REGPRM2 static void alloc_chg_list(const int fd, int old_evt) |
Willy Tarreau | 4f60f16 | 2007-04-08 16:39:58 +0200 | [diff] [blame] | 141 | { |
Willy Tarreau | 58094f2 | 2007-04-10 01:33:20 +0200 | [diff] [blame] | 142 | struct fd_chg *ptr; |
| 143 | |
| 144 | if (unlikely(chg_ptr[fd])) |
| 145 | return; |
| 146 | |
| 147 | #if LIMIT_NUMBER_OF_CHANGES |
| 148 | if (nbchanges > 2) |
| 149 | fd_flush_changes(); |
| 150 | #endif |
| 151 | |
| 152 | ptr = &chg_list[nbchanges++]; |
| 153 | chg_ptr[fd] = ptr; |
| 154 | ptr->fd = fd; |
| 155 | ptr->prev = old_evt; |
Willy Tarreau | 4f60f16 | 2007-04-08 16:39:58 +0200 | [diff] [blame] | 156 | } |
| 157 | |
Willy Tarreau | 58094f2 | 2007-04-10 01:33:20 +0200 | [diff] [blame] | 158 | REGPRM2 static int __fd_set(const int fd, int dir) |
Willy Tarreau | 4f60f16 | 2007-04-08 16:39:58 +0200 | [diff] [blame] | 159 | { |
Willy Tarreau | 58094f2 | 2007-04-10 01:33:20 +0200 | [diff] [blame] | 160 | uint32_t ofs = FD2OFS(fd); |
| 161 | uint32_t dmsk = DIR2MSK(dir); |
| 162 | uint32_t old_evt; |
| 163 | |
| 164 | old_evt = fd_evts[ofs] >> FD2BIT(fd); |
| 165 | old_evt &= 3; |
| 166 | if (unlikely(old_evt & dmsk)) |
| 167 | return 0; |
| 168 | |
| 169 | alloc_chg_list(fd, old_evt); |
| 170 | dmsk <<= FD2BIT(fd); |
| 171 | fd_evts[ofs] |= dmsk; |
| 172 | return 1; |
Willy Tarreau | 4f60f16 | 2007-04-08 16:39:58 +0200 | [diff] [blame] | 173 | } |
| 174 | |
Willy Tarreau | 58094f2 | 2007-04-10 01:33:20 +0200 | [diff] [blame] | 175 | REGPRM2 static int __fd_clr(const int fd, int dir) |
Willy Tarreau | 4f60f16 | 2007-04-08 16:39:58 +0200 | [diff] [blame] | 176 | { |
Willy Tarreau | 58094f2 | 2007-04-10 01:33:20 +0200 | [diff] [blame] | 177 | uint32_t ofs = FD2OFS(fd); |
| 178 | uint32_t dmsk = DIR2MSK(dir); |
| 179 | uint32_t old_evt; |
| 180 | |
| 181 | old_evt = fd_evts[ofs] >> FD2BIT(fd); |
| 182 | old_evt &= 3; |
| 183 | if (unlikely(!(old_evt & dmsk))) |
| 184 | return 0; |
| 185 | |
| 186 | alloc_chg_list(fd, old_evt); |
| 187 | dmsk <<= FD2BIT(fd); |
| 188 | fd_evts[ofs] &= ~dmsk; |
| 189 | return 1; |
Willy Tarreau | 4f60f16 | 2007-04-08 16:39:58 +0200 | [diff] [blame] | 190 | } |
| 191 | |
Willy Tarreau | 58094f2 | 2007-04-10 01:33:20 +0200 | [diff] [blame] | 192 | REGPRM1 static void __fd_rem(int fd) |
Willy Tarreau | 4f60f16 | 2007-04-08 16:39:58 +0200 | [diff] [blame] | 193 | { |
Willy Tarreau | 58094f2 | 2007-04-10 01:33:20 +0200 | [diff] [blame] | 194 | uint32_t ofs = FD2OFS(fd); |
| 195 | |
| 196 | if (unlikely(!((fd_evts[ofs] >> FD2BIT(fd)) & 3))) |
| 197 | return; |
| 198 | |
| 199 | alloc_chg_list(fd, 0); |
| 200 | fd_evts[ofs] &= ~FD2MSK(fd); |
| 201 | return; |
Willy Tarreau | 4f60f16 | 2007-04-08 16:39:58 +0200 | [diff] [blame] | 202 | } |
| 203 | |
Willy Tarreau | 58094f2 | 2007-04-10 01:33:20 +0200 | [diff] [blame] | 204 | /* |
| 205 | * On valid epoll() implementations, a call to close() automatically removes |
| 206 | * the fds. This means that the FD will appear as previously unset. |
| 207 | */ |
| 208 | REGPRM1 static void __fd_clo(int fd) |
Willy Tarreau | 4f60f16 | 2007-04-08 16:39:58 +0200 | [diff] [blame] | 209 | { |
Willy Tarreau | 58094f2 | 2007-04-10 01:33:20 +0200 | [diff] [blame] | 210 | struct fd_chg *ptr; |
| 211 | fd_evts[FD2OFS(fd)] &= ~FD2MSK(fd); |
| 212 | ptr = chg_ptr[fd]; |
| 213 | if (ptr) { |
| 214 | ptr->prev = 0; |
| 215 | chg_ptr[fd] = NULL; |
| 216 | } |
| 217 | return; |
Willy Tarreau | 4f60f16 | 2007-04-08 16:39:58 +0200 | [diff] [blame] | 218 | } |
| 219 | |
Willy Tarreau | 4f60f16 | 2007-04-08 16:39:58 +0200 | [diff] [blame] | 220 | /* |
| 221 | * epoll() poller |
| 222 | */ |
Willy Tarreau | ef1d1f8 | 2007-04-16 00:25:25 +0200 | [diff] [blame] | 223 | REGPRM2 static void _do_poll(struct poller *p, int wait_time) |
Willy Tarreau | 4f60f16 | 2007-04-08 16:39:58 +0200 | [diff] [blame] | 224 | { |
| 225 | int status; |
| 226 | int fd; |
Willy Tarreau | 58094f2 | 2007-04-10 01:33:20 +0200 | [diff] [blame] | 227 | int count; |
Willy Tarreau | 4f60f16 | 2007-04-08 16:39:58 +0200 | [diff] [blame] | 228 | |
Willy Tarreau | 58094f2 | 2007-04-10 01:33:20 +0200 | [diff] [blame] | 229 | if (likely(nbchanges)) |
| 230 | fd_flush_changes(); |
Willy Tarreau | 4f60f16 | 2007-04-08 16:39:58 +0200 | [diff] [blame] | 231 | |
Willy Tarreau | 4f60f16 | 2007-04-08 16:39:58 +0200 | [diff] [blame] | 232 | /* now let's wait for events */ |
| 233 | status = epoll_wait(epoll_fd, epoll_events, maxfd, wait_time); |
| 234 | tv_now(&now); |
| 235 | |
| 236 | for (count = 0; count < status; count++) { |
| 237 | fd = epoll_events[count].data.fd; |
| 238 | |
Willy Tarreau | 58094f2 | 2007-04-10 01:33:20 +0200 | [diff] [blame] | 239 | if ((fd_evts[FD2OFS(fd)] >> FD2BIT(fd)) & DIR2MSK(DIR_RD)) { |
Willy Tarreau | 4f60f16 | 2007-04-08 16:39:58 +0200 | [diff] [blame] | 240 | if (fdtab[fd].state == FD_STCLOSE) |
| 241 | continue; |
| 242 | if (epoll_events[count].events & ( EPOLLIN | EPOLLERR | EPOLLHUP )) |
| 243 | fdtab[fd].cb[DIR_RD].f(fd); |
| 244 | } |
| 245 | |
Willy Tarreau | 58094f2 | 2007-04-10 01:33:20 +0200 | [diff] [blame] | 246 | if ((fd_evts[FD2OFS(fd)] >> FD2BIT(fd)) & DIR2MSK(DIR_WR)) { |
Willy Tarreau | 4f60f16 | 2007-04-08 16:39:58 +0200 | [diff] [blame] | 247 | if (fdtab[fd].state == FD_STCLOSE) |
| 248 | continue; |
| 249 | if (epoll_events[count].events & ( EPOLLOUT | EPOLLERR | EPOLLHUP )) |
| 250 | fdtab[fd].cb[DIR_WR].f(fd); |
| 251 | } |
| 252 | } |
| 253 | } |
| 254 | |
| 255 | /* |
Willy Tarreau | e54e917 | 2007-04-09 09:23:31 +0200 | [diff] [blame] | 256 | * Initialization of the epoll() poller. |
| 257 | * Returns 0 in case of failure, non-zero in case of success. If it fails, it |
| 258 | * disables the poller by setting its pref to 0. |
| 259 | */ |
Willy Tarreau | ef1d1f8 | 2007-04-16 00:25:25 +0200 | [diff] [blame] | 260 | REGPRM1 static int _do_init(struct poller *p) |
Willy Tarreau | e54e917 | 2007-04-09 09:23:31 +0200 | [diff] [blame] | 261 | { |
Willy Tarreau | 58094f2 | 2007-04-10 01:33:20 +0200 | [diff] [blame] | 262 | __label__ fail_chg_ptr, fail_chg_list, fail_fdevt, fail_ee, fail_fd; |
Willy Tarreau | e54e917 | 2007-04-09 09:23:31 +0200 | [diff] [blame] | 263 | int fd_set_bytes; |
| 264 | |
| 265 | p->private = NULL; |
Willy Tarreau | 58094f2 | 2007-04-10 01:33:20 +0200 | [diff] [blame] | 266 | fd_set_bytes = 4 * (global.maxsock + 15) / 16; |
Willy Tarreau | e54e917 | 2007-04-09 09:23:31 +0200 | [diff] [blame] | 267 | |
| 268 | epoll_fd = epoll_create(global.maxsock + 1); |
| 269 | if (epoll_fd < 0) |
| 270 | goto fail_fd; |
| 271 | |
| 272 | epoll_events = (struct epoll_event*) |
| 273 | calloc(1, sizeof(struct epoll_event) * global.maxsock); |
| 274 | |
| 275 | if (epoll_events == NULL) |
| 276 | goto fail_ee; |
| 277 | |
Willy Tarreau | 58094f2 | 2007-04-10 01:33:20 +0200 | [diff] [blame] | 278 | if ((fd_evts = (uint32_t *)calloc(1, fd_set_bytes)) == NULL) |
| 279 | goto fail_fdevt; |
Willy Tarreau | e54e917 | 2007-04-09 09:23:31 +0200 | [diff] [blame] | 280 | |
Willy Tarreau | 58094f2 | 2007-04-10 01:33:20 +0200 | [diff] [blame] | 281 | chg_list = (struct fd_chg *)calloc(1, sizeof(struct fd_chg) * global.maxsock); |
| 282 | if (chg_list == NULL) |
| 283 | goto fail_chg_list; |
Willy Tarreau | e54e917 | 2007-04-09 09:23:31 +0200 | [diff] [blame] | 284 | |
Willy Tarreau | 58094f2 | 2007-04-10 01:33:20 +0200 | [diff] [blame] | 285 | chg_ptr = (struct fd_chg **)calloc(1, sizeof(struct fd_chg*) * global.maxsock); |
| 286 | if (chg_ptr == NULL) |
| 287 | goto fail_chg_ptr; |
Willy Tarreau | e54e917 | 2007-04-09 09:23:31 +0200 | [diff] [blame] | 288 | |
| 289 | return 1; |
| 290 | |
Willy Tarreau | 58094f2 | 2007-04-10 01:33:20 +0200 | [diff] [blame] | 291 | fail_chg_ptr: |
| 292 | free(chg_list); |
| 293 | fail_chg_list: |
| 294 | free(fd_evts); |
| 295 | fail_fdevt: |
Willy Tarreau | e54e917 | 2007-04-09 09:23:31 +0200 | [diff] [blame] | 296 | free(epoll_events); |
| 297 | fail_ee: |
| 298 | close(epoll_fd); |
| 299 | epoll_fd = 0; |
| 300 | fail_fd: |
| 301 | p->pref = 0; |
| 302 | return 0; |
| 303 | } |
| 304 | |
| 305 | /* |
| 306 | * Termination of the epoll() poller. |
| 307 | * Memory is released and the poller is marked as unselectable. |
| 308 | */ |
Willy Tarreau | ef1d1f8 | 2007-04-16 00:25:25 +0200 | [diff] [blame] | 309 | REGPRM1 static void _do_term(struct poller *p) |
Willy Tarreau | e54e917 | 2007-04-09 09:23:31 +0200 | [diff] [blame] | 310 | { |
Willy Tarreau | 58094f2 | 2007-04-10 01:33:20 +0200 | [diff] [blame] | 311 | fd_flush_changes(); |
Willy Tarreau | e54e917 | 2007-04-09 09:23:31 +0200 | [diff] [blame] | 312 | |
Willy Tarreau | 58094f2 | 2007-04-10 01:33:20 +0200 | [diff] [blame] | 313 | if (chg_ptr) |
| 314 | free(chg_ptr); |
| 315 | if (chg_list) |
| 316 | free(chg_list); |
| 317 | if (fd_evts) |
| 318 | free(fd_evts); |
Willy Tarreau | e54e917 | 2007-04-09 09:23:31 +0200 | [diff] [blame] | 319 | if (epoll_events) |
| 320 | free(epoll_events); |
| 321 | |
| 322 | close(epoll_fd); |
| 323 | epoll_fd = 0; |
| 324 | |
Willy Tarreau | 58094f2 | 2007-04-10 01:33:20 +0200 | [diff] [blame] | 325 | chg_ptr = NULL; |
| 326 | chg_list = NULL; |
| 327 | fd_evts = NULL; |
| 328 | epoll_events = NULL; |
| 329 | |
Willy Tarreau | e54e917 | 2007-04-09 09:23:31 +0200 | [diff] [blame] | 330 | p->private = NULL; |
| 331 | p->pref = 0; |
| 332 | } |
| 333 | |
| 334 | /* |
Willy Tarreau | 2ff7622 | 2007-04-09 19:29:56 +0200 | [diff] [blame] | 335 | * Check that the poller works. |
| 336 | * Returns 1 if OK, otherwise 0. |
| 337 | */ |
Willy Tarreau | ef1d1f8 | 2007-04-16 00:25:25 +0200 | [diff] [blame] | 338 | REGPRM1 static int _do_test(struct poller *p) |
Willy Tarreau | 2ff7622 | 2007-04-09 19:29:56 +0200 | [diff] [blame] | 339 | { |
| 340 | int fd; |
| 341 | |
| 342 | fd = epoll_create(global.maxsock + 1); |
| 343 | if (fd < 0) |
| 344 | return 0; |
| 345 | close(fd); |
| 346 | return 1; |
| 347 | } |
| 348 | |
| 349 | /* |
Willy Tarreau | ef1d1f8 | 2007-04-16 00:25:25 +0200 | [diff] [blame] | 350 | * It is a constructor, which means that it will automatically be called before |
| 351 | * main(). This is GCC-specific but it works at least since 2.95. |
| 352 | * Special care must be taken so that it does not need any uninitialized data. |
Willy Tarreau | 4f60f16 | 2007-04-08 16:39:58 +0200 | [diff] [blame] | 353 | */ |
Willy Tarreau | ef1d1f8 | 2007-04-16 00:25:25 +0200 | [diff] [blame] | 354 | __attribute__((constructor)) |
| 355 | static void _do_register(void) |
Willy Tarreau | 4f60f16 | 2007-04-08 16:39:58 +0200 | [diff] [blame] | 356 | { |
Willy Tarreau | ef1d1f8 | 2007-04-16 00:25:25 +0200 | [diff] [blame] | 357 | struct poller *p; |
| 358 | |
| 359 | if (nbpollers >= MAX_POLLERS) |
| 360 | return; |
| 361 | p = &pollers[nbpollers++]; |
| 362 | |
Willy Tarreau | 4f60f16 | 2007-04-08 16:39:58 +0200 | [diff] [blame] | 363 | p->name = "epoll"; |
| 364 | p->pref = 300; |
| 365 | p->private = NULL; |
| 366 | |
Willy Tarreau | ef1d1f8 | 2007-04-16 00:25:25 +0200 | [diff] [blame] | 367 | p->test = _do_test; |
| 368 | p->init = _do_init; |
| 369 | p->term = _do_term; |
| 370 | p->poll = _do_poll; |
Willy Tarreau | 58094f2 | 2007-04-10 01:33:20 +0200 | [diff] [blame] | 371 | |
| 372 | p->is_set = __fd_is_set; |
| 373 | p->cond_s = p->set = __fd_set; |
| 374 | p->cond_c = p->clr = __fd_clr; |
Willy Tarreau | 4f60f16 | 2007-04-08 16:39:58 +0200 | [diff] [blame] | 375 | p->rem = __fd_rem; |
| 376 | p->clo = __fd_clo; |
Willy Tarreau | 4f60f16 | 2007-04-08 16:39:58 +0200 | [diff] [blame] | 377 | } |
| 378 | |
| 379 | |
| 380 | /* |
| 381 | * Local variables: |
| 382 | * c-indent-level: 8 |
| 383 | * c-basic-offset: 8 |
| 384 | * End: |
| 385 | */ |