1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 05:58:11 +00:00

Kernel: Pass name+length to set_mmap_name() and remove SmapDisabler

This commit is contained in:
Andreas Kling 2020-01-06 11:56:59 +01:00
parent 6af8392cf8
commit 33025a8049
4 changed files with 27 additions and 8 deletions

View file

@ -2,6 +2,7 @@
#include <errno.h>
#include <mman.h>
#include <stdio.h>
#include <string.h>
extern "C" {
@ -41,7 +42,12 @@ int mprotect(void* addr, size_t size, int prot)
int set_mmap_name(void* addr, size_t size, const char* name)
{
int rc = syscall(SC_set_mmap_name, addr, size, name);
if (!name) {
errno = EFAULT;
return -1;
}
Syscall::SC_set_mmap_name_params params { addr, size, name, strlen(name) };
int rc = syscall(SC_set_mmap_name, &params);
__RETURN_WITH_ERRNO(rc, rc, -1);
}
@ -50,5 +56,4 @@ int madvise(void* address, size_t size, int advice)
int rc = syscall(SC_madvise, address, size, advice);
__RETURN_WITH_ERRNO(rc, rc, -1);
}
}