about summary refs log tree commit diff
path: root/elf/dl-minimal.c
diff options
context:
space:
mode:
Diffstat (limited to 'elf/dl-minimal.c')
-rw-r--r--elf/dl-minimal.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/elf/dl-minimal.c b/elf/dl-minimal.c
index fd7bf05497..61615cd9a9 100644
--- a/elf/dl-minimal.c
+++ b/elf/dl-minimal.c
@@ -33,13 +33,18 @@ static void *alloc_ptr, *alloc_end, *alloc_last_block;
 void * weak_function
 malloc (size_t n)
 {
+#ifdef MAP_ANON
+#define	_dl_zerofd (-1)
+#else
   extern int _dl_zerofd;
 
-  if (_dl_pagesize == 0)
-    _dl_pagesize = __getpagesize ();
-
   if (_dl_zerofd == -1)
     _dl_zerofd = _dl_sysdep_open_zero_fill ();
+#define MAP_ANON 0
+#endif
+
+  if (_dl_pagesize == 0)
+    _dl_pagesize = __getpagesize ();
 
   if (alloc_end == 0)
     {