#![allow(clippy::missing_safety_doc)]
#![allow(clippy::not_unsafe_ptr_arg_deref)]
use core::ffi::{c_int, c_void};
#[unsafe(no_mangle)]
pub extern "C" fn Bun__panic(msg: *const u8, len: usize) -> ! {
let msg_str = if msg.is_null() || len == 0 {
"(no message)".to_string()
} else {
let slice = unsafe { core::slice::from_raw_parts(msg, len) };
String::from_utf8_lossy(slice).into_owned()
};
eprintln!("Bun__panic from C: {}", msg_str);
std::process::abort()
}
#[unsafe(no_mangle)]
pub extern "C" fn sys_epoll_pwait2(
epfd: c_int,
events: *mut libc::epoll_event,
maxevents: c_int,
timeout: *const libc::timespec,
sigmask: *const libc::sigset_t,
) -> isize {
unsafe {
libc::syscall(
libc::SYS_epoll_pwait2,
epfd as isize as usize,
events as usize,
maxevents as isize as usize,
timeout as usize,
sigmask as usize,
8usize,
) as isize
}
}
#[unsafe(no_mangle)]
pub extern "C" fn Bun__JSC_onBeforeWait(_jsc_vm: *mut c_void) {}