mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 02:57:42 +00:00
Kernel+LibC: Add a very limited sys$mremap() implementation
This syscall can currently only remap a shared file-backed mapping into a private file-backed mapping.
This commit is contained in:
parent
c1360ef22e
commit
30dbe9c78a
6 changed files with 71 additions and 1 deletions
|
@ -238,4 +238,16 @@ inline unsigned prot_to_region_access_flags(int prot)
|
|||
return access;
|
||||
}
|
||||
|
||||
inline int region_access_flags_to_prot(unsigned access)
|
||||
{
|
||||
int prot = 0;
|
||||
if (access & Region::Access::Read)
|
||||
prot |= PROT_READ;
|
||||
if (access & Region::Access::Write)
|
||||
prot |= PROT_WRITE;
|
||||
if (access & Region::Access::Execute)
|
||||
prot |= PROT_EXEC;
|
||||
return prot;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue