libc: Allow private writable mappings

Fixes #3480
This commit is contained in:
Alexander Senier 2019-08-21 09:34:35 +02:00 committed by Christian Helmuth
parent 66d5359d75
commit 2a3cebdd6e
1 changed files with 1 additions and 1 deletions

View File

@ -1258,7 +1258,7 @@ int Libc::Vfs_plugin::rename(char const *from_path, char const *to_path)
void *Libc::Vfs_plugin::mmap(void *addr_in, ::size_t length, int prot, int flags,
Libc::File_descriptor *fd, ::off_t offset)
{
if (prot != PROT_READ) {
if (prot != PROT_READ && !(prot == (PROT_READ | PROT_WRITE) && flags == MAP_PRIVATE)) {
Genode::error("mmap for prot=", Genode::Hex(prot), " not supported");
errno = EACCES;
return (void *)-1;