]> git.kaiwu.me - haproxy.git/commitdiff
MINOR: fd: add fd_tables_are_split() to test for split FD tables
authorOlivier Houchard <ohouchard@haproxy.com>
Thu, 10 Sep 2026 16:42:59 +0000 (18:42 +0200)
committerOlivier Houchard <cognet@ci0.org>
Thu, 10 Sep 2026 16:33:30 +0000 (18:33 +0200)
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

index d06777b33bd4b2e04646f1fa72bbdf8efe164de5..8597fc9178853d32b580f26a2acf89cbde259706 100644 (file)
@@ -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.
  */