1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 03:57:44 +00:00

Add simplified mmap() and munmap() syscalls.

This commit is contained in:
Andreas Kling 2018-10-24 09:48:24 +02:00
parent a5caf7ca99
commit 9a296d63f3
13 changed files with 116 additions and 2 deletions

View file

@ -3,6 +3,7 @@ OBJS = \
unistd.o \
string.o \
process.o \
mman.o \
entry.o
LIBRARY = LibC.a

16
LibC/mman.cpp Normal file
View file

@ -0,0 +1,16 @@
#include "mman.h"
#include <Kernel/Syscall.h>
extern "C" {
void* mmap(void* addr, size_t size)
{
return (void*)Syscall::invoke(Syscall::PosixMmap, (dword)addr, (dword)size);
}
int munmap(void* addr, size_t size)
{
return Syscall::invoke(Syscall::PosixMunmap, (dword)addr, (dword)size);
}
}

10
LibC/mman.h Normal file
View file

@ -0,0 +1,10 @@
#pragma once
#include "types.h"
extern "C" {
void* mmap(void*, size_t);
int munmap(void*, size_t);
}