From f8a51c000fe0fbbd497ade0ddb0e9d6f36a0d3de Mon Sep 17 00:00:00 2001 From: Olivier Houchard Date: Thu, 10 Sep 2026 18:42:59 +0200 Subject: [PATCH] MINOR: fd: add fd_tables_are_split() to test for split FD tables Non-zero when FD tables are split per thread group, i.e. an FD is only usable from within its owner group. --- include/haproxy/fd.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/haproxy/fd.h b/include/haproxy/fd.h index d06777b33..8597fc917 100644 --- a/include/haproxy/fd.h +++ b/include/haproxy/fd.h @@ -53,6 +53,14 @@ extern int poller_wr_pipe[MAX_THREADS]; extern volatile int ha_used_fds; // Number of FDs we're currently using +/* Non-zero when FD tables are split per thread group, i.e. an FD is only + * usable from within its owner group. + */ +static inline int fd_tables_are_split(void) +{ + return (global.tune.options & GTUNE_NO_TG_FD_SHARING) && global.nbtgroups > 1; +} + /* Deletes an FD from the fdsets. * The file descriptor is also closed. */ -- 2.47.3