]> git.saurik.com Git - apt.git/commitdiff
MAP_ANON is deprecated in favor of MAP_ANONYMOUS, but telesphoreo needs
authorDavid Kalnischkies <kalnischkies@gmail.com>
Thu, 12 May 2011 23:14:50 +0000 (01:14 +0200)
committerDavid Kalnischkies <kalnischkies@gmail.com>
Thu, 12 May 2011 23:14:50 +0000 (01:14 +0200)
to ships a patch for this so pretend to be nice and make it work (TM)

apt-pkg/contrib/mmap.cc

index 9945b160679d081469d3ee3c7ccdf4d51a127b4c..19381ae4719ea7005ac338463bdbe7e4a5e3cd95 100644 (file)
@@ -237,11 +237,19 @@ DynamicMMap::DynamicMMap(unsigned long Flags,unsigned long const &WorkSpace,
        if ((this->Flags & Fallback) != Fallback) {
                // Set the permissions.
                int Prot = PROT_READ;
+#ifdef MAP_ANONYMOUS
                int Map = MAP_PRIVATE | MAP_ANONYMOUS;
+#else
+               int Map = MAP_PRIVATE | MAP_ANON;
+#endif
                if ((this->Flags & ReadOnly) != ReadOnly)
                        Prot |= PROT_WRITE;
                if ((this->Flags & Public) == Public)
+#ifdef MAP_ANONYMOUS
                        Map = MAP_SHARED | MAP_ANONYMOUS;
+#else
+                       Map = MAP_SHARED | MAP_ANON;
+#endif
 
                // use anonymous mmap() to get the memory
                Base = (unsigned char*) mmap(0, WorkSpace, Prot, Map, -1, 0);