1 // SPDX-License-Identifier: LGPL-2.1 1 // SPDX-License-Identifier: LGPL-2.1 2 #include <signal.h> 2 #include <signal.h> 3 3 4 static size_t syscall_arg__scnprintf_signum(ch 4 static size_t syscall_arg__scnprintf_signum(char *bf, size_t size, struct syscall_arg *arg) 5 { 5 { 6 bool show_prefix = arg->show_string_pr 6 bool show_prefix = arg->show_string_prefix; 7 const char *prefix = "SIG"; 7 const char *prefix = "SIG"; 8 int sig = arg->val; 8 int sig = arg->val; 9 9 10 switch (sig) { 10 switch (sig) { 11 #define P_SIGNUM(n) case SIG##n: return scnpri 11 #define P_SIGNUM(n) case SIG##n: return scnprintf(bf, size, "%s%s", show_prefix ? prefix : "", #n) 12 P_SIGNUM(HUP); 12 P_SIGNUM(HUP); 13 P_SIGNUM(INT); 13 P_SIGNUM(INT); 14 P_SIGNUM(QUIT); 14 P_SIGNUM(QUIT); 15 P_SIGNUM(ILL); 15 P_SIGNUM(ILL); 16 P_SIGNUM(TRAP); 16 P_SIGNUM(TRAP); 17 P_SIGNUM(ABRT); 17 P_SIGNUM(ABRT); 18 P_SIGNUM(BUS); 18 P_SIGNUM(BUS); 19 P_SIGNUM(FPE); 19 P_SIGNUM(FPE); 20 P_SIGNUM(KILL); 20 P_SIGNUM(KILL); 21 P_SIGNUM(USR1); 21 P_SIGNUM(USR1); 22 P_SIGNUM(SEGV); 22 P_SIGNUM(SEGV); 23 P_SIGNUM(USR2); 23 P_SIGNUM(USR2); 24 P_SIGNUM(PIPE); 24 P_SIGNUM(PIPE); 25 P_SIGNUM(ALRM); 25 P_SIGNUM(ALRM); 26 P_SIGNUM(TERM); 26 P_SIGNUM(TERM); 27 P_SIGNUM(CHLD); 27 P_SIGNUM(CHLD); 28 P_SIGNUM(CONT); 28 P_SIGNUM(CONT); 29 P_SIGNUM(STOP); 29 P_SIGNUM(STOP); 30 P_SIGNUM(TSTP); 30 P_SIGNUM(TSTP); 31 P_SIGNUM(TTIN); 31 P_SIGNUM(TTIN); 32 P_SIGNUM(TTOU); 32 P_SIGNUM(TTOU); 33 P_SIGNUM(URG); 33 P_SIGNUM(URG); 34 P_SIGNUM(XCPU); 34 P_SIGNUM(XCPU); 35 P_SIGNUM(XFSZ); 35 P_SIGNUM(XFSZ); 36 P_SIGNUM(VTALRM); 36 P_SIGNUM(VTALRM); 37 P_SIGNUM(PROF); 37 P_SIGNUM(PROF); 38 P_SIGNUM(WINCH); 38 P_SIGNUM(WINCH); 39 P_SIGNUM(IO); 39 P_SIGNUM(IO); 40 P_SIGNUM(PWR); 40 P_SIGNUM(PWR); 41 P_SIGNUM(SYS); 41 P_SIGNUM(SYS); 42 #ifdef SIGEMT 42 #ifdef SIGEMT 43 P_SIGNUM(EMT); 43 P_SIGNUM(EMT); 44 #endif 44 #endif 45 #ifdef SIGSTKFLT 45 #ifdef SIGSTKFLT 46 P_SIGNUM(STKFLT); 46 P_SIGNUM(STKFLT); 47 #endif 47 #endif 48 #ifdef SIGSWI 48 #ifdef SIGSWI 49 P_SIGNUM(SWI); 49 P_SIGNUM(SWI); 50 #endif 50 #endif 51 default: break; 51 default: break; 52 } 52 } 53 53 54 return scnprintf(bf, size, "%#x", sig) 54 return scnprintf(bf, size, "%#x", sig); 55 } 55 } 56 56 57 #define SCA_SIGNUM syscall_arg__scnprintf_sign 57 #define SCA_SIGNUM syscall_arg__scnprintf_signum 58 58
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.