Emmanuel Hocdet | 0ba4f48 | 2019-04-08 16:53:32 +0000 | [diff] [blame] | 1 | /* |
| 2 | * FD polling functions for SunOS event ports. |
| 3 | * |
| 4 | * Copyright 2018 Joyent, Inc. |
| 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 | #include <unistd.h> |
| 13 | #include <sys/time.h> |
| 14 | #include <sys/types.h> |
| 15 | |
| 16 | #include <poll.h> |
| 17 | #include <port.h> |
| 18 | #include <errno.h> |
| 19 | #include <syslog.h> |
| 20 | |
Willy Tarreau | b255105 | 2020-06-09 09:07:15 +0200 | [diff] [blame] | 21 | #include <haproxy/activity.h> |
Willy Tarreau | 4c7e4b7 | 2020-05-27 12:58:42 +0200 | [diff] [blame] | 22 | #include <haproxy/api.h> |
Willy Tarreau | 5554264 | 2021-10-08 09:33:24 +0200 | [diff] [blame] | 23 | #include <haproxy/clock.h> |
Willy Tarreau | b255105 | 2020-06-09 09:07:15 +0200 | [diff] [blame] | 24 | #include <haproxy/fd.h> |
| 25 | #include <haproxy/global.h> |
Willy Tarreau | 3727a8a | 2020-06-04 17:37:26 +0200 | [diff] [blame] | 26 | #include <haproxy/signal.h> |
Willy Tarreau | 6dfab11 | 2021-09-30 17:53:22 +0200 | [diff] [blame] | 27 | #include <haproxy/task.h> |
Willy Tarreau | c2f7c58 | 2020-06-02 18:15:32 +0200 | [diff] [blame] | 28 | #include <haproxy/ticks.h> |
Emmanuel Hocdet | 0ba4f48 | 2019-04-08 16:53:32 +0000 | [diff] [blame] | 29 | |
Emmanuel Hocdet | 0ba4f48 | 2019-04-08 16:53:32 +0000 | [diff] [blame] | 30 | /* |
| 31 | * Private data: |
| 32 | */ |
| 33 | static int evports_fd[MAX_THREADS]; // per-thread evports_fd |
| 34 | static THREAD_LOCAL port_event_t *evports_evlist = NULL; |
| 35 | static THREAD_LOCAL int evports_evlist_max = 0; |
| 36 | |
| 37 | /* |
| 38 | * Convert the "state" member of "fdtab" into an event ports event mask. |
| 39 | */ |
| 40 | static inline int evports_state_to_events(int state) |
| 41 | { |
| 42 | int events = 0; |
| 43 | |
Willy Tarreau | 5bee3e2 | 2019-09-04 09:52:57 +0200 | [diff] [blame] | 44 | if (state & FD_EV_ACTIVE_W) |
Emmanuel Hocdet | 0ba4f48 | 2019-04-08 16:53:32 +0000 | [diff] [blame] | 45 | events |= POLLOUT; |
Willy Tarreau | 5bee3e2 | 2019-09-04 09:52:57 +0200 | [diff] [blame] | 46 | if (state & FD_EV_ACTIVE_R) |
Emmanuel Hocdet | 0ba4f48 | 2019-04-08 16:53:32 +0000 | [diff] [blame] | 47 | events |= POLLIN; |
| 48 | |
| 49 | return (events); |
| 50 | } |
| 51 | |
| 52 | /* |
| 53 | * Associate or dissociate this file descriptor with the event port, using the |
| 54 | * specified event mask. |
| 55 | */ |
| 56 | static inline void evports_resync_fd(int fd, int events) |
| 57 | { |
| 58 | if (events == 0) |
| 59 | port_dissociate(evports_fd[tid], PORT_SOURCE_FD, fd); |
| 60 | else |
| 61 | port_associate(evports_fd[tid], PORT_SOURCE_FD, fd, events, NULL); |
| 62 | } |
| 63 | |
| 64 | static void _update_fd(int fd) |
| 65 | { |
| 66 | int en; |
| 67 | int events; |
| 68 | |
| 69 | en = fdtab[fd].state; |
| 70 | |
Willy Tarreau | 5bee3e2 | 2019-09-04 09:52:57 +0200 | [diff] [blame] | 71 | if (!(fdtab[fd].thread_mask & tid_bit) || !(en & FD_EV_ACTIVE_RW)) { |
Olivier Houchard | 5305505 | 2019-07-25 14:00:18 +0000 | [diff] [blame] | 72 | if (!(polled_mask[fd].poll_recv & tid_bit) && |
| 73 | !(polled_mask[fd].poll_send & tid_bit)) { |
Emmanuel Hocdet | 0ba4f48 | 2019-04-08 16:53:32 +0000 | [diff] [blame] | 74 | /* fd was not watched, it's still not */ |
| 75 | return; |
| 76 | } |
| 77 | /* fd totally removed from poll list */ |
| 78 | events = 0; |
Olivier Houchard | 5305505 | 2019-07-25 14:00:18 +0000 | [diff] [blame] | 79 | if (polled_mask[fd].poll_recv & tid_bit) |
| 80 | _HA_ATOMIC_AND(&polled_mask[fd].poll_recv, ~tid_bit); |
| 81 | if (polled_mask[fd].poll_send & tid_bit) |
| 82 | _HA_ATOMIC_AND(&polled_mask[fd].poll_send, ~tid_bit); |
Emmanuel Hocdet | 0ba4f48 | 2019-04-08 16:53:32 +0000 | [diff] [blame] | 83 | } |
| 84 | else { |
| 85 | /* OK fd has to be monitored, it was either added or changed */ |
| 86 | events = evports_state_to_events(en); |
Willy Tarreau | 5bee3e2 | 2019-09-04 09:52:57 +0200 | [diff] [blame] | 87 | if (en & FD_EV_ACTIVE_R) { |
Olivier Houchard | 5305505 | 2019-07-25 14:00:18 +0000 | [diff] [blame] | 88 | if (!(polled_mask[fd].poll_recv & tid_bit)) |
| 89 | _HA_ATOMIC_OR(&polled_mask[fd].poll_recv, tid_bit); |
| 90 | } else { |
| 91 | if (polled_mask[fd].poll_recv & tid_bit) |
| 92 | _HA_ATOMIC_AND(&polled_mask[fd].poll_recv, ~tid_bit); |
| 93 | } |
Willy Tarreau | 5bee3e2 | 2019-09-04 09:52:57 +0200 | [diff] [blame] | 94 | if (en & FD_EV_ACTIVE_W) { |
Olivier Houchard | 5305505 | 2019-07-25 14:00:18 +0000 | [diff] [blame] | 95 | if (!(polled_mask[fd].poll_send & tid_bit)) |
| 96 | _HA_ATOMIC_OR(&polled_mask[fd].poll_send, tid_bit); |
| 97 | } else { |
| 98 | if (polled_mask[fd].poll_send & tid_bit) |
| 99 | _HA_ATOMIC_AND(&polled_mask[fd].poll_send, ~tid_bit); |
| 100 | } |
| 101 | |
Emmanuel Hocdet | 0ba4f48 | 2019-04-08 16:53:32 +0000 | [diff] [blame] | 102 | } |
| 103 | evports_resync_fd(fd, events); |
| 104 | } |
| 105 | |
| 106 | /* |
| 107 | * Event Ports poller. This routine interacts with the file descriptor |
| 108 | * management data structures and routines; see the large block comment in |
| 109 | * "src/fd.c" for more information. |
| 110 | */ |
| 111 | |
Willy Tarreau | 03e7853 | 2020-02-25 07:38:05 +0100 | [diff] [blame] | 112 | static void _do_poll(struct poller *p, int exp, int wake) |
Emmanuel Hocdet | 0ba4f48 | 2019-04-08 16:53:32 +0000 | [diff] [blame] | 113 | { |
| 114 | int i; |
| 115 | int wait_time; |
| 116 | struct timespec timeout_ts; |
| 117 | unsigned int nevlist; |
| 118 | int fd, old_fd; |
| 119 | int status; |
| 120 | |
| 121 | /* |
| 122 | * Scan the list of file descriptors with an updated status: |
| 123 | */ |
| 124 | for (i = 0; i < fd_nbupdt; i++) { |
| 125 | fd = fd_updt[i]; |
| 126 | |
| 127 | _HA_ATOMIC_AND(&fdtab[fd].update_mask, ~tid_bit); |
| 128 | if (fdtab[fd].owner == NULL) { |
Willy Tarreau | e406386 | 2020-06-17 20:35:33 +0200 | [diff] [blame] | 129 | activity[tid].poll_drop_fd++; |
Emmanuel Hocdet | 0ba4f48 | 2019-04-08 16:53:32 +0000 | [diff] [blame] | 130 | continue; |
| 131 | } |
| 132 | |
| 133 | _update_fd(fd); |
| 134 | } |
| 135 | fd_nbupdt = 0; |
| 136 | /* Scan the global update list */ |
| 137 | for (old_fd = fd = update_list.first; fd != -1; fd = fdtab[fd].update.next) { |
| 138 | if (fd == -2) { |
| 139 | fd = old_fd; |
| 140 | continue; |
| 141 | } |
| 142 | else if (fd <= -3) |
| 143 | fd = -fd -4; |
| 144 | if (fd == -1) |
| 145 | break; |
| 146 | if (fdtab[fd].update_mask & tid_bit) |
| 147 | done_update_polling(fd); |
| 148 | else |
| 149 | continue; |
| 150 | if (!fdtab[fd].owner) |
| 151 | continue; |
| 152 | _update_fd(fd); |
| 153 | } |
| 154 | |
Willy Tarreau | 88d1c5d | 2021-08-04 11:44:17 +0200 | [diff] [blame] | 155 | thread_idle_now(); |
Emmanuel Hocdet | 0ba4f48 | 2019-04-08 16:53:32 +0000 | [diff] [blame] | 156 | thread_harmless_now(); |
| 157 | |
| 158 | /* |
| 159 | * Determine how long to wait for events to materialise on the port. |
| 160 | */ |
Willy Tarreau | 2ae84e4 | 2019-05-28 16:44:05 +0200 | [diff] [blame] | 161 | wait_time = wake ? 0 : compute_poll_timeout(exp); |
Willy Tarreau | f9d5e10 | 2021-10-08 10:43:59 +0200 | [diff] [blame] | 162 | clock_entering_poll(); |
Emmanuel Hocdet | 0ba4f48 | 2019-04-08 16:53:32 +0000 | [diff] [blame] | 163 | |
| 164 | do { |
| 165 | int timeout = (global.tune.options & GTUNE_BUSY_POLLING) ? 0 : wait_time; |
| 166 | int interrupted = 0; |
| 167 | nevlist = 1; /* desired number of events to be retrieved */ |
| 168 | timeout_ts.tv_sec = (timeout / 1000); |
| 169 | timeout_ts.tv_nsec = (timeout % 1000) * 1000000; |
| 170 | |
| 171 | status = port_getn(evports_fd[tid], |
| 172 | evports_evlist, |
| 173 | evports_evlist_max, |
| 174 | &nevlist, /* updated to the number of events retrieved */ |
| 175 | &timeout_ts); |
| 176 | if (status != 0) { |
| 177 | int e = errno; |
| 178 | switch (e) { |
| 179 | case ETIME: |
| 180 | /* |
| 181 | * Though the manual page has not historically made it |
| 182 | * clear, port_getn() can return -1 with an errno of |
| 183 | * ETIME and still have returned some number of events. |
| 184 | */ |
| 185 | /* nevlist >= 0 */ |
| 186 | break; |
| 187 | default: |
| 188 | nevlist = 0; |
| 189 | interrupted = 1; |
| 190 | break; |
| 191 | } |
| 192 | } |
Willy Tarreau | 5554264 | 2021-10-08 09:33:24 +0200 | [diff] [blame] | 193 | clock_update_date(timeout, nevlist); |
Emmanuel Hocdet | 0ba4f48 | 2019-04-08 16:53:32 +0000 | [diff] [blame] | 194 | |
| 195 | if (nevlist || interrupted) |
| 196 | break; |
| 197 | if (timeout || !wait_time) |
| 198 | break; |
Willy Tarreau | 2ae84e4 | 2019-05-28 16:44:05 +0200 | [diff] [blame] | 199 | if (signal_queue_len || wake) |
Emmanuel Hocdet | 0ba4f48 | 2019-04-08 16:53:32 +0000 | [diff] [blame] | 200 | break; |
| 201 | if (tick_isset(exp) && tick_is_expired(exp, now_ms)) |
| 202 | break; |
| 203 | } while(1); |
| 204 | |
Willy Tarreau | 058b2c1 | 2022-06-22 15:21:34 +0200 | [diff] [blame] | 205 | fd_leaving_poll(wait_time, nevlist); |
Emmanuel Hocdet | 0ba4f48 | 2019-04-08 16:53:32 +0000 | [diff] [blame] | 206 | |
Willy Tarreau | e545153 | 2020-06-17 20:25:18 +0200 | [diff] [blame] | 207 | if (nevlist > 0) |
| 208 | activity[tid].poll_io++; |
| 209 | |
Emmanuel Hocdet | 0ba4f48 | 2019-04-08 16:53:32 +0000 | [diff] [blame] | 210 | for (i = 0; i < nevlist; i++) { |
| 211 | unsigned int n = 0; |
| 212 | int events, rebind_events; |
Willy Tarreau | 200bd50 | 2021-07-29 16:57:19 +0200 | [diff] [blame] | 213 | int ret; |
| 214 | |
Emmanuel Hocdet | 0ba4f48 | 2019-04-08 16:53:32 +0000 | [diff] [blame] | 215 | fd = evports_evlist[i].portev_object; |
| 216 | events = evports_evlist[i].portev_events; |
| 217 | |
Willy Tarreau | 38e8a1c | 2020-06-23 10:04:54 +0200 | [diff] [blame] | 218 | #ifdef DEBUG_FD |
Willy Tarreau | 4781b15 | 2021-04-06 13:53:36 +0200 | [diff] [blame] | 219 | _HA_ATOMIC_INC(&fdtab[fd].event_count); |
Willy Tarreau | 38e8a1c | 2020-06-23 10:04:54 +0200 | [diff] [blame] | 220 | #endif |
Emmanuel Hocdet | 0ba4f48 | 2019-04-08 16:53:32 +0000 | [diff] [blame] | 221 | /* |
| 222 | * By virtue of receiving an event for this file descriptor, it |
| 223 | * is no longer associated with the port in question. Store |
| 224 | * the previous event mask so that we may reassociate after |
| 225 | * processing is complete. |
| 226 | */ |
| 227 | rebind_events = evports_state_to_events(fdtab[fd].state); |
| 228 | /* rebind_events != 0 */ |
| 229 | |
| 230 | /* |
| 231 | * Set bits based on the events we received from the port: |
| 232 | */ |
Emmanuel Hocdet | 7ceb96b | 2019-09-19 11:08:26 +0000 | [diff] [blame] | 233 | n = ((events & POLLIN) ? FD_EV_READY_R : 0) | |
| 234 | ((events & POLLOUT) ? FD_EV_READY_W : 0) | |
| 235 | ((events & POLLHUP) ? FD_EV_SHUT_RW : 0) | |
| 236 | ((events & POLLERR) ? FD_EV_ERR_RW : 0); |
Emmanuel Hocdet | 0ba4f48 | 2019-04-08 16:53:32 +0000 | [diff] [blame] | 237 | |
| 238 | /* |
| 239 | * Call connection processing callbacks. Note that it's |
| 240 | * possible for this processing to alter the required event |
Ilya Shipitsin | ce7b00f | 2020-03-23 22:28:40 +0500 | [diff] [blame] | 241 | * port association; i.e., the "state" member of the "fdtab" |
Emmanuel Hocdet | 0ba4f48 | 2019-04-08 16:53:32 +0000 | [diff] [blame] | 242 | * entry. If it changes, the fd will be placed on the updated |
| 243 | * list for processing the next time we are called. |
| 244 | */ |
Willy Tarreau | 200bd50 | 2021-07-29 16:57:19 +0200 | [diff] [blame] | 245 | ret = fd_update_events(fd, n); |
| 246 | |
Willy Tarreau | b1093c6 | 2022-07-09 18:55:37 +0200 | [diff] [blame^] | 247 | /* polling will be on this instance if the FD was migrated */ |
| 248 | if (ret == FD_UPDT_MIGRATED) |
Willy Tarreau | 200bd50 | 2021-07-29 16:57:19 +0200 | [diff] [blame] | 249 | continue; |
Emmanuel Hocdet | 0ba4f48 | 2019-04-08 16:53:32 +0000 | [diff] [blame] | 250 | |
| 251 | /* |
| 252 | * This file descriptor was closed during the processing of |
| 253 | * polled events. No need to reassociate. |
| 254 | */ |
Willy Tarreau | 200bd50 | 2021-07-29 16:57:19 +0200 | [diff] [blame] | 255 | if (ret == FD_UPDT_CLOSED) |
Emmanuel Hocdet | 0ba4f48 | 2019-04-08 16:53:32 +0000 | [diff] [blame] | 256 | continue; |
| 257 | |
| 258 | /* |
| 259 | * Reassociate with the port, using the same event mask as |
| 260 | * before. This call will not result in a dissociation as we |
| 261 | * asserted that _some_ events needed to be rebound above. |
| 262 | * |
| 263 | * Reassociating with the same mask allows us to mimic the |
| 264 | * level-triggered behaviour of poll(2). In the event that we |
| 265 | * are interested in the same events on the next turn of the |
| 266 | * loop, this represents no extra work. |
| 267 | * |
| 268 | * If this additional port_associate(3C) call becomes a |
| 269 | * performance problem, we would need to verify that we can |
| 270 | * correctly interact with the file descriptor cache and update |
| 271 | * list (see "src/fd.c") to avoid reassociating here, or to use |
| 272 | * a different events mask. |
| 273 | */ |
| 274 | evports_resync_fd(fd, rebind_events); |
| 275 | } |
| 276 | } |
| 277 | |
| 278 | static int init_evports_per_thread() |
| 279 | { |
| 280 | int fd; |
| 281 | |
| 282 | evports_evlist_max = global.tune.maxpollevents; |
Tim Duesterhus | 16cc16d | 2021-11-06 15:14:45 +0100 | [diff] [blame] | 283 | evports_evlist = calloc(evports_evlist_max, sizeof(*evports_evlist)); |
Emmanuel Hocdet | 0ba4f48 | 2019-04-08 16:53:32 +0000 | [diff] [blame] | 284 | if (evports_evlist == NULL) { |
| 285 | goto fail_alloc; |
| 286 | } |
| 287 | |
| 288 | if (MAX_THREADS > 1 && tid) { |
| 289 | if ((evports_fd[tid] = port_create()) == -1) { |
| 290 | goto fail_fd; |
| 291 | } |
| 292 | } |
| 293 | |
| 294 | /* we may have to unregister some events initially registered on the |
| 295 | * original fd when it was alone, and/or to register events on the new |
| 296 | * fd for this thread. Let's just mark them as updated, the poller will |
| 297 | * do the rest. |
| 298 | */ |
| 299 | for (fd = 0; fd < global.maxsock; fd++) |
| 300 | updt_fd_polling(fd); |
| 301 | |
| 302 | return 1; |
| 303 | |
| 304 | fail_fd: |
Willy Tarreau | 61cfdf4 | 2021-02-20 10:46:51 +0100 | [diff] [blame] | 305 | ha_free(&evports_evlist); |
Emmanuel Hocdet | 0ba4f48 | 2019-04-08 16:53:32 +0000 | [diff] [blame] | 306 | evports_evlist_max = 0; |
| 307 | fail_alloc: |
| 308 | return 0; |
| 309 | } |
| 310 | |
| 311 | static void deinit_evports_per_thread() |
| 312 | { |
| 313 | if (MAX_THREADS > 1 && tid) |
| 314 | close(evports_fd[tid]); |
| 315 | |
Willy Tarreau | 61cfdf4 | 2021-02-20 10:46:51 +0100 | [diff] [blame] | 316 | ha_free(&evports_evlist); |
Emmanuel Hocdet | 0ba4f48 | 2019-04-08 16:53:32 +0000 | [diff] [blame] | 317 | evports_evlist_max = 0; |
| 318 | } |
| 319 | |
| 320 | /* |
| 321 | * Initialisation of the event ports poller. |
| 322 | * Returns 0 in case of failure, non-zero in case of success. |
| 323 | */ |
Willy Tarreau | 03e7853 | 2020-02-25 07:38:05 +0100 | [diff] [blame] | 324 | static int _do_init(struct poller *p) |
Emmanuel Hocdet | 0ba4f48 | 2019-04-08 16:53:32 +0000 | [diff] [blame] | 325 | { |
| 326 | p->private = NULL; |
| 327 | |
| 328 | if ((evports_fd[tid] = port_create()) == -1) { |
| 329 | goto fail; |
| 330 | } |
| 331 | |
| 332 | hap_register_per_thread_init(init_evports_per_thread); |
| 333 | hap_register_per_thread_deinit(deinit_evports_per_thread); |
| 334 | |
| 335 | return 1; |
| 336 | |
| 337 | fail: |
| 338 | p->pref = 0; |
| 339 | return 0; |
| 340 | } |
| 341 | |
| 342 | /* |
| 343 | * Termination of the event ports poller. |
| 344 | * All resources are released and the poller is marked as inoperative. |
| 345 | */ |
Willy Tarreau | 03e7853 | 2020-02-25 07:38:05 +0100 | [diff] [blame] | 346 | static void _do_term(struct poller *p) |
Emmanuel Hocdet | 0ba4f48 | 2019-04-08 16:53:32 +0000 | [diff] [blame] | 347 | { |
| 348 | if (evports_fd[tid] != -1) { |
| 349 | close(evports_fd[tid]); |
| 350 | evports_fd[tid] = -1; |
| 351 | } |
| 352 | |
| 353 | p->private = NULL; |
| 354 | p->pref = 0; |
| 355 | |
Willy Tarreau | 61cfdf4 | 2021-02-20 10:46:51 +0100 | [diff] [blame] | 356 | ha_free(&evports_evlist); |
Emmanuel Hocdet | 0ba4f48 | 2019-04-08 16:53:32 +0000 | [diff] [blame] | 357 | evports_evlist_max = 0; |
| 358 | } |
| 359 | |
| 360 | /* |
| 361 | * Run-time check to make sure we can allocate the resources needed for |
| 362 | * the poller to function correctly. |
| 363 | * Returns 1 on success, otherwise 0. |
| 364 | */ |
Willy Tarreau | 03e7853 | 2020-02-25 07:38:05 +0100 | [diff] [blame] | 365 | static int _do_test(struct poller *p) |
Emmanuel Hocdet | 0ba4f48 | 2019-04-08 16:53:32 +0000 | [diff] [blame] | 366 | { |
| 367 | int fd; |
| 368 | |
| 369 | if ((fd = port_create()) == -1) { |
| 370 | return 0; |
| 371 | } |
| 372 | |
| 373 | close(fd); |
| 374 | return 1; |
| 375 | } |
| 376 | |
| 377 | /* |
| 378 | * Close and recreate the event port after fork(). Returns 1 on success, |
| 379 | * otherwise 0. If this function fails, "_do_term()" must be called to |
| 380 | * clean up the poller. |
| 381 | */ |
Willy Tarreau | 03e7853 | 2020-02-25 07:38:05 +0100 | [diff] [blame] | 382 | static int _do_fork(struct poller *p) |
Emmanuel Hocdet | 0ba4f48 | 2019-04-08 16:53:32 +0000 | [diff] [blame] | 383 | { |
| 384 | if (evports_fd[tid] != -1) { |
| 385 | close(evports_fd[tid]); |
| 386 | } |
| 387 | |
| 388 | if ((evports_fd[tid] = port_create()) == -1) { |
| 389 | return 0; |
| 390 | } |
| 391 | |
| 392 | return 1; |
| 393 | } |
| 394 | |
| 395 | /* |
Willy Tarreau | 740d749 | 2022-04-25 19:00:55 +0200 | [diff] [blame] | 396 | * Registers the poller. |
Emmanuel Hocdet | 0ba4f48 | 2019-04-08 16:53:32 +0000 | [diff] [blame] | 397 | */ |
Emmanuel Hocdet | 0ba4f48 | 2019-04-08 16:53:32 +0000 | [diff] [blame] | 398 | static void _do_register(void) |
| 399 | { |
| 400 | struct poller *p; |
| 401 | int i; |
| 402 | |
| 403 | if (nbpollers >= MAX_POLLERS) |
| 404 | return; |
| 405 | |
| 406 | for (i = 0; i < MAX_THREADS; i++) |
| 407 | evports_fd[i] = -1; |
| 408 | |
| 409 | p = &pollers[nbpollers++]; |
| 410 | |
| 411 | p->name = "evports"; |
| 412 | p->pref = 300; |
Willy Tarreau | 11ef083 | 2019-11-28 18:17:33 +0100 | [diff] [blame] | 413 | p->flags = HAP_POLL_F_ERRHUP; |
Emmanuel Hocdet | 0ba4f48 | 2019-04-08 16:53:32 +0000 | [diff] [blame] | 414 | p->private = NULL; |
| 415 | |
| 416 | p->clo = NULL; |
| 417 | p->test = _do_test; |
| 418 | p->init = _do_init; |
| 419 | p->term = _do_term; |
| 420 | p->poll = _do_poll; |
| 421 | p->fork = _do_fork; |
| 422 | } |
Willy Tarreau | 740d749 | 2022-04-25 19:00:55 +0200 | [diff] [blame] | 423 | |
| 424 | INITCALL0(STG_REGISTER, _do_register); |