/ Check-in [3b7ec8d7]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Avoid assuming the page-size is 4096 bytes in os_unix.c.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | two-mappings
Files: files | file ages | folders
SHA1:3b7ec8d79e35e38df990e315c4ef9c7ab678bcbf
User & Date: dan 2013-03-29 11:24:15
Context
2013-03-29
18:52
Fix a problem in btree.c that could cause a crash following an OOM. Also various test script problems. check-in: e8bcdf93 user: dan tags: two-mappings
11:24
Avoid assuming the page-size is 4096 bytes in os_unix.c. check-in: 3b7ec8d7 user: dan tags: two-mappings
2013-03-27
19:53
Modify various test cases so that they work if the file is extended in units of the system page-size. check-in: 0e3d5119 user: dan tags: two-mappings
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/os_unix.c.

  4560   4560     }
  4561   4561   }
  4562   4562   
  4563   4563   /*
  4564   4564   ** Return the system page size somehow.
  4565   4565   */
  4566   4566   static int unixGetPagesize(void){
  4567         -  return 4096;
         4567  +#if HAVE_REMAP
         4568  +  return 512;
         4569  +#elif _BSD_SOURCE
         4570  +  return getpagesize();
         4571  +#else
         4572  +  return (int)sysconf(_SC_PAGESIZE);
         4573  +#endif
  4568   4574   }
  4569   4575   
  4570   4576   /*
  4571   4577   ** Memory map or remap the file opened by file-descriptor pFd (if the file
  4572   4578   ** is already mapped, the existing mapping is replaced by the new). Or, if 
  4573   4579   ** there already exists a mapping for this file, and there are still 
  4574   4580   ** outstanding xFetch() references to it, this function is a no-op.