1 #include <signal.h> 2 #include <stdint.h> 3 #include "syscall.h" 4 #include "pthread_impl.h" 5 #include <unistd.h> 6 raise(int sig)7int raise(int sig) 8 { 9 sigset_t set; 10 __block_app_sigs(&set); 11 #ifdef __LITEOS__ 12 int ret = syscall(SYS_tkill, __pthread_self()->tid, sig); 13 #else 14 int ret = syscall(SYS_tgkill, syscall(SYS_getpid), __pthread_self()->tid, sig); 15 #endif // #ifdef __LITEOS__ 16 __restore_sigs(&set); 17 return ret; 18 } 19