-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Description
Zig Version
0.15.0-dev.1519+dd4e25cf4
Steps to Reproduce and Observed Behavior
Since #23541 Zig unconditionally uses the faccessat2
syscall in std.os.linux.faccessat
.
Unfortunately Android does not support this syscall, and due to their seccomp filter it results in the process receiving a SIGSYS.
const std = @import("std");
pub fn main() !void {
try std.posix.faccessat(0, "/usr/bin/env", std.posix.F_OK, 0);
}
Results in the program terminating with Unknown signal 31
.
Additionally, I have observed this happening when running a zig build-exe
using a Zig debug build without LLVM, because it tried to check for build.zig
with faccessat2
. The prebuilt release I have tested does not show this behaviour.
Go also ran into this issue previously, see golang/go#57393.
Expected Behavior
The faccessat2
syscall should not be used on Android.
This might be difficult at the moment, since Zig treats Android as Linux, has no separate release builds for Android and currently as far as I can tell no proper detection of the Android ABI.