blob: f123e7be25320cb3ed04a4e571d59a443d42dc3c [file] [log] [blame]
Willy Tarreau1e63130a2007-04-09 12:03:06 +02001/*
2 * FD polling functions for FreeBSD kqueue()
3 *
Willy Tarreauf817e9f2014-01-10 16:58:45 +01004 * Copyright 2000-2014 Willy Tarreau <w@1wt.eu>
Willy Tarreau1e63130a2007-04-09 12:03:06 +02005 *
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 *
Willy Tarreau1e63130a2007-04-09 12:03:06 +020011 */
12
Willy Tarreau1e63130a2007-04-09 12:03:06 +020013#include <unistd.h>
14#include <sys/time.h>
15#include <sys/types.h>
16
17#include <sys/event.h>
18#include <sys/time.h>
19
Willy Tarreaub2551052020-06-09 09:07:15 +020020#include <haproxy/activity.h>
Willy Tarreau4c7e4b72020-05-27 12:58:42 +020021#include <haproxy/api.h>
Willy Tarreau55542642021-10-08 09:33:24 +020022#include <haproxy/clock.h>
Willy Tarreaub2551052020-06-09 09:07:15 +020023#include <haproxy/fd.h>
24#include <haproxy/global.h>
Willy Tarreau3727a8a2020-06-04 17:37:26 +020025#include <haproxy/signal.h>
Willy Tarreau6dfab112021-09-30 17:53:22 +020026#include <haproxy/task.h>
Willy Tarreauc2f7c582020-06-02 18:15:32 +020027#include <haproxy/ticks.h>
Willy Tarreau1e63130a2007-04-09 12:03:06 +020028
Willy Tarreau1e63130a2007-04-09 12:03:06 +020029
30/* private data */
Willy Tarreau8209c9a2021-04-10 17:09:53 +020031static int kqueue_fd[MAX_THREADS] __read_mostly; // per-thread kqueue_fd
Christopher Fauletd4604ad2017-05-29 10:40:41 +020032static THREAD_LOCAL struct kevent *kev = NULL;
Olivier Houchardebaba752018-04-16 13:24:48 +020033static struct kevent *kev_out = NULL; // Trash buffer for kevent() to write the eventlist in
Willy Tarreau1e63130a2007-04-09 12:03:06 +020034
PiBa-NLc55b88e2018-05-10 01:01:28 +020035static int _update_fd(int fd, int start)
Olivier Houchard6b96f722018-04-25 16:58:25 +020036{
37 int en;
PiBa-NLc55b88e2018-05-10 01:01:28 +020038 int changes = start;
Willy Tarreau63022122022-07-06 10:37:31 +020039 ulong pr, ps;
Olivier Houchard6b96f722018-04-25 16:58:25 +020040
41 en = fdtab[fd].state;
Willy Tarreau63022122022-07-06 10:37:31 +020042 pr = _HA_ATOMIC_LOAD(&polled_mask[fd].poll_recv);
43 ps = _HA_ATOMIC_LOAD(&polled_mask[fd].poll_send);
Olivier Houchard6b96f722018-04-25 16:58:25 +020044
Willy Tarreau3638d172022-07-07 08:23:03 +020045 if (!(fdtab[fd].thread_mask & ti->ltid_bit) || !(en & FD_EV_ACTIVE_RW)) {
Willy Tarreau63022122022-07-06 10:37:31 +020046 if (!((pr | ps) & ti->ltid_bit)) {
Olivier Houchard6b96f722018-04-25 16:58:25 +020047 /* fd was not watched, it's still not */
Olivier Houchard5ab33942018-09-11 14:44:51 +020048 return changes;
Olivier Houchard6b96f722018-04-25 16:58:25 +020049 }
50 /* fd totally removed from poll list */
51 EV_SET(&kev[changes++], fd, EVFILT_READ, EV_DELETE, 0, 0, NULL);
52 EV_SET(&kev[changes++], fd, EVFILT_WRITE, EV_DELETE, 0, 0, NULL);
Willy Tarreau63022122022-07-06 10:37:31 +020053 if (pr & ti->ltid_bit)
54 _HA_ATOMIC_AND(&polled_mask[fd].poll_recv, ~ti->ltid_bit);
55 if (ps & ti->ltid_bit)
56 _HA_ATOMIC_AND(&polled_mask[fd].poll_send, ~ti->ltid_bit);
Olivier Houchard6b96f722018-04-25 16:58:25 +020057 }
58 else {
59 /* OK fd has to be monitored, it was either added or changed */
60
Willy Tarreau5bee3e22019-09-04 09:52:57 +020061 if (en & FD_EV_ACTIVE_R) {
Willy Tarreau63022122022-07-06 10:37:31 +020062 if (!(pr & ti->ltid_bit)) {
Olivier Houchard53055052019-07-25 14:00:18 +000063 EV_SET(&kev[changes++], fd, EVFILT_READ, EV_ADD, 0, 0, NULL);
Willy Tarreau63022122022-07-06 10:37:31 +020064 _HA_ATOMIC_OR(&polled_mask[fd].poll_recv, ti->ltid_bit);
Olivier Houchard53055052019-07-25 14:00:18 +000065 }
66 }
Willy Tarreau63022122022-07-06 10:37:31 +020067 else if (pr & ti->ltid_bit) {
Olivier Houchard6b96f722018-04-25 16:58:25 +020068 EV_SET(&kev[changes++], fd, EVFILT_READ, EV_DELETE, 0, 0, NULL);
Willy Tarreau63022122022-07-06 10:37:31 +020069 HA_ATOMIC_AND(&polled_mask[fd].poll_recv, ~ti->ltid_bit);
Olivier Houchard53055052019-07-25 14:00:18 +000070 }
Olivier Houchard6b96f722018-04-25 16:58:25 +020071
Willy Tarreau5bee3e22019-09-04 09:52:57 +020072 if (en & FD_EV_ACTIVE_W) {
Willy Tarreau63022122022-07-06 10:37:31 +020073 if (!(ps & ti->ltid_bit)) {
Olivier Houchard53055052019-07-25 14:00:18 +000074 EV_SET(&kev[changes++], fd, EVFILT_WRITE, EV_ADD, 0, 0, NULL);
Willy Tarreau63022122022-07-06 10:37:31 +020075 _HA_ATOMIC_OR(&polled_mask[fd].poll_send, ti->ltid_bit);
Olivier Houchard53055052019-07-25 14:00:18 +000076 }
77 }
Willy Tarreau63022122022-07-06 10:37:31 +020078 else if (ps & ti->ltid_bit) {
Olivier Houchard6b96f722018-04-25 16:58:25 +020079 EV_SET(&kev[changes++], fd, EVFILT_WRITE, EV_DELETE, 0, 0, NULL);
Willy Tarreau63022122022-07-06 10:37:31 +020080 _HA_ATOMIC_AND(&polled_mask[fd].poll_send, ~ti->ltid_bit);
Olivier Houchard53055052019-07-25 14:00:18 +000081 }
Olivier Houchard6b96f722018-04-25 16:58:25 +020082
Olivier Houchard6b96f722018-04-25 16:58:25 +020083 }
84 return changes;
85}
86
Willy Tarreau1e63130a2007-04-09 12:03:06 +020087/*
Willy Tarreau4a226272012-11-11 20:49:49 +010088 * kqueue() poller
Willy Tarreau1e63130a2007-04-09 12:03:06 +020089 */
Willy Tarreau03e78532020-02-25 07:38:05 +010090static void _do_poll(struct poller *p, int exp, int wake)
Willy Tarreau1e63130a2007-04-09 12:03:06 +020091{
Willy Tarreau4a226272012-11-11 20:49:49 +010092 int status;
Willy Tarreaubeb859a2018-11-22 18:07:59 +010093 int count, fd, wait_time;
94 struct timespec timeout_ts;
Olivier Houchard6b96f722018-04-25 16:58:25 +020095 int updt_idx;
Willy Tarreau4a226272012-11-11 20:49:49 +010096 int changes = 0;
Olivier Houchard6b96f722018-04-25 16:58:25 +020097 int old_fd;
Willy Tarreau1e63130a2007-04-09 12:03:06 +020098
Willy Tarreaubeb859a2018-11-22 18:07:59 +010099 timeout_ts.tv_sec = 0;
100 timeout_ts.tv_nsec = 0;
Willy Tarreau4a226272012-11-11 20:49:49 +0100101 /* first, scan the update list to find changes */
102 for (updt_idx = 0; updt_idx < fd_nbupdt; updt_idx++) {
103 fd = fd_updt[updt_idx];
Willy Tarreauf817e9f2014-01-10 16:58:45 +0100104
Willy Tarreau1f947cb2022-07-09 23:55:43 +0200105 if (!fd_grab_tgid(fd, tgid)) {
106 /* was reassigned */
Willy Tarreaue4063862020-06-17 20:35:33 +0200107 activity[tid].poll_drop_fd++;
Willy Tarreauf817e9f2014-01-10 16:58:45 +0100108 continue;
Willy Tarreaud80cb4e2018-01-20 19:30:13 +0100109 }
Willy Tarreau1f947cb2022-07-09 23:55:43 +0200110
111 _HA_ATOMIC_AND(&fdtab[fd].update_mask, ~ti->ltid_bit);
112
113 if (fdtab[fd].owner)
114 changes = _update_fd(fd, changes);
115 else
116 activity[tid].poll_drop_fd++;
117
118 fd_drop_tgid(fd);
Olivier Houchard6b96f722018-04-25 16:58:25 +0200119 }
120 /* Scan the global update list */
Willy Tarreau35ee7102022-07-08 11:33:43 +0200121 for (old_fd = fd = update_list[tgid - 1].first; fd != -1; fd = fdtab[fd].update.next) {
Olivier Houchard6b96f722018-04-25 16:58:25 +0200122 if (fd == -2) {
123 fd = old_fd;
124 continue;
Willy Tarreau4a226272012-11-11 20:49:49 +0100125 }
Olivier Houchard6b96f722018-04-25 16:58:25 +0200126 else if (fd <= -3)
127 fd = -fd -4;
128 if (fd == -1)
129 break;
Willy Tarreau1f947cb2022-07-09 23:55:43 +0200130
131 if (!fd_grab_tgid(fd, tgid)) {
132 /* was reassigned */
133 activity[tid].poll_drop_fd++;
Olivier Houchard6b96f722018-04-25 16:58:25 +0200134 continue;
Willy Tarreau1f947cb2022-07-09 23:55:43 +0200135 }
136
Willy Tarreau69834262022-07-25 15:39:21 +0200137 if (!(fdtab[fd].update_mask & ti->ltid_bit)) {
138 fd_drop_tgid(fd);
Olivier Houchard6b96f722018-04-25 16:58:25 +0200139 continue;
Willy Tarreau69834262022-07-25 15:39:21 +0200140 }
Willy Tarreau1f947cb2022-07-09 23:55:43 +0200141
142 done_update_polling(fd);
143
144 if (fdtab[fd].owner)
145 changes = _update_fd(fd, changes);
146 else
147 activity[tid].poll_drop_fd++;
148
149 fd_drop_tgid(fd);
Willy Tarreau4a226272012-11-11 20:49:49 +0100150 }
Olivier Houchard6b96f722018-04-25 16:58:25 +0200151
Willy Tarreau88d1c5d2021-08-04 11:44:17 +0200152 thread_idle_now();
Willy Tarreau60b639c2018-08-02 10:16:17 +0200153 thread_harmless_now();
154
Olivier Houchardebaba752018-04-16 13:24:48 +0200155 if (changes) {
156#ifdef EV_RECEIPT
157 kev[0].flags |= EV_RECEIPT;
158#else
159 /* If EV_RECEIPT isn't defined, just add an invalid entry,
160 * so that we get an error and kevent() stops before scanning
161 * the kqueue.
162 */
163 EV_SET(&kev[changes++], -1, EVFILT_WRITE, EV_DELETE, 0, 0, NULL);
164#endif
Willy Tarreaubeb859a2018-11-22 18:07:59 +0100165 kevent(kqueue_fd[tid], kev, changes, kev_out, changes, &timeout_ts);
Olivier Houchardebaba752018-04-16 13:24:48 +0200166 }
Willy Tarreau4a226272012-11-11 20:49:49 +0100167 fd_nbupdt = 0;
Willy Tarreau1e63130a2007-04-09 12:03:06 +0200168
Matthias Wirtheea152e2022-09-09 10:21:00 +0200169 /* Now let's wait for polled events. */
170 wait_time = wake ? 0 : compute_poll_timeout(exp);
Willy Tarreauce036bc2018-01-29 14:58:02 +0100171 fd = global.tune.maxpollevents;
Willy Tarreauf9d5e102021-10-08 10:43:59 +0200172 clock_entering_poll();
Willy Tarreaubeb859a2018-11-22 18:07:59 +0100173
174 do {
175 int timeout = (global.tune.options & GTUNE_BUSY_POLLING) ? 0 : wait_time;
176
177 timeout_ts.tv_sec = (timeout / 1000);
178 timeout_ts.tv_nsec = (timeout % 1000) * 1000000;
179
180 status = kevent(kqueue_fd[tid], // int kq
181 NULL, // const struct kevent *changelist
182 0, // int nchanges
183 kev, // struct kevent *eventlist
184 fd, // int nevents
185 &timeout_ts); // const struct timespec *timeout
Willy Tarreau58b73f92022-09-21 08:11:38 +0200186 clock_update_local_date(timeout, status);
Willy Tarreaubeb859a2018-11-22 18:07:59 +0100187
Willy Tarreaue5451532020-06-17 20:25:18 +0200188 if (status) {
189 activity[tid].poll_io++;
Willy Tarreaubeb859a2018-11-22 18:07:59 +0100190 break;
Willy Tarreaue5451532020-06-17 20:25:18 +0200191 }
Willy Tarreaubeb859a2018-11-22 18:07:59 +0100192 if (timeout || !wait_time)
193 break;
Willy Tarreaubeb859a2018-11-22 18:07:59 +0100194 if (tick_isset(exp) && tick_is_expired(exp, now_ms))
195 break;
196 } while (1);
197
Willy Tarreau58b73f92022-09-21 08:11:38 +0200198 clock_update_global_date();
Willy Tarreau058b2c12022-06-22 15:21:34 +0200199 fd_leaving_poll(wait_time, status);
Willy Tarreau60b639c2018-08-02 10:16:17 +0200200
Willy Tarreau1e63130a2007-04-09 12:03:06 +0200201 for (count = 0; count < status; count++) {
Christopher Fauletab62f512017-08-30 10:34:36 +0200202 unsigned int n = 0;
Willy Tarreau200bd502021-07-29 16:57:19 +0200203
Willy Tarreau1e63130a2007-04-09 12:03:06 +0200204 fd = kev[count].ident;
Willy Tarreau9845e752012-07-06 11:44:28 +0200205
Willy Tarreau38e8a1c2020-06-23 10:04:54 +0200206#ifdef DEBUG_FD
Willy Tarreau4781b152021-04-06 13:53:36 +0200207 _HA_ATOMIC_INC(&fdtab[fd].event_count);
Willy Tarreau38e8a1c2020-06-23 10:04:54 +0200208#endif
Willy Tarreau6b308982019-09-06 19:05:50 +0200209 if (kev[count].filter == EVFILT_READ) {
Olivier Houchardeaefc3c2019-12-10 18:22:55 +0100210 if (kev[count].data || !(kev[count].flags & EV_EOF))
Willy Tarreau6b308982019-09-06 19:05:50 +0200211 n |= FD_EV_READY_R;
Willy Tarreau19c4ab92017-03-13 20:36:48 +0100212 if (kev[count].flags & EV_EOF)
Willy Tarreau6b308982019-09-06 19:05:50 +0200213 n |= FD_EV_SHUT_R;
Willy Tarreau4a226272012-11-11 20:49:49 +0100214 }
Willy Tarreau6b308982019-09-06 19:05:50 +0200215 else if (kev[count].filter == EVFILT_WRITE) {
216 n |= FD_EV_READY_W;
Willy Tarreau19c4ab92017-03-13 20:36:48 +0100217 if (kev[count].flags & EV_EOF)
Willy Tarreau6b308982019-09-06 19:05:50 +0200218 n |= FD_EV_ERR_RW;
Willy Tarreau1e63130a2007-04-09 12:03:06 +0200219 }
Willy Tarreau4a226272012-11-11 20:49:49 +0100220
Willy Tarreaub1093c62022-07-09 18:55:37 +0200221 fd_update_events(fd, n);
Willy Tarreau1e63130a2007-04-09 12:03:06 +0200222 }
223}
224
Christopher Fauletd4604ad2017-05-29 10:40:41 +0200225
226static int init_kqueue_per_thread()
227{
Olivier Houchardebaba752018-04-16 13:24:48 +0200228 /* we can have up to two events per fd, so allocate enough to store
229 * 2*fd event, and an extra one, in case EV_RECEIPT isn't defined,
230 * so that we can add an invalid entry and get an error, to avoid
231 * scanning the kqueue uselessly.
232 */
233 kev = calloc(1, sizeof(struct kevent) * (2 * global.maxsock + 1));
Christopher Fauletd4604ad2017-05-29 10:40:41 +0200234 if (kev == NULL)
Willy Tarreau7a2364d2018-01-19 08:56:14 +0100235 goto fail_alloc;
236
Christopher Faulet727c89b2018-01-25 16:40:35 +0100237 if (MAX_THREADS > 1 && tid) {
Willy Tarreau7a2364d2018-01-19 08:56:14 +0100238 kqueue_fd[tid] = kqueue();
239 if (kqueue_fd[tid] < 0)
240 goto fail_fd;
241 }
242
243 /* we may have to unregister some events initially registered on the
244 * original fd when it was alone, and/or to register events on the new
245 * fd for this thread. Let's just mark them as updated, the poller will
246 * do the rest.
247 */
Willy Tarreaud95f18f2022-07-09 23:23:50 +0200248 fd_reregister_all(tgid, ti->ltid_bit);
Willy Tarreau7a2364d2018-01-19 08:56:14 +0100249
Christopher Fauletd4604ad2017-05-29 10:40:41 +0200250 return 1;
Willy Tarreau7a2364d2018-01-19 08:56:14 +0100251 fail_fd:
252 free(kev);
253 fail_alloc:
254 return 0;
Christopher Fauletd4604ad2017-05-29 10:40:41 +0200255}
256
257static void deinit_kqueue_per_thread()
258{
Christopher Faulet727c89b2018-01-25 16:40:35 +0100259 if (MAX_THREADS > 1 && tid)
Christopher Faulet13b007d2018-01-25 16:32:18 +0100260 close(kqueue_fd[tid]);
261
Willy Tarreau61cfdf42021-02-20 10:46:51 +0100262 ha_free(&kev);
Christopher Fauletd4604ad2017-05-29 10:40:41 +0200263}
264
Willy Tarreau1e63130a2007-04-09 12:03:06 +0200265/*
266 * Initialization of the kqueue() poller.
267 * Returns 0 in case of failure, non-zero in case of success. If it fails, it
268 * disables the poller by setting its pref to 0.
269 */
Willy Tarreau03e78532020-02-25 07:38:05 +0100270static int _do_init(struct poller *p)
Willy Tarreau1e63130a2007-04-09 12:03:06 +0200271{
Willy Tarreau1e63130a2007-04-09 12:03:06 +0200272 p->private = NULL;
Willy Tarreau1e63130a2007-04-09 12:03:06 +0200273
Olivier Houchardebaba752018-04-16 13:24:48 +0200274 /* we can have up to two events per fd, so allocate enough to store
275 * 2*fd event, and an extra one, in case EV_RECEIPT isn't defined,
276 * so that we can add an invalid entry and get an error, to avoid
277 * scanning the kqueue uselessly.
278 */
279 kev_out = calloc(1, sizeof(struct kevent) * (2 * global.maxsock + 1));
280 if (!kev_out)
281 goto fail_alloc;
282
Willy Tarreau7a2364d2018-01-19 08:56:14 +0100283 kqueue_fd[tid] = kqueue();
284 if (kqueue_fd[tid] < 0)
Willy Tarreau1e63130a2007-04-09 12:03:06 +0200285 goto fail_fd;
286
Christopher Fauletcd7879a2017-10-27 13:53:47 +0200287 hap_register_per_thread_init(init_kqueue_per_thread);
288 hap_register_per_thread_deinit(deinit_kqueue_per_thread);
Willy Tarreau1e63130a2007-04-09 12:03:06 +0200289 return 1;
290
Willy Tarreau1e63130a2007-04-09 12:03:06 +0200291 fail_fd:
Willy Tarreau61cfdf42021-02-20 10:46:51 +0100292 ha_free(&kev_out);
Olivier Houchardebaba752018-04-16 13:24:48 +0200293fail_alloc:
Willy Tarreau1e63130a2007-04-09 12:03:06 +0200294 p->pref = 0;
295 return 0;
296}
297
298/*
299 * Termination of the kqueue() poller.
300 * Memory is released and the poller is marked as unselectable.
301 */
Willy Tarreau03e78532020-02-25 07:38:05 +0100302static void _do_term(struct poller *p)
Willy Tarreau1e63130a2007-04-09 12:03:06 +0200303{
Willy Tarreau7a2364d2018-01-19 08:56:14 +0100304 if (kqueue_fd[tid] >= 0) {
305 close(kqueue_fd[tid]);
306 kqueue_fd[tid] = -1;
Willy Tarreaud79e79b2009-05-10 10:18:54 +0200307 }
Willy Tarreau1e63130a2007-04-09 12:03:06 +0200308
309 p->private = NULL;
310 p->pref = 0;
Olivier Houchardebaba752018-04-16 13:24:48 +0200311 if (kev_out) {
Willy Tarreau61cfdf42021-02-20 10:46:51 +0100312 ha_free(&kev_out);
Olivier Houchardebaba752018-04-16 13:24:48 +0200313 }
Willy Tarreau1e63130a2007-04-09 12:03:06 +0200314}
315
316/*
Willy Tarreau2ff76222007-04-09 19:29:56 +0200317 * Check that the poller works.
318 * Returns 1 if OK, otherwise 0.
319 */
Willy Tarreau03e78532020-02-25 07:38:05 +0100320static int _do_test(struct poller *p)
Willy Tarreau2ff76222007-04-09 19:29:56 +0200321{
322 int fd;
323
324 fd = kqueue();
325 if (fd < 0)
326 return 0;
327 close(fd);
328 return 1;
329}
330
331/*
332 * Recreate the kqueue file descriptor after a fork(). Returns 1 if OK,
333 * otherwise 0. Note that some pollers need to be reopened after a fork()
334 * (such as kqueue), and some others may fail to do so in a chroot.
335 */
Willy Tarreau03e78532020-02-25 07:38:05 +0100336static int _do_fork(struct poller *p)
Willy Tarreau2ff76222007-04-09 19:29:56 +0200337{
Willy Tarreau7a2364d2018-01-19 08:56:14 +0100338 kqueue_fd[tid] = kqueue();
339 if (kqueue_fd[tid] < 0)
Willy Tarreau2ff76222007-04-09 19:29:56 +0200340 return 0;
341 return 1;
342}
343
344/*
Willy Tarreau740d7492022-04-25 19:00:55 +0200345 * Registers the poller.
Willy Tarreau1e63130a2007-04-09 12:03:06 +0200346 */
Willy Tarreauef1d1f82007-04-16 00:25:25 +0200347static void _do_register(void)
Willy Tarreau1e63130a2007-04-09 12:03:06 +0200348{
Willy Tarreauef1d1f82007-04-16 00:25:25 +0200349 struct poller *p;
Willy Tarreau7a2364d2018-01-19 08:56:14 +0100350 int i;
Willy Tarreauef1d1f82007-04-16 00:25:25 +0200351
352 if (nbpollers >= MAX_POLLERS)
353 return;
Willy Tarreaud79e79b2009-05-10 10:18:54 +0200354
Willy Tarreau7a2364d2018-01-19 08:56:14 +0100355 for (i = 0; i < MAX_THREADS; i++)
356 kqueue_fd[i] = -1;
357
Willy Tarreauef1d1f82007-04-16 00:25:25 +0200358 p = &pollers[nbpollers++];
359
Willy Tarreau1e63130a2007-04-09 12:03:06 +0200360 p->name = "kqueue";
361 p->pref = 300;
Willy Tarreau11ef0832019-11-28 18:17:33 +0100362 p->flags = HAP_POLL_F_RDHUP | HAP_POLL_F_ERRHUP;
Willy Tarreau1e63130a2007-04-09 12:03:06 +0200363 p->private = NULL;
364
Willy Tarreau70c6fd82012-11-11 21:02:34 +0100365 p->clo = NULL;
Willy Tarreauef1d1f82007-04-16 00:25:25 +0200366 p->test = _do_test;
367 p->init = _do_init;
368 p->term = _do_term;
369 p->poll = _do_poll;
370 p->fork = _do_fork;
Willy Tarreau1e63130a2007-04-09 12:03:06 +0200371}
372
Willy Tarreau740d7492022-04-25 19:00:55 +0200373INITCALL0(STG_REGISTER, _do_register);
Willy Tarreau1e63130a2007-04-09 12:03:06 +0200374
375/*
376 * Local variables:
377 * c-indent-level: 8
378 * c-basic-offset: 8
379 * End:
380 */