From 642b5fb0007b64c77d186fcb018d571152ee1d47 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Mon, 14 Aug 2023 18:51:07 +0200 Subject: reorganization: first steps --- src/user/lib/mman.c | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 src/user/lib/mman.c (limited to 'src/user/lib/mman.c') diff --git a/src/user/lib/mman.c b/src/user/lib/mman.c deleted file mode 100644 index 32eeb2a..0000000 --- a/src/user/lib/mman.c +++ /dev/null @@ -1,24 +0,0 @@ -/* mmap() emulation */ -#include -#include -#include - -void *mmap(void *addr, size_t len, int prot, int flags, int fd, off_t off) { - (void)fd; (void) off; - if ((flags & MMAP_UNSUPPORTED) == MMAP_UNSUPPORTED || - (prot & MMAP_UNSUPPORTED) == MMAP_UNSUPPORTED || - !(flags & MAP_ANONYMOUS)) - { - errno = ENOSYS; - return NULL; - } - - void *p = _sys_memflag(addr, len, MEMFLAG_FINDFREE | MEMFLAG_PRESENT); - if (!p) errno = ENOMEM; - return p; -} - -int munmap(void *addr, size_t len) { - _sys_memflag(addr, len, 0); - return 0; -} -- cgit v1.2.3