From b92fa7eedaf74f0a2846f931b5d8b259f0b8763e Mon Sep 17 00:00:00 2001 From: Michael Osipov Date: Tue, 21 Jul 2026 12:34:48 +0200 Subject: [PATCH] Fix build on FreeBSD/OpenBSD: ENODATA not defined in errno.h ENODATA is an XSI/SVID extension and is not guaranteed by POSIX; FreeBSD and OpenBSD do not define it in errno.h, breaking the build of the vendored nanoarrow_ipc.c (nanoarrow 0.3.0) on those platforms. Add a portable fallback definition, matching the fix proposed upstream in apache/arrow-nanoarrow#906. This is a stopgap until Snowflake re-vendors a nanoarrow release containing that fix. Upstream-PR: https://github.com/apache/arrow-nanoarrow/pull/906 This fixes #2967 --- .../connector/nanoarrow_cpp/ArrowIterator/nanoarrow_ipc.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/nanoarrow_ipc.c b/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/nanoarrow_ipc.c index 371e198847..d0c3169053 100644 --- a/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/nanoarrow_ipc.c +++ b/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/nanoarrow_ipc.c @@ -31039,6 +31039,12 @@ static inline int org_apache_arrow_flatbuf_Tensor_verify_as_root_with_type_hash( #include #include +// ENODATA is an XSI extension and is not defined by all libcs (e.g., FreeBSD +// and OpenBSD). See https://github.com/apache/arrow-nanoarrow/pull/906. +#if !defined(ENODATA) +#define ENODATA 120 +#endif + // For thread safe shared buffers we need C11 + stdatomic.h // Can compile with -DNANOARROW_IPC_USE_STDATOMIC=0 or 1 to override // automatic detection