This is an automated email from the ASF dual-hosted git repository. avamingli pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/cloudberry.git
commit 4f58444f1d7772a70082b79dd29cb78af78fa0f1 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 d11e4577cd6..8e54be4c30d 100644 --- a/contrib/interconnect/udp/ic_udpifc.c +++ b/contrib/interconnect/udp/ic_udpifc.c @@ -131,6 +131,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]
