libc: Add support for mmap()'s new syscall format

This commit is contained in:
apio 2023-08-02 22:19:39 +02:00
parent 2572695c8d
commit f66b0497cf
Signed by: apio
GPG Key ID: B8A7D06E42258954

View File

@ -1,4 +1,5 @@
#include <bits/errno-return.h>
#include <bits/mmap.h>
#include <luna/Heap.h>
#include <sys/mman.h>
#include <sys/syscall.h>
@ -6,9 +7,10 @@
extern "C"
{
void* mmap(void* addr, size_t len, int prot, int flags, int, off_t)
void* mmap(void* addr, size_t len, int prot, int flags, int fd, off_t offset)
{
long rc = syscall(SYS_mmap, addr, len, prot, flags);
const mmap_params params { addr, len, prot, flags, fd, offset };
long rc = syscall(SYS_mmap, &params);
__errno_return(rc, void*);
}