Fix type for jump

This commit is contained in:
Wildan M
2026-04-15 11:16:31 +07:00
parent ff43be1be0
commit 3b5acbdb40
+4 -5
View File
@@ -12,8 +12,7 @@ use crate::{
platform::{
self, ERRNO, Pal, PalSignal, Sys,
types::{
c_char, c_int, c_ulong, c_ulonglong, c_void, pid_t, pthread_attr_t, pthread_t, size_t,
uid_t,
c_char, c_int, c_ulonglong, c_void, pid_t, pthread_attr_t, pthread_t, size_t, uid_t,
},
},
};
@@ -113,13 +112,13 @@ pub type siginfo_t = siginfo;
pub type stack_t = sigaltstack;
unsafe extern "C" {
pub fn sigsetjmp(jb: *mut c_ulong, savemask: c_int) -> c_int;
pub fn sigsetjmp(jb: *mut c_ulonglong, savemask: c_int) -> c_int;
}
//NOTE for the following two functions, to see why they're implemented slightly differently from their intended behavior, read
// https://git.musl-libc.org/cgit/musl/commit/?id=583e55122e767b1586286a0d9c35e2a4027998ab
#[unsafe(no_mangle)]
unsafe extern "C" fn __sigsetjmp_tail(jb: *mut c_ulong, ret: c_int) -> c_int {
unsafe extern "C" fn __sigsetjmp_tail(jb: *mut c_ulonglong, ret: c_int) -> c_int {
let set = jb.wrapping_add(9);
if ret > 0 {
unsafe { sigprocmask(SIG_SETMASK, set, ptr::null_mut()) };
@@ -130,7 +129,7 @@ unsafe extern "C" fn __sigsetjmp_tail(jb: *mut c_ulong, ret: c_int) -> c_int {
}
#[unsafe(no_mangle)]
pub unsafe extern "C" fn siglongjmp(jb: *mut c_ulong, ret: c_int) {
pub unsafe extern "C" fn siglongjmp(jb: *mut c_ulonglong, ret: c_int) {
unsafe { setjmp::longjmp(jb, ret) };
}