syscalls: munmap: Add munmap04 to check ENOMEM
PATCH v3 1/1 syscalls: munmap: Add munmap04 to check ENOMEM
From: Ricardo B. Marlière <[email protected]>
The ERRORS section of the mmap(2) manpage says:
ENOMEM: The process's maximum number of mappings would have been exceeded. This error can also occur for munmap(), when unmapping a region in the middle of an existing mapping, since this results in two smaller mappings on either side of the region being unmapped.
Add a new test munmap04 to address this scenario.
---
Changes in v3:
- Added missing include to "lapi/mmap.h"
- Made max_map_count a test option
- Keep the mapped regions in the heap
- Required min. kernel v4.17
- Link to v2: https://lore.kernel.org/r/[email protected]
Changes in v2:
- Corrected the commit message
- Link to v1: https://lore.kernel.org/r/[email protected]
--- runtest/syscalls | 1 + testcases/kernel/syscalls/munmap/.gitignore | 1 + testcases/kernel/syscalls/munmap/munmap04.c | 94 +++++++++++++++++++++++++++++ 3 files changed, 96 insertions(+)
runtest/syscalls +1 -0
@@ -951,6 +951,7 @@ munlockall01 munlockall01 munmap01 munmap01 munmap02 munmap02 munmap03 munmap03 +munmap04 munmap04 nanosleep01 nanosleep01 nanosleep02 nanosleep02
testcases/kernel/syscalls/munmap/.gitignore +1 -0
@@ -1,3 +1,4 @@ /munmap01 /munmap02 /munmap03 +/munmap04
testcases/kernel/syscalls/munmap/munmap04.c new file +94 -0
94 lines not on this page · raw message
---
base-commit: f6b76fe373d1932ce1d2248e83ff284085145797
change-id: 20250704-new-munmap04-a59ca20ae00c
Best regards,
Signature · 5 lines
Ricardo B. Marlière <[email protected]> -- Mailing list info: https://lists.linux.it/listinfo/ltp