~brian-murray/ubuntu/oneiric/apt/block-fsys-tarfile

« back to all changes in this revision

Viewing changes to apt-pkg/contrib/mmap.cc

  • Committer: Michael Vogt
  • Date: 2011-06-28 21:41:29 UTC
  • mfrom: (1327.97.34 debian-sid)
  • Revision ID: michael.vogt@ubuntu.com-20110628214129-tait7qp81nvm7wjv
mergedĀ fromĀ debian-sid

Show diffs side-by-side

added added

removed removed

Lines of Context:
237
237
        if ((this->Flags & Fallback) != Fallback) {
238
238
                // Set the permissions.
239
239
                int Prot = PROT_READ;
 
240
#ifdef MAP_ANONYMOUS
240
241
                int Map = MAP_PRIVATE | MAP_ANONYMOUS;
 
242
#else
 
243
                int Map = MAP_PRIVATE | MAP_ANON;
 
244
#endif
241
245
                if ((this->Flags & ReadOnly) != ReadOnly)
242
246
                        Prot |= PROT_WRITE;
243
247
                if ((this->Flags & Public) == Public)
 
248
#ifdef MAP_ANONYMOUS
244
249
                        Map = MAP_SHARED | MAP_ANONYMOUS;
 
250
#else
 
251
                        Map = MAP_SHARED | MAP_ANON;
 
252
#endif
245
253
 
246
254
                // use anonymous mmap() to get the memory
247
255
                Base = (unsigned char*) mmap(0, WorkSpace, Prot, Map, -1, 0);