Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Enable mac compilation with MMAP.
[simgrid.git] / src / xbt / mmalloc / mmap-sup.c
index e485126..f32e0aa 100644 (file)
@@ -1,26 +1,17 @@
 /* Support for an sbrk-like function that uses mmap.
    Copyright 1992, 2000 Free Software Foundation, Inc.
 
-   Contributed by Fred Fish at Cygnus Support.   fnf@cygnus.com
+   Contributed by Fred Fish at Cygnus Support.   fnf@cygnus.com */
 
-This file is part of the GNU C Library.
+/* Copyright (c) 2010. The SimGrid Team.
+ * All rights reserved.                                                     */
 
-The GNU C Library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public License as
-published by the Free Software Foundation; either version 2 of the
-License, or (at your option) any later version.
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
 
-The GNU C Library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB.  If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
-
-#if defined(HAVE_MMAP)
+#ifndef MAP_ANONYMOUS
+       #define MAP_ANONYMOUS MAP_ANON
+#endif
 
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>    /* Prototypes for lseek */
@@ -51,7 +42,7 @@ extern int getpagesize (void);
 /* Return MAP_PRIVATE if MDP represents /dev/zero.  Otherwise, return
    MAP_SHARED.  */
 
-#define MAP_PRIVATE_OR_SHARED(MDP) ((MDP -> flags & MMALLOC_DEVZERO) \
+#define MAP_PRIVATE_OR_SHARED(MDP) (( MDP -> flags & MMALLOC_ANONYMOUS) \
                                     ? MAP_PRIVATE \
                                     : MAP_SHARED)
 
@@ -211,4 +202,3 @@ mmalloc_findbase (int size)
     }
   return ((void*) base);
 }
-#endif /* defined(HAVE_MMAP) */