| author | |
| committer | |
| log | 7ecbb6f3a07743669590f0c0e1767f49c7ca1fc3 |
| tree | 4f99a180cf5c14b04191aba0cfc221249f37ee76 |
| parent | 3a836b4800337567735b2619075d8bb4e9f21c4d |
| parent | cba155510431104fcfe2f6b61e955bc4d42927fb |
| signature |
std: don't do BYOS at the POSIX API layer2 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 { | ... | @@ -2264,7 +2264,7 @@ pub fn map_shadow_stack(addr: u64, size: u64, flags: u32) usize { |
| 2264 | } | 2264 | } |
| 2265 | 2265 | ||
| 2266 | pub const E = switch (native_arch) { | 2266 | pub const E = switch (native_arch) { |
| 2267 | .mips, .mipsel => enum(i32) { | 2267 | .mips, .mipsel => enum(u16) { |
| 2268 | /// No error occurred. | 2268 | /// No error occurred. |
| 2269 | SUCCESS = 0, | 2269 | SUCCESS = 0, |
| 2270 | 2270 | ||
| ... | @@ -2406,7 +2406,7 @@ pub const E = switch (native_arch) { | ... | @@ -2406,7 +2406,7 @@ pub const E = switch (native_arch) { |
| 2406 | 2406 | ||
| 2407 | pub const init = errnoFromSyscall; | 2407 | pub const init = errnoFromSyscall; |
| 2408 | }, | 2408 | }, |
| 2409 | .sparc, .sparcel, .sparc64 => enum(i32) { | 2409 | .sparc, .sparcel, .sparc64 => enum(u16) { |
| 2410 | /// No error occurred. | 2410 | /// No error occurred. |
| 2411 | SUCCESS = 0, | 2411 | SUCCESS = 0, |
| 2412 | 2412 |
lib/std/posix.zig+2-6| ... | @@ -39,12 +39,8 @@ const linux = std.os.linux; | ... | @@ -39,12 +39,8 @@ const linux = std.os.linux; |
| 39 | const windows = std.os.windows; | 39 | const windows = std.os.windows; |
| 40 | const wasi = std.os.wasi; | 40 | const wasi = std.os.wasi; |
| 41 | 41 | ||
| 42 | /// Applications can override the `system` API layer in their root source file. | 42 | /// A libc-compatible API layer. |
| 43 | /// Otherwise, when linking libc, this is the C API. | 43 | pub const system = if (use_libc) |
| 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) | ||
| 48 | std.c | 44 | std.c |
| 49 | else switch (native_os) { | 45 | else switch (native_os) { |
| 50 | .linux => linux, | 46 | .linux => linux, |