Skip to content

fix: take FFI_ArrowArrayStream errno values from libc#10299

Open
fornwall wants to merge 1 commit into
apache:mainfrom
fornwall:fix-ffi-stream-errno-values
Open

fix: take FFI_ArrowArrayStream errno values from libc#10299
fornwall wants to merge 1 commit into
apache:mainfrom
fornwall:fix-ffi-stream-errno-values

Conversation

@fornwall

@fornwall fornwall commented Jul 7, 2026

Copy link
Copy Markdown

Disclaimer: The PR description and the code change was generated by claude code. I have reviewed it and think it makes sense, and is ready to dig into any eventual issues or make necessary modifications.

The errno constants in ffi_stream.rs were hardcoded to a single set of values, but ENOSYS is 78 only on macOS/iOS and the BSDs — on Linux it is 38, on Windows 40, on Solaris/illumos 89. On WASI even the other codes differ (EINVAL is 28, EIO 29, ENOMEM 48), since WASI numbers its errnos independently. A stream exported on Linux therefore reported ArrowError::NotYetImplemented as 78, which Linux errno tables read as an unrelated code, confusing C consumers that interpret the returned errno.

Take the constants from libc instead, as an optional dependency of the ffi feature. It is target-gated off wasm32-unknown-unknown — the one target without a libc — where no OS interprets the codes anyway, so hardcoded Linux values remain.

@github-actions github-actions Bot added the arrow Changes to the arrow crate label Jul 7, 2026
The errno constants in ffi_stream.rs were hardcoded to a single set of
values, but ENOSYS is 78 only on macOS/iOS and the BSDs — on Linux it
is 38, on Windows 40, on Solaris/illumos 89. On WASI even the other
codes differ (EINVAL is 28, EIO 29, ENOMEM 48), since WASI numbers its
errnos independently. A stream exported on Linux therefore reported
ArrowError::NotYetImplemented as 78, which Linux errno tables read as
an unrelated code, confusing C consumers that interpret the returned
errno.

Take the constants from libc instead, as an optional dependency of the
ffi feature. It is target-gated off wasm32-unknown-unknown — the one
target without a libc — where no OS interprets the codes anyway, so
hardcoded Linux values remain.

Signed-off-by: Fredrik Fornwall <fredrik@fornwall.net>
@fornwall fornwall force-pushed the fix-ffi-stream-errno-values branch from 7e086a2 to a183c3d Compare July 7, 2026 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arrow Changes to the arrow crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant