Skip to content

Commit 60d3c4c

Browse files
authored
feat(runtime): sys_info.rs - Use KERN_OSRELEASE on {Free,Open}BSD (#19849)
os_release() can use the same API as apple on FreeBSD and OpenBSD. Ports for both systems contain a patch to that effect. See: https://github.com/freebsd/freebsd-ports/blob/main/www/deno/files/patch-runtime_ops_os_sys__info.rs https://cvsweb.openbsd.org/ports/lang/deno/patches/patch-runtime_ops_os_sys_info_rs?rev=1.2
1 parent 5a3dbe1 commit 60d3c4c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

runtime/ops/os/sys_info.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,11 @@ pub fn os_release() -> String {
5757
_ => String::from(""),
5858
}
5959
}
60-
#[cfg(target_vendor = "apple")]
60+
#[cfg(any(
61+
target_vendor = "apple",
62+
target_os = "freebsd",
63+
target_os = "openbsd"
64+
))]
6165
{
6266
let mut s = [0u8; 256];
6367
let mut mib = [libc::CTL_KERN, libc::KERN_OSRELEASE];

0 commit comments

Comments
 (0)