From: Olivier Houchard Date: Thu, 10 Sep 2026 16:42:59 +0000 (+0200) Subject: MINOR: fd: add fd_tables_are_split() to test for split FD tables X-Git-Tag: v3.5-dev7~40 X-Git-Url: https://git.kaiwu.me/?a=commitdiff_plain;h=f8a51c000fe0fbbd497ade0ddb0e9d6f36a0d3de;p=haproxy.git 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. --- 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. */