Skip to content

Commit

Permalink
Don't use madvise() on SerenityOS
Browse files Browse the repository at this point in the history
SerenityOS only supports MADV_SET_VOLATILE/MADV_SET_NONVOLATILE and
returns EINVAL for MADV_DONTNEED:
https://github.com/SerenityOS/serenity/blob/b88cd185a0ec40fc10405b555507aa6f0aab8222/Kernel/Syscalls/mmap.cpp#L355-L388

See: #688
  • Loading branch information
linusg committed Dec 15, 2024
1 parent c6f9f28 commit 87821a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion os_dep.c
Original file line number Diff line number Diff line change
Expand Up @@ -2770,7 +2770,7 @@ block_unmap_inner(ptr_t start_addr, size_t len)
# ifdef SN_TARGET_PS3
ps3_free_mem(start_addr, len);
# elif defined(AIX) || defined(COSMO) || defined(CYGWIN32) \
|| defined(HPUX) || defined(SERENITY) \
|| defined(HPUX) \
|| (defined(LINUX) && !defined(PREFER_MMAP_PROT_NONE))
/* On AIX, mmap(PROT_NONE) fails with ENOMEM unless the */
/* environment variable XPG_SUS_ENV is set to ON. */
Expand Down

0 comments on commit 87821a6

Please sign in to comment.