mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-15 16:48:24 +03:00
1d5afbdffc
It's nice to be able to identify mmap's in /proc/PID/vm.
26 lines
600 B
C++
26 lines
600 B
C++
#include "mman.h"
|
|
#include "errno.h"
|
|
#include <Kernel/Syscall.h>
|
|
|
|
extern "C" {
|
|
|
|
void* mmap(void* addr, size_t size)
|
|
{
|
|
int rc = Syscall::invoke(Syscall::PosixMmap, (dword)addr, (dword)size);
|
|
__RETURN_WITH_ERRNO(rc, (void*)rc, (void*)-1);
|
|
}
|
|
|
|
int munmap(void* addr, size_t size)
|
|
{
|
|
int rc = Syscall::invoke(Syscall::PosixMunmap, (dword)addr, (dword)size);
|
|
__RETURN_WITH_ERRNO(rc, rc, -1);
|
|
}
|
|
|
|
int set_mmap_name(void* addr, size_t size, const char* name)
|
|
{
|
|
int rc = Syscall::invoke(Syscall::SetMmapName, (dword)addr, (dword)size, (dword)name);
|
|
__RETURN_WITH_ERRNO(rc, rc, -1);
|
|
}
|
|
|
|
}
|