[LTP] [PATCH 4/8] Cleanup mmap17 test
Andrea Cervesato
andrea.cervesato@suse.de
Fri Feb 7 15:50:33 CET 2025
From: Andrea Cervesato <andrea.cervesato@suse.com>
Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
---
testcases/kernel/syscalls/mmap/mmap17.c | 23 +++++++++--------------
1 file changed, 9 insertions(+), 14 deletions(-)
diff --git a/testcases/kernel/syscalls/mmap/mmap17.c b/testcases/kernel/syscalls/mmap/mmap17.c
index 39703fbd397d33fe549b1c9a52db62f763e146dd..0d2ed9ccf7928f960f8bfa5e31604e840c6939a8 100644
--- a/testcases/kernel/syscalls/mmap/mmap17.c
+++ b/testcases/kernel/syscalls/mmap/mmap17.c
@@ -1,28 +1,23 @@
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Copyright (c) Zilogic Systems Pvt. Ltd., 2020
- * Email: code@zilogic.com
+ * Email: code@zilogic.com
+ * Copyright (C) 2025 SUSE LLC Andrea Cervesato <andrea.cervesato@suse.com>
*/
-/*
- * Test mmap with MAP_FIXED_NOREPLACE flag
+/*\
+ * [Description]
*
- * We are testing the MAP_FIXED_NOREPLACE flag of mmap() syscall. To check
+ * Verify MAP_FIXED_NOREPLACE flag for the mmap() syscall and check
* if an attempt to mmap at an exisiting mapping fails with EEXIST.
+ *
+ * [Algorithm]
+ *
* The code allocates a free address by passing NULL to first mmap call
- * Then tries to mmap with the same address using MAP_FIXED_NOREPLACE flag
+ * then tries to mmap with the same address using MAP_FIXED_NOREPLACE flag
* and the mapping fails as expected.
*/
-#include <stdio.h>
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <errno.h>
-#include <string.h>
-#include <stdlib.h>
-#include "lapi/mmap.h"
#include "tst_test.h"
static int fd_file1;
--
2.43.0
More information about the ltp
mailing list