PatchworkOS
19e446b
A non-POSIX operating system.
Theme:
Default
Round
Robot
Loading...
Searching...
No Matches
mmap.c
Go to the documentation of this file.
1
#include <
stdio.h
>
2
#include <
sys/fs.h
>
3
4
#include "
user/common/syscalls.h
"
5
6
void
*
mmap
(
fd_t
fd,
void
*
address
,
size_t
length,
prot_t
prot)
7
{
8
void
* result =
_syscall_mmap
(fd,
address
, length, prot);
9
if
(result ==
NULL
)
10
{
11
errno
=
_syscall_errno
();
12
}
13
return
result;
14
}
address
static uintptr_t address
Mapped virtual address of the HPET registers.
Definition
hpet.c:96
errno
#define errno
Error number variable.
Definition
errno.h:27
mmap
void * mmap(fd_t fd, void *address, size_t length, prot_t prot)
System call to map memory from a file.
Definition
mmap.c:6
prot_t
prot_t
Memory protection flags.
Definition
proc.h:122
NULL
#define NULL
Pointer error value.
Definition
NULL.h:25
fd_t
__UINT64_TYPE__ fd_t
File descriptor type.
Definition
fd_t.h:10
fs.h
stdio.h
syscalls.h
_syscall_errno
static errno_t _syscall_errno(void)
Definition
syscalls.h:107
_syscall_mmap
static void * _syscall_mmap(fd_t fd, void *address, size_t length, prot_t prot)
Definition
syscalls.h:177
src
libstd
user
functions
proc
mmap.c
Generated on Sat Jan 24 2026 10:59:25 for PatchworkOS by
1.9.8