Cleanup libbase

This commit is contained in:
topjohnwu
2025-08-24 21:31:53 -07:00
committed by John Wu
parent e91fc75d86
commit b861671391
14 changed files with 117 additions and 221 deletions

View File

@@ -14,16 +14,9 @@ use crate::files::map_file_at;
pub(crate) use crate::xwrap::*;
use crate::{
BufReadExt, CxxResultExt, Directory, OsResultStatic, Utf8CStr, clone_attr, cstr, fclone_attr,
fd_path, map_fd, map_file, slice_from_ptr,
map_fd, map_file, slice_from_ptr,
};
pub(crate) fn fd_path_for_cxx(fd: RawFd, buf: &mut [u8]) -> isize {
let mut buf = cstr::buf::wrap(buf);
fd_path(fd, &mut buf)
.log_cxx()
.map_or(-1_isize, |_| buf.len() as isize)
}
#[unsafe(no_mangle)]
unsafe extern "C" fn canonical_path(path: *const c_char, buf: *mut u8, bufsz: usize) -> isize {
unsafe {