Do not shuffle scno inside syscall_name

This makes interface a bit irregular otherwise.

* defs.h (syscall_name): Clarify description.
* syscall.c (syscall_name): Do not call shuffle_scno.
* printsiginfo.c (print_si_info) <case SIGSYS>: Use shuffle_scno.
This commit is contained in:
Eugene Syromyatnikov 2018-02-01 12:50:31 +01:00 committed by Dmitry V. Levin
parent 7b6e926641
commit 61f156c08e
3 changed files with 3 additions and 5 deletions

2
defs.h
View File

@ -400,7 +400,7 @@ extern int get_scno(struct tcb *);
extern kernel_ulong_t get_rt_sigframe_addr(struct tcb *);
/**
* Convert syscall number to syscall name.
* Convert a (shuffled) syscall number to the corresponding syscall name.
*
* @param scno Syscall number.
* @return String literal corresponding to the syscall number in case latter

View File

@ -209,8 +209,8 @@ print_si_info(const siginfo_t *sip)
* - Looks like there are no other cases where SIGSYS
* is delivered from the kernel so far.
*/
const char *scname =
syscall_name((unsigned) sip->si_syscall);
const char *scname = syscall_name(shuffle_scno(
(unsigned) sip->si_syscall));
tprints(", si_call_addr=");
printaddr(ptr_to_kulong(sip->si_call_addr));

View File

@ -1276,7 +1276,5 @@ get_syscall_result(struct tcb *tcp)
const char *
syscall_name(kernel_ulong_t scno)
{
scno = shuffle_scno(scno);
return scno_is_valid(scno) ? sysent[scno].sys_name : NULL;
}