mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:27:44 +00:00
Start working on memory-mapped files.
First of all, change sys$mmap to take a struct SC_mmap_params since our sycsall calling convention can't handle more than 3 arguments. This exposed a bug in Syscall::invoke() needing to use clobber lists. It was a bit confusing to debug. :^)
This commit is contained in:
parent
41a751c90c
commit
fdbd9f1e27
14 changed files with 82 additions and 26 deletions
|
@ -1,12 +1,14 @@
|
|||
#include "mman.h"
|
||||
#include "errno.h"
|
||||
#include <mman.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <Kernel/Syscall.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
void* mmap(void* addr, size_t size)
|
||||
void* mmap(void* addr, size_t size, int prot, int flags, int fd, off_t offset)
|
||||
{
|
||||
int rc = Syscall::invoke(Syscall::SC_mmap, (dword)addr, (dword)size);
|
||||
Syscall::SC_mmap_params params { (dword)addr, size, prot, flags, fd, offset };
|
||||
int rc = Syscall::invoke(Syscall::SC_mmap, (dword)¶ms);
|
||||
__RETURN_WITH_ERRNO(rc, (void*)rc, (void*)-1);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue