Files
ports/net/ucx/files/patch-src_ucm_malloc_malloc__hook.c
T
GenericRikka 294f65945a net/ucx: Unified Communication X for high-performance messaging
UCX (Unified Communication X) is a high-performance communication framework
for modern HPC and data-intensive workloads. It provides low-latency,
high-bandwidth messaging and remote-memory-access primitives across a wide
range of transports, including shared memory, TCP/IP, and RDMA-capable
interconnects such as InfiniBand and RoCE (when supported by the platform).

UCX is commonly used as a communication substrate for MPI, OpenSHMEM, and
other distributed runtimes. It exposes a set of layered APIs (UCP/UCT/UCS/UCM)
to balance portability and performance while enabling optimized transport
selection, rendezvous protocols, and progress models.

PR:		292889
2026-02-24 01:44:48 +01:00

36 lines
1.0 KiB
C

--- src/ucm/malloc/malloc_hook.c.orig 2026-02-04 09:52:46 UTC
+++ src/ucm/malloc/malloc_hook.c
@@ -35,6 +35,12 @@
#include <ucs/sys/sys.h>
#include <ucs/type/spinlock.h>
+#if defined(__FreeBSD__)
+#include <limits.h>
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/sysctl.h>
+#endif
#include <netdb.h>
@@ -45,7 +51,6 @@
#define UCM_MALLOC_INSTALLED_OPT_SYMS UCS_BIT(2) /* Installed optional symbols */
#define UCM_MALLOC_INSTALLED_MALL_SYMS UCS_BIT(3) /* Installed malloc symbols */
-
/* Mangled symbols of C++ allocators */
#define UCM_OPERATOR_NEW_SYMBOL "_Znwm"
#define UCM_OPERATOR_DELETE_SYMBOL "_ZdlPv"
@@ -659,7 +664,11 @@ static void ucm_malloc_populate_glibc_cache()
static void ucm_malloc_populate_glibc_cache()
{
+#if defined(__FreeBSD__)
+ static char hostname[UCS_HOST_NAME_MAX] = {0};
+#else
char hostname[HOST_NAME_MAX];
+#endif
/* Trigger NSS initialization before we install malloc hooks.
* This is needed because NSS could allocate strings with our malloc(), but