1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 13:55:06 +00:00

Userland+Tests: Don't use MAP_FILE when mmap-ing

MAP_FILE is not in POSIX, and is simply in most LibCs as a "default"
mode. Our own LibC defines it as 0, meaning "no flags". It is also not
defined in some OS's, such as Haiku. Let's be more portable and not use
the unnecessary flag.
This commit is contained in:
Andrew Kaster 2023-09-01 09:53:12 +02:00 committed by Jelle Raaijmakers
parent f642b54b5e
commit 1cd3826ad6
9 changed files with 9 additions and 9 deletions

View file

@ -18,7 +18,7 @@ int main()
perror("open");
return 1;
}
u8* ptr = (u8*)mmap(nullptr, 16384, PROT_READ, MAP_FILE | MAP_SHARED, fd, 0);
u8* ptr = (u8*)mmap(nullptr, 16384, PROT_READ, MAP_SHARED, fd, 0);
if (ptr == MAP_FAILED) {
perror("mmap");
return 1;