mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 04:58:13 +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
|
@ -53,6 +53,17 @@ void* mmap_with_name(void* addr, size_t size, int prot, int flags, int fd, off_t
|
|||
return serenity_mmap(addr, size, prot, flags, fd, offset, PAGE_SIZE, name);
|
||||
}
|
||||
|
||||
void* mremap(void* old_address, size_t old_size, size_t new_size, int flags)
|
||||
{
|
||||
Syscall::SC_mremap_params params { (uintptr_t)old_address, old_size, new_size, flags };
|
||||
ssize_t rc = syscall(SC_mremap, ¶ms);
|
||||
if (rc < 0 && -rc < EMAXERRNO) {
|
||||
errno = -rc;
|
||||
return MAP_FAILED;
|
||||
}
|
||||
return (void*)rc;
|
||||
}
|
||||
|
||||
int munmap(void* addr, size_t size)
|
||||
{
|
||||
int rc = syscall(SC_munmap, addr, size);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue