mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 01:17:35 +00:00
AK+LibGfx+LibJS: Pass -1 as the file descriptor to anonymous mmap
Serenity/Linux/macOS ignore the file descriptor when an anonymous mapping is requested. However, BSDs require the fd to be -1.
This commit is contained in:
parent
4bed2ef66b
commit
42e22f89a4
3 changed files with 3 additions and 3 deletions
|
@ -106,7 +106,7 @@ protected:
|
|||
#ifdef __serenity__
|
||||
new_chunk = serenity_mmap(nullptr, m_chunk_size, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_RANDOMIZED | MAP_PRIVATE, 0, 0, m_chunk_size, "BumpAllocator Chunk");
|
||||
#else
|
||||
new_chunk = mmap(nullptr, m_chunk_size, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, 0, 0);
|
||||
new_chunk = mmap(nullptr, m_chunk_size, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
|
||||
#endif
|
||||
if (new_chunk == MAP_FAILED)
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue