extern void clear_regs(void);
extern void get_regs(pid_t pid);
extern int get_scno(struct tcb *tcp);
+/**
+ * Convert syscall number to syscall name.
+ *
+ * @param scno Syscall number.
+ * @return String literal corresponding to the syscall number in case latter
+ * is valid; NULL otherwise.
+ */
extern const char *syscall_name(long scno);
extern const char *err_name(unsigned long err);
}
break;
#ifdef HAVE_SIGINFO_T_SI_SYSCALL
- case SIGSYS:
+ case SIGSYS: {
+ const char *scname =
+ syscall_name((unsigned) sip->si_syscall);
+
tprints(", si_call_addr=");
printaddr((unsigned long) sip->si_call_addr);
- tprintf(", si_syscall=__NR_%s, si_arch=",
- syscall_name((unsigned) sip->si_syscall));
+ tprints(", si_syscall=");
+ if (scname)
+ tprintf("__NR_%s", scname);
+ else
+ tprintf("%u", (unsigned) sip->si_syscall);
+ tprints(", si_arch=");
printxval(audit_arch, sip->si_arch, "AUDIT_ARCH_???");
break;
+ }
#endif
default:
if (sip->si_pid || sip->si_uid)
const char *
syscall_name(long scno)
{
- static char buf[sizeof("syscall_%lu") + sizeof(long)*3];
-
- if (SCNO_IS_VALID(scno))
- return sysent[scno].sys_name;
- else {
- sprintf(buf, "syscall_%lu", scno);
- return buf;
- }
+ return SCNO_IS_VALID(scno) ? sysent[scno].sys_name: NULL;
}
const char *
do_ptrace(PTRACE_SETSIGINFO, pid, bad_request, (unsigned long) sip);
printf("ptrace(PTRACE_SETSIGINFO, %u, %#lx, {si_signo=SIGSYS"
", si_code=SYS_SECCOMP, si_errno=ENOENT, si_call_addr=%p"
- ", si_syscall=__NR_syscall_%u, si_arch=AUDIT_ARCH_X86_64})"
+ ", si_syscall=%u, si_arch=AUDIT_ARCH_X86_64})"
" = %s\n",
(unsigned) pid, bad_request, sip->si_call_addr, sip->si_syscall,
errstr);