Makes a posix implementation layer for freestanding

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?

bad layer to try to do this at. I believe that’s exactly what we tried before

Agree in general, we should implement os specifics in std.os.

BTW, while I’m implementating a sort of os layer on a freestanding platform, and I want to leverage some of zig infrastructures, one of them is zig test. AFAIK, current default test runner is based on the posix layer, although I could implement our own test runner for example, then there will be a lot of code duplication.