Would the following change be accepted? If so, I think it will open the door for implementation of posix layer on freestanding platform:
diff --git a/lib/std/posix.zig b/lib/std/posix.zig
index 011a6723d1..3bc9febc04 100644
--- a/lib/std/posix.zig
+++ b/lib/std/posix.zig
@@ -41,7 +41,9 @@ const windows = std.os.windows;
const wasi = std.os.wasi;
/// A libc-compatible API layer.
-pub const system = if (use_libc)
+pub const system = if (@hasDecl(root, "system")
+ root.system
+else if (use_libc)
std.c
else switch (native_os) {
.linux => linux,
What’s your thought?