mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 07:14:47 -05:00
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
This commit is contained in:
parent
5a3dbe1a62
commit
60d3c4c1ec
1 changed files with 5 additions and 1 deletions
|
@ -57,7 +57,11 @@ pub fn os_release() -> String {
|
||||||
_ => String::from(""),
|
_ => String::from(""),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#[cfg(target_vendor = "apple")]
|
#[cfg(any(
|
||||||
|
target_vendor = "apple",
|
||||||
|
target_os = "freebsd",
|
||||||
|
target_os = "openbsd"
|
||||||
|
))]
|
||||||
{
|
{
|
||||||
let mut s = [0u8; 256];
|
let mut s = [0u8; 256];
|
||||||
let mut mib = [libc::CTL_KERN, libc::KERN_OSRELEASE];
|
let mut mib = [libc::CTL_KERN, libc::KERN_OSRELEASE];
|
||||||
|
|
Loading…
Reference in a new issue