git: c6ba817b1ac4 - main - net/ucx: Update 1.20.1 => 1.22.0
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 14 Sep 2026 21:30:20 UTC
The branch main has been updated by vvd:
URL: https://cgit.FreeBSD.org/ports/commit/?id=c6ba817b1ac4a2c19544511ab8fff7fc313afb40
commit c6ba817b1ac4a2c19544511ab8fff7fc313afb40
Author: Generic Rikka <rikka.goering@outlook.de>
AuthorDate: 2026-09-14 21:25:57 +0000
Commit: Vladimir Druzenko <vvd@FreeBSD.org>
CommitDate: 2026-09-14 21:29:36 +0000
net/ucx: Update 1.20.1 => 1.22.0
Changelog:
https://github.com/openucx/ucx/releases/tag/v1.21.0
https://github.com/openucx/ucx/releases/tag/v1.22.0
PR: 298500
Sponsored by: UNIS Labs (vvd, commit patch)
---
net/ucx/Makefile | 2 +-
net/ucx/distinfo | 6 +-
net/ucx/files/patch-Makefile.am | 4 +-
net/ucx/files/patch-config_m4_ucm.m4 | 33 -----
net/ucx/files/patch-configure.ac | 102 +++------------
net/ucx/files/patch-src_ucm_mmap_install.c | 55 --------
net/ucx/files/patch-src_ucm_util_replace.c | 58 +--------
net/ucx/files/patch-src_ucm_util_sys.c | 21 +--
net/ucx/files/patch-src_ucp_core_ucp__ep.c | 4 +-
net/ucx/files/patch-src_ucp_core_ucp__worker.c | 24 ++--
net/ucx/files/patch-src_ucp_core_ucp__worker.h | 4 +-
net/ucx/files/patch-src_ucs_arch_aarch64_cpu.h | 10 --
net/ucx/files/patch-src_ucs_config_parser.c | 10 +-
.../patch-src_ucs_datastruct_string__buffer.c | 4 +-
net/ucx/files/patch-src_ucs_debug_debug.c | 11 --
net/ucx/files/patch-src_ucs_debug_log.c | 14 --
net/ucx/files/patch-src_ucs_sys_compiler.h | 17 ---
net/ucx/files/patch-src_ucs_sys_netlink.c | 4 +-
net/ucx/files/patch-src_ucs_sys_sock.c | 4 +-
net/ucx/files/patch-src_ucs_sys_sys.c | 136 +++++++++++++++----
net/ucx/files/patch-src_ucs_sys_sys.h | 26 ----
net/ucx/files/patch-src_ucs_type_float8.h | 67 ++++++----
net/ucx/files/patch-src_uct_base_uct__iface.c | 6 +-
net/ucx/files/patch-src_uct_ib_base_ib__device.c | 17 ---
net/ucx/files/patch-src_uct_ib_base_ib__device.h | 4 +-
net/ucx/files/patch-src_uct_ib_ud_base_ud__iface.c | 4 +-
net/ucx/files/patch-src_uct_sm_mm_base_mm__iface.c | 33 ++++-
.../files/patch-src_uct_sm_mm_posix_mm__posix.c | 118 +++++++++++++++++
.../files/patch-src_uct_sm_scopy_cma_configure.m4 | 15 +++
net/ucx/files/patch-src_uct_tcp_tcp__base.c | 26 +++-
net/ucx/files/patch-src_uct_tcp_tcp__iface.c | 24 ++--
net/ucx/files/patch-test_apps_iodemo_io__demo.cc | 6 +-
net/ucx/files/patch-test_gtest_common_test.cc | 4 +-
.../files/patch-test_gtest_common_test__helpers.cc | 145 +++++++++++++++++++--
.../files/patch-test_gtest_common_test__helpers.h | 4 +-
.../files/patch-test_gtest_ucp_test__ucp__am.cc | 4 +-
.../patch-test_gtest_ucp_test__ucp__proto__mock.cc | 18 +++
net/ucx/files/patch-test_gtest_ucs_test__async.cc | 4 +-
net/ucx/files/patch-test_gtest_ucs_test__config.cc | 8 +-
net/ucx/files/patch-test_gtest_uct_test__md.cc | 4 +-
net/ucx/files/patch-test_gtest_uct_test__mm.cc | 17 +++
41 files changed, 597 insertions(+), 480 deletions(-)
diff --git a/net/ucx/Makefile b/net/ucx/Makefile
index e1b35a6a76ec..a0aa09488d6b 100644
--- a/net/ucx/Makefile
+++ b/net/ucx/Makefile
@@ -1,5 +1,5 @@
PORTNAME= ucx
-DISTVERSION= 1.20.1
+DISTVERSION= 1.22.0
PORTREVISION= 4
CATEGORIES= net
MASTER_SITES= https://github.com/openucx/ucx/releases/download/v${DISTVERSION}/
diff --git a/net/ucx/distinfo b/net/ucx/distinfo
index a2d38f6413d8..b5412b0f4f40 100644
--- a/net/ucx/distinfo
+++ b/net/ucx/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1781120416
-SHA256 (ucx-1.20.1.tar.gz) = 545c419a7b5e04643cb8bff5a19b3b5071a8f8f0605f1e8efb36f8f3d7bfb9d3
-SIZE (ucx-1.20.1.tar.gz) = 3505964
+TIMESTAMP = 1788913800
+SHA256 (ucx-1.22.0.tar.gz) = 258941cddd14ca60d38c0d31b9b09ec1052c901086841011a498da8b55a3cb24
+SIZE (ucx-1.22.0.tar.gz) = 3689879
diff --git a/net/ucx/files/patch-Makefile.am b/net/ucx/files/patch-Makefile.am
index 8993d3b04bd6..0bf24b316414 100644
--- a/net/ucx/files/patch-Makefile.am
+++ b/net/ucx/files/patch-Makefile.am
@@ -1,6 +1,6 @@
---- Makefile.am.orig 2026-02-05 12:41:56 UTC
+--- Makefile.am.orig 2026-09-09 00:55:51 UTC
+++ Makefile.am
-@@ -59,8 +59,10 @@ SUBDIRS += \
+@@ -55,8 +55,10 @@ SUBDIRS += \
cmake \
config
diff --git a/net/ucx/files/patch-config_m4_ucm.m4 b/net/ucx/files/patch-config_m4_ucm.m4
deleted file mode 100644
index 7ba238108c02..000000000000
--- a/net/ucx/files/patch-config_m4_ucm.m4
+++ /dev/null
@@ -1,33 +0,0 @@
---- config/m4/ucm.m4.orig 2026-02-04 09:52:46 UTC
-+++ config/m4/ucm.m4
-@@ -15,11 +15,18 @@ AC_ARG_WITH([allocator],
- [],
- [with_allocator=ptmalloc286])
-
-+AC_CHECK_FUNCS([brk sbrk], [], [], [#include <unistd.h>])
-+
-+HAVE_UCM_PTMALLOC286=no
-+
- case ${with_allocator} in
- ptmalloc286)
- AC_MSG_NOTICE(Memory allocator is ptmalloc-2.8.6 version)
-- AC_DEFINE([HAVE_UCM_PTMALLOC286], 1, [Use ptmalloc-2.8.6 version])
-- HAVE_UCM_PTMALLOC286=yes
-+ AS_IF([test "x$ac_cv_func_brk" = "xyes" && test "x$ac_cv_func_sbrk" = "xyes"],
-+ [AC_DEFINE([HAVE_UCM_PTMALLOC286], 1, [Use ptmalloc-2.8.6 version])
-+ HAVE_UCM_PTMALLOC286=yes],
-+ [AC_MSG_WARN([brk()/sbrk() not available; disabling ptmalloc286 allocator])
-+ HAVE_UCM_PTMALLOC286=no])
- ;;
- *)
- AC_MSG_ERROR(Cannot continue. Unsupported memory allocator name
-@@ -83,6 +90,9 @@ AS_IF([test "x$mmap_hooks_happy" = "xyes"],
- AS_IF([test "x$mmap_hooks_happy" = "xyes"],
- AS_IF([test "x$ipc_hooks_happy" = "xyes" -o "x$shm_hooks_happy" = "xyes"],
- [bistro_hooks_happy=yes]))
-+
-+AS_IF([test "x$ac_cv_func_brk" != "xyes" -o "x$ac_cv_func_sbrk" != "xyes"],
-+ [bistro_hooks_happy=no])
-
- AS_IF([test "x$bistro_hooks_happy" = "xyes"],
- [AC_DEFINE([UCM_BISTRO_HOOKS], [1], [Enable BISTRO hooks])],
diff --git a/net/ucx/files/patch-configure.ac b/net/ucx/files/patch-configure.ac
index 80c52b4ff672..731a3955d42a 100644
--- a/net/ucx/files/patch-configure.ac
+++ b/net/ucx/files/patch-configure.ac
@@ -1,106 +1,42 @@
---- configure.ac.orig 2026-06-12 20:50:26 UTC
+--- configure.ac.orig 2026-09-09 00:44:04 UTC
+++ configure.ac
-@@ -14,8 +14,6 @@ define([ucx_ver_extra], ) # Extra version string. Em
- define([ucx_ver_patch], 1) # Patch version. Increased for a bugfix release.
- define([ucx_ver_extra], ) # Extra version string. Empty for a general release.
-
--define([ts], esyscmd([sh -c "date +%Y%m%d%H%M%S"]))
--
- # This is the API version (see libtool library versioning)
- # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
- # current:rev:age
-@@ -31,14 +29,20 @@ AC_CONFIG_HEADERS([config.h])
- AC_USE_SYSTEM_EXTENSIONS
- AC_CONFIG_HEADERS([config.h])
-
--AC_CHECK_PROG(GITBIN, git, yes)
--AS_IF([test x"${GITBIN}" = x"yes"],
-- [# remove preceding "refs/heads/" (11 characters) for symbolic ref
-- AC_SUBST(SCM_BRANCH, esyscmd([sh -c 'git symbolic-ref --quiet HEAD | sed "s/^.\{11\}//"']))
-- AC_SUBST(SCM_VERSION, esyscmd([sh -c 'git rev-parse --short=7 HEAD']))],
-- [AC_SUBST(SCM_BRANCH, "<unknown>")
-- AC_SUBST(SCM_VERSION, "0000000")])
-+AC_PATH_PROG([GIT], [git], [:])
-
-+SCM_BRANCH="<unknown>"
-+SCM_VERSION="0000000"
-+
-+AS_IF([test -d "${srcdir}/.git" && test "x$GIT" != "x:" && \
-+ $GIT -C "${srcdir}" rev-parse --is-inside-work-tree >/dev/null 2>&1], [
-+ SCM_BRANCH=`$GIT -C "${srcdir}" symbolic-ref --quiet HEAD 2>/dev/null | sed 's,^refs/heads/,,'`
-+ SCM_VERSION=`$GIT -C "${srcdir}" rev-parse --short=7 HEAD 2>/dev/null`
-+])
-+
-+AC_SUBST([SCM_BRANCH])
-+AC_SUBST([SCM_VERSION])
-+
- AH_TOP([
- #ifndef UCX_CONFIG_H
- #define UCX_CONFIG_H
-@@ -85,9 +89,44 @@ AC_FUNC_STRERROR_R
+@@ -122,7 +122,38 @@ AC_FUNC_STRERROR_R
AC_C_RESTRICT
AC_FUNC_STRERROR_R
-AC_PATH_TOOL([PKG_CONFIG], [pkg-config], [pkg-config])
+PKG_PROG_PKG_CONFIG
-
++
+dnl Float word order can differ from integer endianness on some ABIs.
-+ dnl Prefer Autoconf's macro if available; otherwise fall back to autoconf-archive.
-+ m4_ifdef([AC_C_FLOAT_WORDS_BIGENDIAN],
-+ [AC_C_FLOAT_WORDS_BIGENDIAN],
-+ [m4_ifdef([AX_C_FLOAT_WORDS_BIGENDIAN],
-+ [AX_C_FLOAT_WORDS_BIGENDIAN],
-+ [AC_MSG_ERROR([need AC_C_FLOAT_WORDS_BIGENDIAN or AX_C_FLOAT_WORDS_BIGENDIAN])])])
-
++dnl Prefer Autoconf's macro if available; otherwise fall back to autoconf-archive.
++m4_ifdef([AC_C_FLOAT_WORDS_BIGENDIAN],
++ [AC_C_FLOAT_WORDS_BIGENDIAN],
++ [m4_ifdef([AX_C_FLOAT_WORDS_BIGENDIAN],
++ [AX_C_FLOAT_WORDS_BIGENDIAN],
++ [AC_MSG_ERROR([need AC_C_FLOAT_WORDS_BIGENDIAN or AX_C_FLOAT_WORDS_BIGENDIAN])])])
++
+AC_CHECK_HEADERS([sys/eventfd.h sys/timerfd.h])
+AC_CHECK_HEADERS([netinet/in.h arpa/inet.h])
+
-+AC_CHECK_FUNCS([brk sbrk])
-+
++dnl brk()/sbrk() detection itself is performed by config/m4/ucm.m4.
++dnl Keep a common feature define for FreeBSD UCM compatibility code.
+AS_IF([test "x$ac_cv_func_brk" = "xyes" && test "x$ac_cv_func_sbrk" = "xyes"],
+ [have_brk_sbrk=yes],
+ [have_brk_sbrk=no])
+
-+have_ucm_malloc_hooks=no
-+case "$host_os" in
-+ linux*) have_ucm_malloc_hooks=yes ;;
-+ *) have_ucm_malloc_hooks=no ;;
-+esac
-+AM_CONDITIONAL([HAVE_UCM_MALLOC_HOOKS], [test "x$have_ucm_malloc_hooks" = xyes])
++AM_CONDITIONAL([HAVE_BRK_SBRK],
++ [test "x$have_brk_sbrk" = "xyes"])
+
-+AM_CONDITIONAL([HAVE_BRK_SBRK], [test "x$have_brk_sbrk" = "xyes"])
+AS_IF([test "x$have_brk_sbrk" = "xyes"],
+ [AC_DEFINE([HAVE_BRK_SBRK], [1],
-+ [Define if both brk() and sbrk() are available])],
-+ [])
++ [Define if both brk() and sbrk() are available])])
+
+case "$host_os" in
+ freebsd*) build_gtest=no ;;
+ *) build_gtest=yes ;;
+esac
-+AM_CONDITIONAL([BUILD_GTEST], [test "x$build_gtest" = xyes])
-+
- #
- # Define SHARED_LIB preprocessor macro when building a shared library
- #
-@@ -255,6 +294,20 @@ AS_IF([test "x$with_docs_only" = xyes],
- m4_include([test/apps/iodemo/configure.m4])
- m4_include([test/apps/uct_info/configure.m4])
-
-+AS_IF([test "x$with_docs_only" != xyes], [
-+ have_gtest=yes
-+], [
-+ have_gtest=no
-+])
-+
-+AM_CONDITIONAL([HAVE_GTEST], [test "x$have_gtest" = "xyes"])
-+
-+GTEST_CPPFLAGS="${GTEST_CFLAGS}"
-+GTEST_CXXFLAGS="${GTEST_CFLAGS}"
-+GTEST_LDFLAGS=""
-+AC_SUBST([GTEST_CPPFLAGS])
-+AC_SUBST([GTEST_CXXFLAGS])
-+AC_SUBST([GTEST_LDFLAGS])
++AM_CONDITIONAL([BUILD_GTEST],
++ [test "x$build_gtest" = xyes])
- #
- # Disable checking user parameters
+ AS_IF([test "x$enable_module_deepbind" = xyes],
+ [AC_CHECK_DECLS([RTLD_DEEPBIND],
diff --git a/net/ucx/files/patch-src_ucm_mmap_install.c b/net/ucx/files/patch-src_ucm_mmap_install.c
deleted file mode 100644
index 33a4ea90b28f..000000000000
--- a/net/ucx/files/patch-src_ucm_mmap_install.c
+++ /dev/null
@@ -1,55 +0,0 @@
---- src/ucm/mmap/install.c.orig 2026-02-04 09:52:46 UTC
-+++ src/ucm/mmap/install.c
-@@ -86,8 +86,10 @@ static ucm_mmap_func_t ucm_mmap_funcs[] = {
- #endif
- { UCM_MMAP_RELOC_ENTRY(shmat), UCM_EVENT_SHMAT, UCM_EVENT_NONE},
- { UCM_MMAP_RELOC_ENTRY(shmdt), UCM_EVENT_SHMDT, UCM_EVENT_SHMAT},
-+#ifdef HAVE_BRK_SBRK
- { UCM_MMAP_RELOC_ENTRY(sbrk), UCM_EVENT_SBRK, UCM_EVENT_NONE},
- { UCM_MMAP_RELOC_ENTRY(brk), UCM_EVENT_BRK, UCM_EVENT_NONE},
-+#endif
- { UCM_MMAP_RELOC_ENTRY(madvise), UCM_EVENT_MADVISE, UCM_EVENT_NONE},
- { {NULL, NULL, NULL}, UCM_EVENT_NONE}
- };
-@@ -135,6 +137,7 @@ static void ucm_mmap_event_test_callback(ucm_event_typ
- }
- }
-
-+#ifdef HAVE_BRK_SBRK
- /* Call brk() and check return value, to avoid compile error of unused result */
- static void ucm_brk_checked(void *addr)
- {
-@@ -143,6 +146,7 @@ static void ucm_brk_checked(void *addr)
- ucm_diag("brk(addr=%p) failed: %m", addr);
- }
- }
-+#endif
-
- /* Fire events with pre/post action. The problem is in call sequence: we
- * can't just fire single event - most of the system calls require set of
-@@ -199,6 +203,7 @@ ucm_fire_mmap_events_internal(int events, ucm_mmap_tes
- }
-
- if (exclusive && !RUNNING_ON_VALGRIND) {
-+#ifdef HAVE_BRK_SBRK
- sbrk_size = ucm_get_page_size();
- if (events & (UCM_EVENT_BRK|UCM_EVENT_VM_MAPPED|UCM_EVENT_VM_UNMAPPED)) {
- p = ucm_get_current_brk();
-@@ -213,14 +218,17 @@ ucm_fire_mmap_events_internal(int events, ucm_mmap_tes
- UCM_FIRE_EVENT(events, UCM_EVENT_SBRK|UCM_EVENT_VM_UNMAPPED,
- data, (void)sbrk(-sbrk_size));
- }
-+#endif
- } else {
- /* To avoid side effects on other threads and valgrind heap corruption,
- * pass invalid parameters. We assume that if the natives events are
- * delivered, it means VM_MAPPED/UNMAPPED would be delivered as well.
- */
-+#ifdef HAVE_BRK_SBRK
- if (events & UCM_EVENT_BRK) {
- UCM_FIRE_EVENT(events, UCM_EVENT_BRK, data, ucm_brk_checked(NULL));
- }
-+#endif
- }
-
- if (events & (UCM_EVENT_MADVISE|UCM_EVENT_VM_UNMAPPED)) {
diff --git a/net/ucx/files/patch-src_ucm_util_replace.c b/net/ucx/files/patch-src_ucm_util_replace.c
index c14023c8fe4b..cc52f68e68ce 100644
--- a/net/ucx/files/patch-src_ucm_util_replace.c
+++ b/net/ucx/files/patch-src_ucm_util_replace.c
@@ -1,62 +1,10 @@
---- src/ucm/util/replace.c.orig 2026-02-04 09:52:46 UTC
+--- src/ucm/util/replace.c.orig 2026-09-09 00:53:37 UTC
+++ src/ucm/util/replace.c
-@@ -55,8 +55,10 @@ UCM_DEFINE_REPLACE_FUNC(shmdt, int, -1, co
- #endif
- UCM_DEFINE_REPLACE_FUNC(shmat, void*, MAP_FAILED, int, const void*, int)
- UCM_DEFINE_REPLACE_FUNC(shmdt, int, -1, const void*)
-+#ifdef HAVE_BRK_SBRK
- UCM_DEFINE_REPLACE_FUNC(sbrk, void*, MAP_FAILED, intptr_t)
- UCM_DEFINE_REPLACE_FUNC(brk, int, -1, void*)
-+#endif
- UCM_DEFINE_REPLACE_FUNC(madvise, int, -1, void*, size_t, int)
-
- UCM_DEFINE_SELECT_FUNC(mmap, void*, SYS_mmap, void*, size_t, int, int, int,
-@@ -122,6 +124,7 @@ int ucm_orig_shmdt(const void *shmaddr)
-
- #endif
-
-+#ifdef HAVE_BRK_SBRK
- _UCM_DEFINE_DLSYM_FUNC(brk, ucm_orig_dlsym_brk, ucm_override_brk, int, void*)
-
- int ucm_orig_brk(void *addr)
-@@ -156,7 +159,32 @@ void *ucm_orig_sbrk(intptr_t increment)
- (void*)-1 : prev;
- }
- }
-+#else
-+int ucm_orig_brk(void *addr)
-+{
-+ (void)addr;
-+ errno = ENOSYS;
-+ return -1;
-+}
-
-+void *ucm_orig_sbrk(intptr_t increment)
-+{
-+ (void)increment;
-+ errno = ENOSYS;
-+ return MAP_FAILED;
-+}
-+
-+int ucm_override_brk(void *addr)
-+{
-+ return ucm_orig_brk(addr);
-+}
-+
-+void *ucm_override_sbrk(intptr_t increment)
-+{
-+ return ucm_orig_sbrk(increment);
-+}
-+#endif
-+
- #else /* UCM_BISTRO_HOOKS */
-
- UCM_DEFINE_DLSYM_FUNC(brk, int, void*)
-@@ -168,9 +196,13 @@ void *ucm_get_current_brk()
+@@ -176,9 +176,13 @@ void *ucm_get_current_brk()
void *ucm_get_current_brk()
{
-+#ifdef HAVE_BRK_SBRK
++#if HAVE_BRK
#if HAVE___CURBRK
return __curbrk;
#else
diff --git a/net/ucx/files/patch-src_ucm_util_sys.c b/net/ucx/files/patch-src_ucm_util_sys.c
index d09fb998b3f3..9d8fea20b16e 100644
--- a/net/ucx/files/patch-src_ucm_util_sys.c
+++ b/net/ucx/files/patch-src_ucm_util_sys.c
@@ -1,4 +1,4 @@
---- src/ucm/util/sys.c.orig 2026-02-04 09:52:46 UTC
+--- src/ucm/util/sys.c.orig 2026-09-09 00:55:51 UTC
+++ src/ucm/util/sys.c
@@ -14,6 +14,13 @@
# include "config.h"
@@ -124,20 +124,8 @@
}
typedef struct {
-@@ -377,15 +454,31 @@ void *ucm_brk_syscall(void *addr)
-
- void *ucm_brk_syscall(void *addr)
- {
-+#if defined(__linux__)
- /* Return type is equivalent to full pointer size */
- UCS_STATIC_ASSERT(sizeof(syscall(0)) == sizeof(void*));
--
- return (void*)syscall(SYS_brk, addr);
-+#else
-+ (void)addr;
-+ errno = ENOSYS;
-+ return NULL;
-+#endif
+@@ -389,9 +466,21 @@ void *ucm_brk_syscall(void *addr)
+ #endif
}
-pid_t ucm_get_tid()
@@ -148,10 +136,11 @@
+ return (pid_t)syscall(SYS_gettid);
+#elif defined(__FreeBSD__)
+ long tid;
++
+ if (thr_self(&tid) == 0) {
+ return (pid_t)tid;
+ }
-+ /* fallback */
++
+ return (pid_t)getpid();
+#else
+ return (pid_t)getpid();
diff --git a/net/ucx/files/patch-src_ucp_core_ucp__ep.c b/net/ucx/files/patch-src_ucp_core_ucp__ep.c
index de942fa55c93..1437b85ffaaf 100644
--- a/net/ucx/files/patch-src_ucp_core_ucp__ep.c
+++ b/net/ucx/files/patch-src_ucp_core_ucp__ep.c
@@ -1,6 +1,6 @@
---- src/ucp/core/ucp_ep.c.orig 2026-07-01 23:04:16 UTC
+--- src/ucp/core/ucp_ep.c.orig 2026-09-09 02:32:02 UTC
+++ src/ucp/core/ucp_ep.c
-@@ -3181,11 +3181,25 @@ void ucp_ep_config_lane_info_str(ucp_worker_h worker,
+@@ -3499,11 +3499,25 @@ void ucp_ep_config_lane_info_str(ucp_worker_h worker,
}
dst_md_index = key->lanes[lane].dst_md_index;
diff --git a/net/ucx/files/patch-src_ucp_core_ucp__worker.c b/net/ucx/files/patch-src_ucp_core_ucp__worker.c
index 671c3fa16573..da3ba04e02e6 100644
--- a/net/ucx/files/patch-src_ucp_core_ucp__worker.c
+++ b/net/ucx/files/patch-src_ucp_core_ucp__worker.c
@@ -1,4 +1,4 @@
---- src/ucp/core/ucp_worker.c.orig 2026-02-05 12:41:56 UTC
+--- src/ucp/core/ucp_worker.c.orig 2026-09-09 02:32:02 UTC
+++ src/ucp/core/ucp_worker.c
@@ -9,6 +9,8 @@
# include "config.h"
@@ -9,7 +9,7 @@
#include "ucp_am.h"
#include "ucp_ep_vfs.h"
#include "ucp_worker.h"
-@@ -35,9 +37,18 @@
+@@ -36,9 +38,18 @@
#include <ucs/vfs/base/vfs_cb.h>
#include <ucs/vfs/base/vfs_obj.h>
#include <sys/poll.h>
@@ -29,7 +29,7 @@
#include <time.h>
-@@ -290,7 +301,10 @@ static ucs_status_t ucp_worker_wakeup_init(ucp_worker_
+@@ -291,7 +302,10 @@ static ucs_status_t ucp_worker_wakeup_init(ucp_worker_
worker->event_fd = -1;
worker->event_set = NULL;
worker->eventfd = -1;
@@ -41,7 +41,7 @@
status = UCS_OK;
goto out;
}
-@@ -320,6 +334,19 @@ static ucs_status_t ucp_worker_wakeup_init(ucp_worker_
+@@ -321,6 +335,19 @@ static ucs_status_t ucp_worker_wakeup_init(ucp_worker_
worker->flags |= UCP_WORKER_FLAG_EDGE_TRIGGERED;
}
@@ -61,7 +61,7 @@
worker->eventfd = eventfd(0, EFD_CLOEXEC | EFD_NONBLOCK);
if (worker->eventfd == -1) {
ucs_error("Failed to create event fd: %m");
-@@ -328,6 +355,13 @@ static ucs_status_t ucp_worker_wakeup_init(ucp_worker_
+@@ -329,6 +356,13 @@ static ucs_status_t ucp_worker_wakeup_init(ucp_worker_
}
ucp_worker_wakeup_ctl_fd(worker, UCP_WORKER_EPFD_OP_ADD, worker->eventfd);
@@ -75,7 +75,7 @@
worker->uct_events = 0;
-@@ -371,6 +405,12 @@ static void ucp_worker_wakeup_cleanup(ucp_worker_h wor
+@@ -372,6 +406,12 @@ static void ucp_worker_wakeup_cleanup(ucp_worker_h wor
}
if (worker->eventfd != -1) {
close(worker->eventfd);
@@ -88,7 +88,7 @@
}
}
-@@ -423,12 +463,24 @@ static ucs_status_t ucp_worker_wakeup_signal_fd(ucp_wo
+@@ -424,12 +464,24 @@ static ucs_status_t ucp_worker_wakeup_signal_fd(ucp_wo
static ucs_status_t ucp_worker_wakeup_signal_fd(ucp_worker_h worker)
{
uint64_t dummy = 1;
@@ -115,7 +115,7 @@
if (ret == sizeof(dummy)) {
return UCS_OK;
} else if (ret == -1) {
-@@ -3375,7 +3427,7 @@ void ucp_worker_print_info(ucp_worker_h worker, FILE *
+@@ -3501,7 +3553,7 @@ void ucp_worker_print_info(ucp_worker_h worker, FILE *
UCP_WORKER_THREAD_CS_EXIT_CONDITIONAL(worker);
}
@@ -124,7 +124,7 @@
ucp_worker_keepalive_timerfd_init(ucp_worker_h worker)
{
ucs_time_t ka_interval = worker->context->config.ext.keepalive_interval;
-@@ -3385,14 +3437,18 @@ ucp_worker_keepalive_timerfd_init(ucp_worker_h worker)
+@@ -3511,14 +3563,18 @@ ucp_worker_keepalive_timerfd_init(ucp_worker_h worker)
if (!(worker->context->config.features & UCP_FEATURE_WAKEUP) ||
(worker->keepalive.timerfd >= 0)) {
@@ -147,7 +147,7 @@
}
ucs_assert(ka_interval > 0);
-@@ -3412,10 +3468,11 @@ ucp_worker_keepalive_timerfd_init(ucp_worker_h worker)
+@@ -3538,10 +3594,11 @@ ucp_worker_keepalive_timerfd_init(ucp_worker_h worker)
ucp_worker_wakeup_ctl_fd(worker, UCP_WORKER_EPFD_OP_ADD,
worker->keepalive.timerfd);
@@ -160,7 +160,7 @@
}
static UCS_F_ALWAYS_INLINE void
-@@ -3571,6 +3628,7 @@ void ucp_worker_keepalive_add_ep(ucp_ep_h ep)
+@@ -3704,6 +3761,7 @@ void ucp_worker_keepalive_add_ep(ucp_ep_h ep)
void ucp_worker_keepalive_add_ep(ucp_ep_h ep)
{
ucp_worker_h worker = ep->worker;
@@ -168,7 +168,7 @@
if (ucp_ep_config(ep)->key.keepalive_lane == UCP_NULL_LANE) {
ucs_trace("ep %p flags 0x%x cfg_index %d err_mode %d: keepalive lane"
-@@ -3579,7 +3637,12 @@ void ucp_worker_keepalive_add_ep(ucp_ep_h ep)
+@@ -3712,7 +3770,12 @@ void ucp_worker_keepalive_add_ep(ucp_ep_h ep)
return;
}
diff --git a/net/ucx/files/patch-src_ucp_core_ucp__worker.h b/net/ucx/files/patch-src_ucp_core_ucp__worker.h
index 3a91f11aef42..b4fec1b28364 100644
--- a/net/ucx/files/patch-src_ucp_core_ucp__worker.h
+++ b/net/ucx/files/patch-src_ucp_core_ucp__worker.h
@@ -1,6 +1,6 @@
---- src/ucp/core/ucp_worker.h.orig 2026-02-05 12:41:56 UTC
+--- src/ucp/core/ucp_worker.h.orig 2026-09-09 02:32:02 UTC
+++ src/ucp/core/ucp_worker.h
-@@ -319,6 +319,10 @@ typedef struct ucp_worker {
+@@ -323,6 +323,10 @@ typedef struct ucp_worker {
int event_fd; /* Allocated (on-demand) event fd for wakeup */
ucs_sys_event_set_t *event_set; /* Allocated UCS event set for wakeup */
int eventfd; /* Event fd to support signal() calls */
diff --git a/net/ucx/files/patch-src_ucs_arch_aarch64_cpu.h b/net/ucx/files/patch-src_ucs_arch_aarch64_cpu.h
deleted file mode 100644
index 74a17feb2179..000000000000
--- a/net/ucx/files/patch-src_ucs_arch_aarch64_cpu.h
+++ /dev/null
@@ -1,10 +0,0 @@
---- src/ucs/arch/aarch64/cpu.h.orig 2026-02-17 21:08:28 UTC
-+++ src/ucs/arch/aarch64/cpu.h
-@@ -15,6 +15,7 @@
- #include <string.h>
- #include <sys/times.h>
- #include <ucs/sys/compiler_def.h>
-+#include <ucs/sys/ptr_arith.h>
- #include <ucs/arch/generic/cpu.h>
- #include <ucs/sys/math.h>
- #include <ucs/type/status.h>
diff --git a/net/ucx/files/patch-src_ucs_config_parser.c b/net/ucx/files/patch-src_ucs_config_parser.c
index 8ab9c6cda94d..09246725ab89 100644
--- a/net/ucx/files/patch-src_ucs_config_parser.c
+++ b/net/ucx/files/patch-src_ucs_config_parser.c
@@ -1,14 +1,14 @@
---- src/ucs/config/parser.c.orig 2026-02-05 12:41:56 UTC
+--- src/ucs/config/parser.c.orig 2026-09-09 02:32:02 UTC
+++ src/ucs/config/parser.c
-@@ -25,6 +25,7 @@
- #include <fnmatch.h>
+@@ -27,6 +27,7 @@
#include <ctype.h>
#include <libgen.h>
+ #include <regex.h>
+#include <signal.h>
/* width of titles in docstring */
-@@ -693,6 +694,8 @@ int ucs_config_sscanf_signo(const char *buf, void *des
+@@ -697,6 +698,8 @@ int ucs_config_sscanf_signo(const char *buf, void *des
int ucs_config_sscanf_signo(const char *buf, void *dest, const void *arg)
{
char *endptr;
@@ -17,7 +17,7 @@
int signo;
signo = strtol(buf, &endptr, 10);
-@@ -701,11 +704,31 @@ int ucs_config_sscanf_signo(const char *buf, void *des
+@@ -705,11 +708,31 @@ int ucs_config_sscanf_signo(const char *buf, void *des
return 1;
}
diff --git a/net/ucx/files/patch-src_ucs_datastruct_string__buffer.c b/net/ucx/files/patch-src_ucs_datastruct_string__buffer.c
index e69c65333301..ad15550c35de 100644
--- a/net/ucx/files/patch-src_ucs_datastruct_string__buffer.c
+++ b/net/ucx/files/patch-src_ucs_datastruct_string__buffer.c
@@ -1,6 +1,6 @@
---- src/ucs/datastruct/string_buffer.c.orig 2026-05-17 17:31:16 UTC
+--- src/ucs/datastruct/string_buffer.c.orig 2026-09-09 02:36:31 UTC
+++ src/ucs/datastruct/string_buffer.c
-@@ -141,8 +141,13 @@ void ucs_string_buffer_append_iovec(ucs_string_buffer_
+@@ -151,8 +151,13 @@ void ucs_string_buffer_append_iovec(ucs_string_buffer_
size_t iov_index;
for (iov_index = 0; iov_index < iovcnt; ++iov_index) {
diff --git a/net/ucx/files/patch-src_ucs_debug_debug.c b/net/ucx/files/patch-src_ucs_debug_debug.c
deleted file mode 100644
index 01aebbd3f7e3..000000000000
--- a/net/ucx/files/patch-src_ucs_debug_debug.c
+++ /dev/null
@@ -1,11 +0,0 @@
---- src/ucs/debug/debug.c.orig 2026-01-12 18:10:14 UTC
-+++ src/ucs/debug/debug.c
-@@ -24,6 +24,8 @@
- #include <dlfcn.h>
- #include <link.h>
- #include <dirent.h>
-+#include <signal.h>
-+#include <stdlib.h>
- #ifdef HAVE_DETAILED_BACKTRACE
- # include <bfd.h>
- #endif /* HAVE_DETAILED_BACKTRACE */
diff --git a/net/ucx/files/patch-src_ucs_debug_log.c b/net/ucx/files/patch-src_ucs_debug_log.c
deleted file mode 100644
index ab60cc2bdfe6..000000000000
--- a/net/ucx/files/patch-src_ucs_debug_log.c
+++ /dev/null
@@ -1,14 +0,0 @@
---- src/ucs/debug/log.c.orig 2026-02-04 09:52:46 UTC
-+++ src/ucs/debug/log.c
-@@ -78,7 +78,11 @@ static int __thread ucs_log_current_indent = 0;
- static unsigned ucs_log_handlers_count = 0;
- static int ucs_log_initialized = 0;
- static int __thread ucs_log_current_indent = 0;
-+#if defined(__FreeBSD__)
-+static char ucs_log_hostname[UCS_HOST_NAME_MAX] = {0};
-+#else
- static char ucs_log_hostname[HOST_NAME_MAX] = {0};
-+#endif
- static int ucs_log_pid = 0;
- static FILE *ucs_log_file = NULL;
- static char *ucs_log_file_base_name = NULL;
diff --git a/net/ucx/files/patch-src_ucs_sys_compiler.h b/net/ucx/files/patch-src_ucs_sys_compiler.h
deleted file mode 100644
index 9fe706c4c951..000000000000
--- a/net/ucx/files/patch-src_ucs_sys_compiler.h
+++ /dev/null
@@ -1,17 +0,0 @@
---- src/ucs/sys/compiler.h.orig 2026-02-04 09:52:46 UTC
-+++ src/ucs/sys/compiler.h
-@@ -32,7 +32,13 @@
-
- /* A function which should not be optimized */
- #if defined(HAVE_ATTRIBUTE_NOOPTIMIZE) && (HAVE_ATTRIBUTE_NOOPTIMIZE == 1)
--#define UCS_F_NOOPTIMIZE __attribute__((optimize("O0")))
-+#if defined(__clang__)
-+# define UCS_F_NOOPTIMIZE __attribute__((optnone))
-+#elif defined(__GNUC__)
-+# define UCS_F_NOOPTIMIZE __attribute__((optimize("O0")))
-+#else
-+# define UCS_F_NOOPTIMIZE
-+#endif
- #else
- #define UCS_F_NOOPTIMIZE
- #endif
diff --git a/net/ucx/files/patch-src_ucs_sys_netlink.c b/net/ucx/files/patch-src_ucs_sys_netlink.c
index a1a451b6e205..deb0898adc63 100644
--- a/net/ucx/files/patch-src_ucs_sys_netlink.c
+++ b/net/ucx/files/patch-src_ucs_sys_netlink.c
@@ -1,4 +1,4 @@
---- src/ucs/sys/netlink.c.orig 2026-05-06 13:47:14 UTC
+--- src/ucs/sys/netlink.c.orig 2026-09-09 14:48:02 UTC
+++ src/ucs/sys/netlink.c
@@ -8,6 +8,8 @@
#include "config.h"
@@ -9,7 +9,7 @@
#include "netlink.h"
#include <ucs/datastruct/khash.h>
-@@ -347,3 +349,80 @@ int ucs_netlink_is_best_route(int if_index, const stru
+@@ -384,3 +386,80 @@ int ucs_netlink_is_best_route(int if_index, const stru
return (ucs_netlink_max_netmask_len(sa_remote) == netmask_len);
}
diff --git a/net/ucx/files/patch-src_ucs_sys_sock.c b/net/ucx/files/patch-src_ucs_sys_sock.c
index 541411d97e83..3dfec75b51f4 100644
--- a/net/ucx/files/patch-src_ucs_sys_sock.c
+++ b/net/ucx/files/patch-src_ucs_sys_sock.c
@@ -1,4 +1,4 @@
---- src/ucs/sys/sock.c.orig 2026-05-06 13:47:14 UTC
+--- src/ucs/sys/sock.c.orig 2026-09-09 14:48:02 UTC
+++ src/ucs/sys/sock.c
@@ -20,7 +20,10 @@
@@ -11,7 +11,7 @@
#include <unistd.h>
#include <errno.h>
#include <string.h>
-@@ -517,6 +520,16 @@ int ucs_socket_max_conn()
+@@ -524,6 +527,16 @@ int ucs_socket_max_conn()
int ucs_socket_max_conn()
{
static long somaxconn_val = 0;
diff --git a/net/ucx/files/patch-src_ucs_sys_sys.c b/net/ucx/files/patch-src_ucs_sys_sys.c
index 0e8f1cf6cef2..87eed1335220 100644
--- a/net/ucx/files/patch-src_ucs_sys_sys.c
+++ b/net/ucx/files/patch-src_ucs_sys_sys.c
@@ -1,6 +1,6 @@
---- src/ucs/sys/sys.c.orig 2026-05-06 13:47:14 UTC
+--- src/ucs/sys/sys.c.orig 2026-09-12 01:59:18 UTC
+++ src/ucs/sys/sys.c
-@@ -23,16 +23,28 @@
+@@ -23,16 +23,29 @@
#include <ucm/util/sys.h>
#include <unistd.h>
@@ -25,11 +25,12 @@
+#include <sys/param.h>
+#include <sys/cpuset.h>
+#include <sys/sysctl.h>
++#include <sys/user.h>
+#endif
#ifdef HAVE_SYS_THR_H
#include <sys/thr.h>
#endif
-@@ -94,7 +106,7 @@ const char *ucs_get_host_name()
+@@ -94,7 +107,7 @@ const char *ucs_get_host_name()
const char *ucs_get_host_name()
{
@@ -38,7 +39,7 @@
if (*hostname == 0) {
gethostname(hostname, sizeof(hostname));
-@@ -181,6 +193,46 @@ static uint64_t ucs_get_mac_address()
+@@ -209,6 +222,46 @@ static uint64_t ucs_get_mac_address()
static uint64_t ucs_get_mac_address()
{
static uint64_t mac_address = 0;
@@ -85,7 +86,7 @@
struct ifreq ifr, *it, *end;
struct ifconf ifc;
char buf[1024];
-@@ -228,6 +280,7 @@ static uint64_t ucs_get_mac_address()
+@@ -256,6 +309,7 @@ static uint64_t ucs_get_mac_address()
}
return mac_address;
@@ -93,7 +94,7 @@
}
static uint64_t __sumup_host_name(unsigned prime_index)
-@@ -671,6 +724,21 @@ size_t ucs_get_memfree_size()
+@@ -699,6 +753,22 @@ size_t ucs_get_memfree_size()
{
ssize_t mem_free;
@@ -110,12 +111,13 @@
+ return v_free_count * pagesize;
+ }
+ }
++
+ return UCS_DEFAULT_MEM_FREE;
+#else
- mem_free = ucs_get_meminfo_entry("MemFree");
+ mem_free = ucs_get_meminfo_entry("MemFree", 1);
if (mem_free == -1) {
mem_free = UCS_DEFAULT_MEM_FREE;
-@@ -679,12 +747,16 @@ size_t ucs_get_memfree_size()
+@@ -707,12 +777,16 @@ size_t ucs_get_memfree_size()
}
return mem_free;
@@ -131,16 +133,41 @@
+#else
/* Cache the huge page size value */
if (huge_page_size == 0) {
- huge_page_size = ucs_get_meminfo_entry("Hugepagesize");
-@@ -696,6 +768,7 @@ ssize_t ucs_get_huge_page_size()
+ huge_page_size = ucs_get_meminfo_entry("Hugepagesize", 1);
+@@ -724,6 +798,7 @@ ssize_t ucs_get_huge_page_size()
}
return huge_page_size;
+#endif
}
- size_t ucs_get_phys_mem_size()
-@@ -751,6 +824,10 @@ static void ucs_sysv_shmget_error_check_ENOSPC(size_t
+ static ssize_t ucs_get_huge_pages_count()
+@@ -777,6 +852,17 @@ size_t ucs_get_shmmax()
+ #define UCS_PROC_SYS_SHMMAX_FILE "/proc/sys/kernel/shmmax"
+ size_t ucs_get_shmmax()
+ {
++#if defined(__FreeBSD__)
++ unsigned long shmmax;
++ size_t len = sizeof(shmmax);
++
++ if (sysctlbyname("kern.ipc.shmmax", &shmmax, &len, NULL, 0) != 0) {
++ ucs_warn("failed to read kern.ipc.shmmax: %m");
++ return 0;
++ }
++
++ return (size_t)shmmax;
++#else
+ ucs_status_t status;
+ long size;
+
+@@ -787,12 +873,17 @@ size_t ucs_get_shmmax()
+ }
+
+ return size;
++#endif
+ }
+
+ static void ucs_sysv_shmget_error_check_ENOSPC(size_t alloc_size,
const struct shminfo *ipc_info,
char *buf, size_t max)
{
@@ -151,7 +178,7 @@
unsigned long new_used_ids;
unsigned long new_shm_tot;
struct shm_info shm_info;
-@@ -782,6 +859,7 @@ static void ucs_sysv_shmget_error_check_ENOSPC(size_t
+@@ -824,6 +915,7 @@ static void ucs_sysv_shmget_error_check_ENOSPC(size_t
" limit in /proc/sys/kernel/shmall (=%lu)",
new_shm_tot, ipc_info->shmall);
}
@@ -159,7 +186,7 @@
}
ucs_status_t ucs_sys_get_proc_cap(uint32_t *effective)
-@@ -842,6 +920,14 @@ static void ucs_sysv_shmget_format_error(size_t alloc_
+@@ -884,6 +976,14 @@ static void ucs_sysv_shmget_format_error(size_t alloc_
const char *alloc_name, int sys_errno,
char *buf, size_t max)
{
@@ -174,7 +201,7 @@
struct shminfo ipc_info;
char *p, *endp, *errp;
int ret;
-@@ -879,6 +965,7 @@ static void ucs_sysv_shmget_format_error(size_t alloc_
+@@ -921,6 +1021,7 @@ static void ucs_sysv_shmget_format_error(size_t alloc_
if (p == errp) {
snprintf(p, endp - p, ", please check shared memory limits by 'ipcs -l'");
}
@@ -182,7 +209,7 @@
}
ucs_status_t ucs_sysv_alloc(size_t *size, size_t max_size, void **address_p,
-@@ -1272,11 +1359,44 @@ void *ucs_sys_realloc(void *old_ptr, size_t old_length
+@@ -1315,11 +1416,44 @@ void *ucs_sys_realloc(void *old_ptr, size_t old_length
{
void *ptr;
@@ -228,7 +255,7 @@
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0ul);
if (ptr == MAP_FAILED) {
ucs_log_fatal_error("mmap(NULL, %zu, READ|WRITE, PRIVATE|ANON) failed: %m",
-@@ -1285,7 +1405,7 @@ void *ucs_sys_realloc(void *old_ptr, size_t old_length
+@@ -1328,7 +1462,7 @@ void *ucs_sys_realloc(void *old_ptr, size_t old_length
}
} else {
old_length = ucs_align_up_pow2(old_length, ucs_get_page_size());
@@ -237,7 +264,7 @@
MREMAP_MAYMOVE);
if (ptr == MAP_FAILED) {
ucs_log_fatal_error("mremap(%p, %zu, %zu, MAYMOVE) failed: %m",
-@@ -1295,6 +1415,13 @@ void *ucs_sys_realloc(void *old_ptr, size_t old_length
+@@ -1338,6 +1472,13 @@ void *ucs_sys_realloc(void *old_ptr, size_t old_length
}
return ptr;
@@ -251,7 +278,7 @@
}
void ucs_sys_free(void *ptr, size_t length)
-@@ -1302,11 +1429,19 @@ void ucs_sys_free(void *ptr, size_t length)
+@@ -1345,11 +1486,19 @@ void ucs_sys_free(void *ptr, size_t length)
int ret;
if (ptr != NULL) {
@@ -272,7 +299,7 @@
}
}
-@@ -1376,12 +1511,32 @@ ucs_status_t ucs_sys_pthread_getaffinity(ucs_sys_cpuse
+@@ -1419,12 +1568,32 @@ ucs_status_t ucs_sys_pthread_getaffinity(ucs_sys_cpuse
ucs_status_t ucs_sys_pthread_getaffinity(ucs_sys_cpuset_t *cpuset)
{
@@ -305,7 +332,7 @@
}
void ucs_sys_cpuset_copy(ucs_cpu_set_t *dst, const ucs_sys_cpuset_t *src)
-@@ -1435,6 +1590,10 @@ ucs_status_t ucs_sys_get_boot_id(uint64_t *high, uint6
+@@ -1494,6 +1663,10 @@ ucs_status_t ucs_sys_get_boot_id(uint64_t *high, uint6
static ucs_init_once_t init_once = UCS_INIT_ONCE_INITIALIZER;
static ucs_status_t status = UCS_ERR_IO_ERROR;
@@ -316,7 +343,7 @@
char bootid_str[256];
ssize_t size;
uint32_t v1;
-@@ -1444,8 +1603,17 @@ ucs_status_t ucs_sys_get_boot_id(uint64_t *high, uint6
+@@ -1503,8 +1676,17 @@ ucs_status_t ucs_sys_get_boot_id(uint64_t *high, uint6
uint8_t v5[6];
int res;
int i;
@@ -334,7 +361,7 @@
size = ucs_read_file_str(bootid_str, sizeof(bootid_str), 1,
"%s", UCS_PROCESS_BOOTID_FILE);
if (size <= 0) {
-@@ -1465,6 +1633,7 @@ ucs_status_t ucs_sys_get_boot_id(uint64_t *high, uint6
+@@ -1524,6 +1706,7 @@ ucs_status_t ucs_sys_get_boot_id(uint64_t *high, uint6
boot_id.high |= (uint64_t)v5[i] << (16 + (i * 8));
}
}
@@ -342,7 +369,7 @@
}
if (status == UCS_OK) {
-@@ -1542,7 +1711,8 @@ ucs_status_t ucs_pthread_create(pthread_t *thread_id_p
+@@ -1601,7 +1784,8 @@ ucs_status_t ucs_pthread_create(pthread_t *thread_id_p
ret = pthread_create(&thread_id, NULL, start_routine, arg);
if (ret != 0) {
@@ -352,3 +379,64 @@
return UCS_ERR_IO_ERROR;
}
+@@ -1630,6 +1814,52 @@ unsigned long ucs_sys_get_proc_create_time(pid_t pid)
+
+ unsigned long ucs_sys_get_proc_create_time(pid_t pid)
+ {
++#if defined(__FreeBSD__)
++ struct kinfo_proc kp;
++ struct timeval boottime;
++ uint64_t proc_usec, boot_usec, start_usec;
++ size_t len;
++ int mib[4];
++
++ /*
++ * FreeBSD exposes process creation time through struct kinfo_proc.
++ * Preserve the API semantics of returning time since system boot.
++ */
++ mib[0] = CTL_KERN;
++ mib[1] = KERN_PROC;
++ mib[2] = KERN_PROC_PID;
++ mib[3] = pid;
++
++ memset(&kp, 0, sizeof(kp));
*** 973 LINES SKIPPED ***