1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-28 16:20:57 -05:00

Merge branch 'main' into fix-watch-exclude-flag

This commit is contained in:
HasanAlrimawi 2024-10-29 18:46:40 +02:00 committed by GitHub
commit 050b07b42e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 21 additions and 3 deletions

View file

@ -662,7 +662,11 @@ pub fn print_linker_flags(name: &str) {
symbols_path,
);
#[cfg(target_os = "linux")]
#[cfg(any(
target_os = "linux",
target_os = "freebsd",
target_os = "openbsd"
))]
println!(
"cargo:rustc-link-arg-bin={name}=-Wl,--export-dynamic-symbol-list={}",
symbols_path,

View file

@ -152,13 +152,21 @@ where
let mut cpath = path.as_bytes().to_vec();
cpath.push(0);
if bigint {
#[cfg(not(target_os = "macos"))]
#[cfg(not(any(
target_os = "macos",
target_os = "freebsd",
target_os = "openbsd"
)))]
// SAFETY: `cpath` is NUL-terminated and result is pointer to valid statfs memory.
let (code, result) = unsafe {
let mut result: libc::statfs64 = std::mem::zeroed();
(libc::statfs64(cpath.as_ptr() as _, &mut result), result)
};
#[cfg(target_os = "macos")]
#[cfg(any(
target_os = "macos",
target_os = "freebsd",
target_os = "openbsd"
))]
// SAFETY: `cpath` is NUL-terminated and result is pointer to valid statfs memory.
let (code, result) = unsafe {
let mut result: libc::statfs = std::mem::zeroed();
@ -168,7 +176,10 @@ where
return Err(std::io::Error::last_os_error().into());
}
Ok(StatFs {
#[cfg(not(target_os = "openbsd"))]
typ: result.f_type as _,
#[cfg(target_os = "openbsd")]
typ: 0 as _,
bsize: result.f_bsize as _,
blocks: result.f_blocks as _,
bfree: result.f_bfree as _,
@ -186,7 +197,10 @@ where
return Err(std::io::Error::last_os_error().into());
}
Ok(StatFs {
#[cfg(not(target_os = "openbsd"))]
typ: result.f_type as _,
#[cfg(target_os = "openbsd")]
typ: 0 as _,
bsize: result.f_bsize as _,
blocks: result.f_blocks as _,
bfree: result.f_bfree as _,