apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject cvs commit: apr/mmap/unix mmap.c
Date Mon, 30 Apr 2001 00:07:35 GMT
rbb         01/04/29 17:07:35

  Modified:    .        CHANGES
               mmap/unix mmap.c
  Log:
  Make the apr_mmap_create() function use the native_flags variable.
  This allows us to actually create WRITEABLE MMAPs.
  Submitted by:	Ed Korthof <ed@apache.org>
  
  Revision  Changes    Path
  1.98      +4 -0      apr/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apr/CHANGES,v
  retrieving revision 1.97
  retrieving revision 1.98
  diff -u -d -b -w -u -r1.97 -r1.98
  --- CHANGES	2001/04/29 05:22:15	1.97
  +++ CHANGES	2001/04/30 00:07:34	1.98
  @@ -1,5 +1,9 @@
   Changes with APR b1  
   
  +  *) Make the apr_mmap_create() function use the native_flags variable.
  +     This allows us to actually create WRITEABLE MMAPs.
  +     [Ed Korthof <ed@apache.org>]
  +
     *) Completely revamp configure so that it preserves the standard make
        variables CPPFLAGS, CFLAGS, CXXFLAGS, LDFLAGS and LIBS by moving
        the configure additions to EXTRA_* variables.  Also, allow the user
  
  
  
  1.35      +4 -10     apr/mmap/unix/mmap.c
  
  Index: mmap.c
  ===================================================================
  RCS file: /home/cvs/apr/mmap/unix/mmap.c,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -d -b -w -u -r1.34 -r1.35
  --- mmap.c	2001/02/25 20:39:35	1.34
  +++ mmap.c	2001/04/30 00:07:35	1.35
  @@ -105,13 +105,12 @@
                                apr_off_t offset, apr_size_t size, 
                                apr_int32_t flag, apr_pool_t *cont)
   {
  -    apr_int32_t native_flags = 0;
  -#ifdef BEOS
       void *mm;
  +#ifdef BEOS
       area_id aid = -1;
       uint32 pages = 0;
   #else
  -    void *mm;
  +    apr_int32_t native_flags = 0;
   #endif
      
       if (file == NULL || file->filedes == -1 || file->buffered)
  @@ -121,15 +120,10 @@
   #ifdef BEOS
       /* XXX: mmap shouldn't really change the seek offset */
       apr_file_seek(file, APR_SET, &offset);
  -    if (flag & APR_MMAP_WRITE) {
  -        native_flags |= B_WRITE_AREA;
  -    }
  -    if (flag & APR_MMAP_READ) {
  -        native_flags |= B_READ_AREA;
  -    }
   
       /* There seems to be some strange interactions that mean our area must
        * be set as READ & WRITE or writev will fail!  Go figure...
  +     * So we ignore the value in flags and always ask for both READ and WRITE
        */
       pages = (size + B_PAGE_SIZE -1) / B_PAGE_SIZE;
       aid = create_area("apr_mmap", &mm , B_ANY_ADDRESS, pages * B_PAGE_SIZE,
  @@ -153,7 +147,7 @@
           native_flags |= PROT_READ;
       }
   
  -    mm = mmap(NULL, size, PROT_READ, MAP_SHARED, file->filedes, offset);
  +    mm = mmap(NULL, size, native_flags, MAP_SHARED, file->filedes, offset);
   
       if (mm == (void *)-1) {
           /* we failed to get an mmap'd file... */
  
  
  

Mime
View raw message