mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 06:04:57 +00:00
Tests/Kernel: Make sure inaccessible area in TestEFault is actually that
We were relying on luck to make the mapping before our first mmap() be inaccessible. Let's make it explicit.
This commit is contained in:
parent
2c72d495a3
commit
c713e76941
1 changed files with 3 additions and 0 deletions
|
@ -41,6 +41,9 @@ TEST_CASE(test_efault)
|
|||
int fd = open("/dev/zero", O_RDONLY);
|
||||
int rc = -1;
|
||||
|
||||
// Make an inaccessible hole before the next mapping.
|
||||
(void)mmap(nullptr, 4096, PROT_NONE, MAP_ANONYMOUS | MAP_PRIVATE, 0, 0);
|
||||
|
||||
// Test a one-page mapping (4KB)
|
||||
u8* one_page = (u8*)mmap(nullptr, 4096, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, 0, 0);
|
||||
VERIFY(one_page);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue