diff options
Diffstat (limited to 'arch/sandbox/cpu/os.c')
-rw-r--r-- | arch/sandbox/cpu/os.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/sandbox/cpu/os.c b/arch/sandbox/cpu/os.c index f80faac1f5..b7c3bf5f80 100644 --- a/arch/sandbox/cpu/os.c +++ b/arch/sandbox/cpu/os.c @@ -25,6 +25,7 @@ #include <unistd.h> #include <sys/types.h> #include <sys/stat.h> +#include <sys/mman.h> #include <os.h> @@ -87,3 +88,9 @@ void os_tty_raw(int fd) atexit(os_fd_restore); } + +void *os_malloc(size_t length) +{ + return mmap(NULL, length, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); +} |