Print syscall names only for defined syscalls
authorEugene Syromyatnikov <evgsyr@gmail.com>
Wed, 30 Nov 2016 20:43:51 +0000 (23:43 +0300)
committerDmitry V. Levin <ldv@altlinux.org>
Thu, 1 Dec 2016 00:08:39 +0000 (00:08 +0000)
commit9936b91d9f77f799d1c9858743de7841bfb31ba4
tree875f3e395c727544f49dd9d8432517bb5254be5c
parent2432f78415a7a1161710abe6e2399ea51d054e11
Print syscall names only for defined syscalls

The string literal "__NR_syscall_4294967295" is semantically incorrect
as there is no such constant defined.

* syscall.c (syscall_name): Return NULL if there is no syscall
corresponding to the given number.
* defs.h (syscall_name): Document this behaviour.
* printsiginfo.c (print_si_info): Print syscall name with "__NR_" prefix
only if there is a syscall corresponding to si_syscall number; print
a plain syscall number otherwise.
* tests/ptrace.c (main): Update expected output.
defs.h
printsiginfo.c
syscall.c
tests/ptrace.c