authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-03-20 00:39:09-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2024-03-20 00:39:09-07:00
log7ecbb6f3a07743669590f0c0e1767f49c7ca1fc3
tree4f99a180cf5c14b04191aba0cfc221249f37ee76
parent3a836b4800337567735b2619075d8bb4e9f21c4d
parentcba155510431104fcfe2f6b61e955bc4d42927fb
signaturebadge-check Signed by PGP key B5690EEEBB952194

Merge pull request #19360 from ziglang/no-byos-posix

std: don't do BYOS at the POSIX API layer

2 files changed, 4 insertions(+), 8 deletions(-)

lib/std/os/linux.zig+2-2
......@@ -2264,7 +2264,7 @@ pub fn map_shadow_stack(addr: u64, size: u64, flags: u32) usize {
22642264}
22652265
22662266pub const E = switch (native_arch) {
2267 .mips, .mipsel => enum(i32) {
2267 .mips, .mipsel => enum(u16) {
22682268 /// No error occurred.
22692269 SUCCESS = 0,
22702270
......@@ -2406,7 +2406,7 @@ pub const E = switch (native_arch) {
24062406
24072407 pub const init = errnoFromSyscall;
24082408 },
2409 .sparc, .sparcel, .sparc64 => enum(i32) {
2409 .sparc, .sparcel, .sparc64 => enum(u16) {
24102410 /// No error occurred.
24112411 SUCCESS = 0,
24122412
lib/std/posix.zig+2-6
......@@ -39,12 +39,8 @@ const linux = std.os.linux;
3939const windows = std.os.windows;
4040const wasi = std.os.wasi;
4141
42/// Applications can override the `system` API layer in their root source file.
43/// Otherwise, when linking libc, this is the C API.
44/// When not linking libc, it is the OS-specific system interface.
45pub const system = if (@hasDecl(root, "os") and @hasDecl(root.os, "system") and root.os != @This())
46 root.os.system
47else if (use_libc)
42/// A libc-compatible API layer.
43pub const system = if (use_libc)
4844 std.c
4945else switch (native_os) {
5046 .linux => linux,