diff options
Diffstat (limited to 'libc')
-rw-r--r-- | libc/stdlib/malloc-simple/alloc.c | 7 | ||||
-rw-r--r-- | libc/stdlib/malloc/malloc.c | 19 | ||||
-rw-r--r-- | libc/sysdeps/linux/common/syscalls.c | 6 |
3 files changed, 17 insertions, 15 deletions
diff --git a/libc/stdlib/malloc-simple/alloc.c b/libc/stdlib/malloc-simple/alloc.c index ed1c381a5..02231fbed 100644 --- a/libc/stdlib/malloc-simple/alloc.c +++ b/libc/stdlib/malloc-simple/alloc.c @@ -1,3 +1,4 @@ +#include <features.h> #include <unistd.h> #include <stdio.h> #include <stdlib.h> @@ -67,10 +68,10 @@ void *calloc(size_t num, size_t size) void *malloc(size_t len) { void *result = mmap((void *) 0, len, PROT_READ | PROT_WRITE, -#ifdef __HAS_NO_MMU__ - MAP_SHARED | MAP_ANONYMOUS, 0, 0 -#else +#ifdef __UCLIBC_HAS_MMU__ MAP_PRIVATE | MAP_ANONYMOUS, 0, 0 +#else + MAP_SHARED | MAP_ANONYMOUS, 0, 0 #endif ); diff --git a/libc/stdlib/malloc/malloc.c b/libc/stdlib/malloc/malloc.c index b5cfee3f0..95dda3da5 100644 --- a/libc/stdlib/malloc/malloc.c +++ b/libc/stdlib/malloc/malloc.c @@ -55,6 +55,7 @@ #define _POSIX_SOURCE #define _XOPEN_SOURCE +#include <features.h> #include <sys/types.h> #include <unistd.h> #include <limits.h> @@ -177,10 +178,10 @@ void *__hunk_alloc(int size) (p = (Hunk_t *) mmap(HUNK_MSTART, HUNK_MSIZE, PROT_READ | PROT_WRITE, -#ifdef __HAS_NO_MMU__ - MAP_SHARED | MAP_ANONYMOUS -#else +#ifdef __UCLIBC_HAS_MMU__ MAP_PRIVATE | MAP_ANONYMOUS +#else + MAP_SHARED | MAP_ANONYMOUS #endif , 0, 0)) == (Hunk_t *) MAP_FAILED) // { @@ -483,10 +484,10 @@ static Block_t *bl_mapnew(size_t size) map_size = PAGE_ALIGN(size); pt = mmap(LARGE_MSTART, map_size, PROT_READ | PROT_WRITE | PROT_EXEC, -#ifdef __HAS_NO_MMU__ - MAP_SHARED | MAP_ANONYMOUS -#else +#ifdef __UCLIBC_HAS_MMU__ MAP_PRIVATE | MAP_ANONYMOUS +#else + MAP_SHARED | MAP_ANONYMOUS #endif , 0, 0); @@ -511,10 +512,10 @@ void __bl_uncommit(Block_t * b) #if M_DOTRIMMING mmap(u_start, u_end - u_start, PROT_READ | PROT_WRITE | PROT_EXEC, -#ifdef __HAS_NO_MMU__ - MAP_SHARED | MAP_ANONYMOUS |MAP_FIXED -#else +#ifdef __UCLIBC_HAS_MMU__ MAP_PRIVATE | MAP_ANONYMOUS |MAP_FIXED +#else + MAP_SHARED | MAP_ANONYMOUS |MAP_FIXED #endif , 0, 0); #endif diff --git a/libc/sysdeps/linux/common/syscalls.c b/libc/sysdeps/linux/common/syscalls.c index 56d9685d1..4244d9be8 100644 --- a/libc/sysdeps/linux/common/syscalls.c +++ b/libc/sysdeps/linux/common/syscalls.c @@ -38,7 +38,7 @@ _syscall1(void, _exit, int, status); //#define __NR_fork 2 #ifdef L_fork -#ifndef __HAS_NO_MMU__ +#ifdef __UCLIBC_HAS_MMU__ #include <unistd.h> _syscall0(pid_t, fork); #endif @@ -683,7 +683,7 @@ _syscall2(int, statfs, const char *, path, struct statfs *, buf); _syscall2(int, fstatfs, int, fd, struct statfs *, buf); #endif -#ifndef __HAS_NO_MMU__ +#ifdef __UCLIBC_HAS_MMU__ //#define __NR_ioperm 101 #ifdef L_ioperm #include <sys/io.h> @@ -802,7 +802,7 @@ int fstat(int filedes, struct libc_stat *buf) //#define __NR_olduname 109 -#ifndef __HAS_NO_MMU__ +#ifdef __UCLIBC_HAS_MMU__ //#define __NR_iopl 110 #ifdef L_iopl #include <sys/io.h> |