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:
parent
6af8392cf8
commit
33025a8049
4 changed files with 27 additions and 8 deletions
|
@ -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, ¶ms);
|
||||
__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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue