[LTP] [PATCH] read02: Fix the failure of mips architecture test

zhanglianjie zhanglianjie@uniontech.com
Thu May 27 07:22:57 CEST 2021


under mips architecture, writing to the buf of mmap PROT_NONE will
report an error EPERM.

Signed-off-by: zhanglianjie <zhanglianjie@uniontech.com>

diff --git a/testcases/kernel/syscalls/read/read02.c b/testcases/kernel/syscalls/read/read02.c
index 9199a95f6..ab1c15970 100644
--- a/testcases/kernel/syscalls/read/read02.c
+++ b/testcases/kernel/syscalls/read/read02.c
@@ -52,7 +52,9 @@ static struct tcase {
 } tcases[] = {
 	{&badfd, &bufaddr, 1, EBADF},
 	{&fd2, &bufaddr, 1, EISDIR},
-#ifndef UCLINUX
+#if defined( __mips)
+	{&fd3, &outside_buf, 1, EPERM},
+#elif !defined(UCLINUX)
 	{&fd3, &outside_buf, 1, EFAULT},
 #endif
 	{&fd4, &addr4, 1, EINVAL},
--
2.20.1





More information about the ltp mailing list