]>
git.saurik.com Git - minimal.git/blob - mapping.h
10 void *map(const char *path
, size_t offset
, size_t size
, size_t *psize
, bool ro
) {
12 _syscall(fd
= open(path
, ro
? O_RDONLY
: O_RDWR
));
14 if (size
== _not(size_t)) {
16 _syscall(fstat(fd
, &stat
));
24 _syscall(base
= mmap(NULL
, size
, ro
? PROT_READ
: PROT_READ
| PROT_WRITE
, MAP_SHARED
, fd
, offset
));