diff mbox series

[16/31] munmap: Remove UCLINUX

Message ID 20240411143025.352507-17-pvorel@suse.cz
State Accepted
Headers show
Series Remove UCLINUX (nommu support) from LTP legacy C API | expand

Commit Message

Petr Vorel April 11, 2024, 2:30 p.m. UTC
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/kernel/syscalls/munmap/munmap01.c | 18 ++----------------
 testcases/kernel/syscalls/munmap/munmap02.c | 18 ------------------
 2 files changed, 2 insertions(+), 34 deletions(-)
diff mbox series

Patch

diff --git a/testcases/kernel/syscalls/munmap/munmap01.c b/testcases/kernel/syscalls/munmap/munmap01.c
index 7d10c0eac..dfd81fa2b 100644
--- a/testcases/kernel/syscalls/munmap/munmap01.c
+++ b/testcases/kernel/syscalls/munmap/munmap01.c
@@ -114,13 +114,7 @@  int main(int ac, char **av)
 				 TEST_ERRNO, strerror(TEST_ERRNO));
 			continue;
 		}
-#ifdef UCLINUX
-		/*
-		 * No SIGSEGV on uClinux since
-		 * MMU not implemented on uClinux
-		 */
-		tst_resm(TPASS, "call succedded");
-#else
+
 		/*
 		 * Check whether further reference is possible
 		 * to the unmapped memory region by writing
@@ -130,9 +124,7 @@  int main(int ac, char **av)
 		*addr = 50;
 
 		/* This message is printed if no SIGSEGV */
-		tst_resm(TFAIL, "process succeeds to refer unmapped "
-			 "memory region");
-#endif
+		tst_resm(TFAIL, "process succeeds to refer unmapped memory region");
 
 		cleanup();
 
@@ -195,14 +187,8 @@  void setup(void)
 	 * into the calling process's address space at the system choosen
 	 * with read/write permissions to the mapped region.
 	 */
-#ifdef UCLINUX
-	/* MAP_SHARED is not implemented on uClinux */
-	addr = mmap(0, map_len, PROT_READ | PROT_WRITE,
-		    MAP_FILE | MAP_PRIVATE, fildes, 0);
-#else
 	addr = mmap(0, map_len, PROT_READ | PROT_WRITE,
 		    MAP_FILE | MAP_SHARED, fildes, 0);
-#endif
 
 	/* check for the return value of mmap system call */
 	if (addr == (char *)MAP_FAILED) {
diff --git a/testcases/kernel/syscalls/munmap/munmap02.c b/testcases/kernel/syscalls/munmap/munmap02.c
index cd85d9436..311c0ea14 100644
--- a/testcases/kernel/syscalls/munmap/munmap02.c
+++ b/testcases/kernel/syscalls/munmap/munmap02.c
@@ -92,8 +92,6 @@  void setup();			/* Main setup function of test */
 void cleanup();			/* cleanup function for the test */
 void sig_handler();		/* signal catching function */
 
-#ifndef UCLINUX
-
 int main(int ac, char **av)
 {
 	int lc;
@@ -136,16 +134,6 @@  int main(int ac, char **av)
 	tst_exit();
 }
 
-#else
-
-int main(void)
-{
-	tst_resm(TINFO, "munmap02 test is not available on uClinux");
-	tst_exit();
-}
-
-#endif /* ifndef UCLINUX */
-
 /*
  * setup() - performs all ONE TIME setup for this test.
  * Setup signal handler to catch SIGSEGV.
@@ -199,14 +187,8 @@  void setup(void)
 	 * into the calling process's address space at the system choosen
 	 * with read/write permissions to the mapped region.
 	 */
-#ifdef UCLINUX
-	/* mmap() doesn't support MAP_SHARED on uClinux */
-	addr = mmap(0, map_len, PROT_READ | PROT_WRITE,
-		    MAP_FILE | MAP_PRIVATE, fildes, 0);
-#else
 	addr = mmap(0, map_len, PROT_READ | PROT_WRITE,
 		    MAP_FILE | MAP_SHARED, fildes, 0);
-#endif
 
 	/* check for the return value of mmap system call */
 	if (addr == (char *)MAP_FAILED) {