mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:48:10 +00:00

This also meant I had to implement BSS (SHT_NOBITS) sections in ELFLoader. I also added an strerror() so we can print out what the errors are.
19 lines
406 B
C++
19 lines
406 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);
|
|
}
|
|
|
|
}
|