summaryrefslogtreecommitdiffhomepage
path: root/test/syscalls/linux/bad.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test/syscalls/linux/bad.cc')
-rw-r--r--test/syscalls/linux/bad.cc15
1 files changed, 10 insertions, 5 deletions
diff --git a/test/syscalls/linux/bad.cc b/test/syscalls/linux/bad.cc
index 9e4d8ea57..adfb149df 100644
--- a/test/syscalls/linux/bad.cc
+++ b/test/syscalls/linux/bad.cc
@@ -22,13 +22,18 @@ namespace gvisor {
namespace testing {
namespace {
-#if defined(__x86_64__)
+#ifdef __x86_64__
+// get_kernel_syms is not supported in Linux > 2.6, and not implemented in
+// gVisor.
+constexpr uint32_t kNotImplementedSyscall = SYS_get_kernel_syms;
+#elif __aarch64__
+// Use the last of arch_specific_syscalls which are not implemented on arm64.
+constexpr uint32_t kNotImplementedSyscall = SYS_arch_specific_syscall + 15;
+#endif
+
TEST(BadSyscallTest, NotImplemented) {
- // get_kernel_syms is not supported in Linux > 2.6, and not implemented in
- // gVisor.
- EXPECT_THAT(syscall(SYS_get_kernel_syms), SyscallFailsWithErrno(ENOSYS));
+ EXPECT_THAT(syscall(kNotImplementedSyscall), SyscallFailsWithErrno(ENOSYS));
}
-#endif // defined(__x86_64__)
TEST(BadSyscallTest, NegativeOne) {
EXPECT_THAT(syscall(-1), SyscallFailsWithErrno(ENOSYS));