summaryrefslogtreecommitdiff
path: root/src/linux/x32/check_scno.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/linux/x32/check_scno.c')
-rw-r--r--src/linux/x32/check_scno.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/linux/x32/check_scno.c b/src/linux/x32/check_scno.c
new file mode 100644
index 000000000..423870128
--- /dev/null
+++ b/src/linux/x32/check_scno.c
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2010-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* Return codes: 1 - ok, 0 - ignore, other - error. */
+static int
+arch_check_scno(struct tcb *tcp)
+{
+
+ const kernel_ulong_t scno = ptrace_sci.entry.nr;
+
+ if (tcp->currpers == 0 && !(scno & __X32_SYSCALL_BIT)) {
+ error_msg("syscall_%" PRI_klu "(...) in unsupported "
+ "64-bit mode of process PID=%d", scno, tcp->pid);
+ return 0;
+ }
+
+ return 1;
+}