From ae444d4dccc22c77b762d1f04ca2fa0d33c7c754 Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Sat, 15 Aug 2020 14:17:22 -0400 Subject: build properly when not targetting POSIX --- src/stdlib/realloc.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/stdlib/realloc.c b/src/stdlib/realloc.c index 77eb7989..9b4d28ee 100644 --- a/src/stdlib/realloc.c +++ b/src/stdlib/realloc.c @@ -1,14 +1,19 @@ #include + +#if defined _POSIX_C_SOURCE && 199305L <= _POSIX_C_SOURCE #include "sys/types.h" #include "fcntl.h" #include "sys/mman.h" -#if defined _POSIX_C_SOURCE && 199305L <= _POSIX_C_SOURCE -/* mu */ + #else -#include "sys/mman/mmap.c" +#include "_syscall.h" #define PROT_READ 0x1 #define PROT_WRITE 0x2 #define MAP_PRIVATE 0x2 +#define O_RDWR 0x2 +#define mmap(_a, _l, _p, _fl, _fd, _o) __syscall(__syscall_lookup(mmap), _a, _l, _p, _fl, _fd, _o) +#define open(_p, _a, _m) __syscall(__syscall_lookup(open), _p, _a, _m) + #endif /** change the amount of memory allocated **/ -- cgit v1.2.1