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