Skip to content

Commit 7ecbb6f

Browse files
authored
Merge pull request #19360 from ziglang/no-byos-posix
std: don't do BYOS at the POSIX API layer
2 parents 3a836b4 + cba1555 commit 7ecbb6f

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

lib/std/os/linux.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2264,7 +2264,7 @@ pub fn map_shadow_stack(addr: u64, size: u64, flags: u32) usize {
22642264
}
22652265

22662266
pub 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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,8 @@ const linux = std.os.linux;
3939
const windows = std.os.windows;
4040
const 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.
45-
pub const system = if (@hasDecl(root, "os") and @hasDecl(root.os, "system") and root.os != @This())
46-
root.os.system
47-
else if (use_libc)
42+
/// A libc-compatible API layer.
43+
pub const system = if (use_libc)
4844
std.c
4945
else switch (native_os) {
5046
.linux => linux,

0 commit comments

Comments
 (0)