Commit 86388e3c32

Andrew Kelley <andrew@ziglang.org>
2023-07-31 20:20:31
Revert "std.os: sysctl* wrappers, better warning at compile time"
This reverts commit c66151a22619b4f3ce028076c67f495ff5f99d2c.
1 parent 70d1bb8
Changed files (1)
lib
std
lib/std/os.zig
@@ -4696,8 +4696,11 @@ pub fn sysctl(
     newp: ?*anyopaque,
     newlen: usize,
 ) SysCtlError!void {
-    if (builtin.os.tag == .wasi or builtin.os.tag == .haiku) {
-        @compileError("unsupported OS");
+    if (builtin.os.tag == .wasi) {
+        @panic("unsupported"); // TODO should be compile error, not panic
+    }
+    if (builtin.os.tag == .haiku) {
+        @panic("unsupported"); // TODO should be compile error, not panic
     }
 
     const name_len = math.cast(c_uint, name.len) orelse return error.NameTooLong;
@@ -4718,8 +4721,11 @@ pub fn sysctlbynameZ(
     newp: ?*anyopaque,
     newlen: usize,
 ) SysCtlError!void {
-    if (builtin.os.tag == .wasi or builtin.os.tag == .haiku) {
-        @compileError("unsupported OS");
+    if (builtin.os.tag == .wasi) {
+        @panic("unsupported"); // TODO should be compile error, not panic
+    }
+    if (builtin.os.tag == .haiku) {
+        @panic("unsupported"); // TODO should be compile error, not panic
     }
 
     switch (errno(system.sysctlbyname(name, oldp, oldlenp, newp, newlen))) {