mirror of
https://github.com/zeldaret/st
synced 2026-08-06 01:48:37 -04:00
c98c03de39
* match wstring.c * match math_api.c, mbstring.c, mem.c and mem_funcs.c * more progress * build issues * fix non-matching issues * reorganise files * match fdlibm (+ libc progress) * fix jp build * solved some non-matchings and progress * removed types.h usage in libc * match data and add missing delinks for jp
34 lines
616 B
C
34 lines
616 B
C
#include <critical_regions.h>
|
|
|
|
typedef void (*sig_func)(int sig);
|
|
sig_func signal_funcs[7];
|
|
|
|
int raise(int sig) {
|
|
sig_func temp_r31;
|
|
|
|
if (sig < 1 || sig > 7) {
|
|
return -1;
|
|
}
|
|
|
|
__begin_critical_region(signal_funcs_access);
|
|
|
|
temp_r31 = signal_funcs[sig - 1];
|
|
|
|
if ((unsigned int) temp_r31 != 1) {
|
|
signal_funcs[sig - 1] = 0;
|
|
}
|
|
|
|
__end_critical_region(signal_funcs_access);
|
|
|
|
if ((unsigned int) temp_r31 == 1 || ((int) temp_r31 == 0 && sig == 1)) {
|
|
return 0;
|
|
}
|
|
|
|
if ((unsigned int) temp_r31 == 0) {
|
|
exit(0);
|
|
}
|
|
|
|
temp_r31(sig);
|
|
return 0;
|
|
}
|