Commit 77395457fe

孙冰 <sunb@qmrz.net>
2025-03-11 08:45:04
std.c: fix sysconf names (std.c._SC) for android api
c.f. https://android.googlesource.com/platform/bionic/+/refs/heads/main/libc/include/bits/sysconf.h
1 parent 982c500
Changed files (1)
lib
std
lib/std/c.zig
@@ -2512,7 +2512,10 @@ pub const SC = switch (native_os) {
     else => void,
 };
 
-pub const _SC = switch (native_os) {
+pub const _SC = if (builtin.abi.isAndroid()) enum(c_int) {
+    PAGESIZE = 39,
+    NPROCESSORS_ONLN = 97,
+} else switch (native_os) {
     .driverkit, .ios, .macos, .tvos, .visionos, .watchos => enum(c_int) {
         PAGESIZE = 29,
     },