PatchworkOS
Loading...
Searching...
No Matches
mmap.c
Go to the documentation of this file.
1#include <stdio.h>
2#include <sys/io.h>
3
5
6void* mmap(fd_t fd, void* address, uint64_t length, prot_t prot)
7{
8 void* result = _syscall_mmap(fd, address, length, prot);
9 if (result == NULL)
10 {
12 }
13 return result;
14}
#define errno
Error number variable.
Definition errno.h:27
void * mmap(fd_t fd, void *address, uint64_t length, prot_t prot)
System call to map memory from a file.
Definition mmap.c:6
prot_t
Memory protection flags.
Definition proc.h:170
#define NULL
Pointer error value.
Definition NULL.h:23
__UINT64_TYPE__ fd_t
A file descriptor.
Definition fd_t.h:12
static uintptr_t address
Definition hpet.c:12
static void * _syscall_mmap(fd_t fd, void *address, uint64_t length, prot_t prot)
Definition syscalls.h:193
static errno_t _syscall_errno(void)
Definition syscalls.h:118
__UINT64_TYPE__ uint64_t
Definition stdint.h:17