fornwall commented on code in PR #10299:
URL: https://github.com/apache/arrow-rs/pull/10299#discussion_r3578665221
##########
arrow-array/src/ffi_stream.rs:
##########
@@ -74,10 +74,21 @@ use crate::record_batch::{RecordBatch, RecordBatchReader};
type Result<T> = std::result::Result<T, ArrowError>;
+// Errno values returned through the C stream interface, taken from libc so
they match
+// the platform the consumer interprets them against.
+#[cfg(not(all(target_family = "wasm", target_os = "unknown")))]
+use libc::{EINVAL, EIO, ENOMEM, ENOSYS};
+
+// wasm32-unknown-unknown has no libc, and no OS to interpret the codes either
— any
+// non-zero value works there, so use Linux's.
+#[cfg(all(target_family = "wasm", target_os = "unknown"))]
const ENOMEM: i32 = 12;
+#[cfg(all(target_family = "wasm", target_os = "unknown"))]
const EIO: i32 = 5;
+#[cfg(all(target_family = "wasm", target_os = "unknown"))]
const EINVAL: i32 = 22;
-const ENOSYS: i32 = 78;
+#[cfg(all(target_family = "wasm", target_os = "unknown"))]
+const ENOSYS: i32 = 38;
Review Comment:
Intentional, but cosmetic only: the other values are Linux values
(ENOMEM=12, EIO=5, EINVAL=22) so ENOSYS=78 (macOS ENOSYS, EREMCHG on Linux) was
the only non-Linux value here.
But it really does not matter AFAIK let me know if you want to change back.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]