Implement psignal and psiginfo.

This commit is contained in:
4lDO2
2024-08-04 23:25:29 +02:00
parent 2b7a1ea94b
commit af6435e12d
4 changed files with 82 additions and 5 deletions
+2 -2
View File
@@ -353,9 +353,9 @@ pub unsafe extern "C" fn strrchr(s: *const c_char, c: c_int) -> *mut c_char {
#[no_mangle]
pub unsafe extern "C" fn strsignal(sig: c_int) -> *mut c_char {
signal::_signal_strings
signal::SIGNAL_STRINGS
.get(sig as usize)
.unwrap_or(&signal::_signal_strings[0]) // Unknown signal message
.unwrap_or(&signal::SIGNAL_STRINGS[0]) // Unknown signal message
.as_ptr() as *mut c_char
}