Revert "std.os: sysctl* wrappers, better warning at compile time"

This reverts commit c66151a226.
This commit is contained in:
Andrew Kelley
2023-07-31 11:20:31 -07:00
parent 70d1bb8049
commit 86388e3c32

View File

@@ -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))) {