diff options
author | Jakob Kaivo <jkk@ung.org> | 2020-08-15 14:17:22 -0400 |
---|---|---|
committer | Jakob Kaivo <jkk@ung.org> | 2020-08-15 14:17:22 -0400 |
commit | ae444d4dccc22c77b762d1f04ca2fa0d33c7c754 (patch) | |
tree | 8252d3a8a503bf6cb64eee1bda2e016d5b818bba /src/stdlib | |
parent | f62f3ad0674f5acac41f8196f8a8aab7daf073da (diff) |
build properly when not targetting POSIX
Diffstat (limited to 'src/stdlib')
-rw-r--r-- | src/stdlib/realloc.c | 11 |
1 files changed, 8 insertions, 3 deletions
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 <stdlib.h> + +#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 **/ |