* linux/x86_64/get_scno.c (X32_PERSONALITY_NUMBER): New macro.
* syscall.c (syscall_name) [X32_PERSONALITY_NUMBER && __X32_SYSCALL_BIT]:
Clear __X32_SYSCALL_BIT from scno on x32 personality.
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#ifdef X86_64
+# define X32_PERSONALITY_NUMBER 2
+#else
+# define X32_PERSONALITY_NUMBER 0
+#endif
+
/* Return codes: 1 - ok, 0 - ignore, other - error. */
static int
arch_get_scno(struct tcb *tcp)
# define shuffle_scno(scno) ((long)(scno))
#endif
-const char *
-syscall_name(long scno)
-{
- return SCNO_IS_VALID(scno) ? sysent[scno].sys_name: NULL;
-}
-
const char *
err_name(unsigned long err)
{
#ifdef HAVE_GETREGS_OLD
# include "getregs_old.c"
#endif
+
+const char *
+syscall_name(long scno)
+{
+#if defined X32_PERSONALITY_NUMBER && defined __X32_SYSCALL_BIT
+ if (current_personality == X32_PERSONALITY_NUMBER)
+ scno &= ~__X32_SYSCALL_BIT;
+#endif
+ return SCNO_IS_VALID(scno) ? sysent[scno].sys_name: NULL;
+}