From d72ee825657bb1e642ce5f3130498c608c5dadcb Mon Sep 17 00:00:00 2001 From: VlkrS <47375452+VlkrS@users.noreply.github.com> Date: Sat, 22 Jul 2023 05:50:57 +0200 Subject: [PATCH] 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 --- runtime/ops/os/sys_info.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/runtime/ops/os/sys_info.rs b/runtime/ops/os/sys_info.rs index e9cbbafb6e446..d8175f31bfd5c 100644 --- a/runtime/ops/os/sys_info.rs +++ b/runtime/ops/os/sys_info.rs @@ -57,7 +57,11 @@ pub fn os_release() -> String { _ => String::from(""), } } - #[cfg(target_vendor = "apple")] + #[cfg(any( + target_vendor = "apple", + target_os = "freebsd", + target_os = "openbsd" + ))] { let mut s = [0u8; 256]; let mut mib = [libc::CTL_KERN, libc::KERN_OSRELEASE];