This is an automated email from the ASF dual-hosted git repository.

my-ship-it pushed a commit to branch REL_2_STABLE
in repository https://gitbox.apache.org/repos/asf/cloudberry.git

commit f419c4517af3252bb66c0e20783c06098ee5e5b7
Author: Zhang Mingli <[email protected]>
AuthorDate: Thu May 28 18:22:28 2026 +0800

    macOS: provide HZ fallback for UDP interconnect
    
    ic_udpifc.c uses the HZ macro (kernel timer frequency) for RTO
    calculations. On Linux glibc, HZ is exposed via <sys/param.h>
    (typically 100). macOS's <sys/param.h> does not define HZ.
    
    Define HZ=100 as a fallback when the platform headers don't provide
    it. The exact value only affects retransmit pacing constants
    (UDP_RTO_MIN, TIME_TICK); 100 matches the Linux default.
---
 contrib/interconnect/udp/ic_udpifc.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/contrib/interconnect/udp/ic_udpifc.c 
b/contrib/interconnect/udp/ic_udpifc.c
index 23de982d89b..dff0a448811 100644
--- a/contrib/interconnect/udp/ic_udpifc.c
+++ b/contrib/interconnect/udp/ic_udpifc.c
@@ -134,6 +134,13 @@ WSAPoll(
 #define SEC_TO_MSEC(t)                  ((t) * 1000)
 #define MSEC_TO_USEC(t)                 ((t) * 1000)
 #define USEC_TO_SEC(t)                  ((t) / 1000000)
+
+/* HZ is the kernel timer frequency. Linux defines it in <asm/param.h>
+ * (typically 100). macOS's sys/param.h does not, so provide a fallback. */
+#ifndef HZ
+#define HZ 100
+#endif
+
 #define TIME_TICK (1000000/HZ)/* in us */
 
 #define UDP_INITIAL_RTO                 (MSEC_TO_USEC(200))


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to