diff options
author | VlkrS <47375452+VlkrS@users.noreply.github.com> | 2023-07-22 05:50:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-22 05:50:57 +0200 |
commit | 60d3c4c1ece2009279a0c6d515789ff801d9dbaa (patch) | |
tree | af2cd080f78e012e330b3fe14eec9f69508a12fe | |
parent | 5a3dbe1a62b8e81a7993359e6fb756e36781730c (diff) |
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
-rw-r--r-- | runtime/ops/os/sys_info.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/runtime/ops/os/sys_info.rs b/runtime/ops/os/sys_info.rs index e9cbbafb6..d8175f31b 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]; |