1
0
This repository has been archived on 2024-11-10. You can view files and clone it, but cannot push or open issues or pull requests.
Lakka-rk322x/packages/databases/sqlite/patches/sqlite-01_map_populate.patch
Stefan Saraev 59868b5cf1 sqlite: always use memory for tempfiles.
credits to @bavison for the MAP_POPULATE patch
2014-02-24 19:50:07 +02:00

23 lines
782 B
Diff

diff --git a/sqlite3.c b/sqlite3.c
index d0057a6..63b80c7 100644
--- a/sqlite3.c
+++ b/sqlite3.c
@@ -28278,7 +28278,7 @@ static void unixRemapfile(
pNew = osMremap(pOrig, nReuse, nNew, MREMAP_MAYMOVE);
zErr = "mremap";
#else
- pNew = osMmap(pReq, nNew-nReuse, flags, MAP_SHARED, h, nReuse);
+ pNew = osMmap(pReq, nNew-nReuse, flags, MAP_SHARED | MAP_POPULATE, h, nReuse);
if( pNew!=MAP_FAILED ){
if( pNew!=pReq ){
osMunmap(pNew, nNew - nReuse);
@@ -28297,7 +28297,7 @@ static void unixRemapfile(
/* If pNew is still NULL, try to create an entirely new mapping. */
if( pNew==0 ){
- pNew = osMmap(0, nNew, flags, MAP_SHARED, h, 0);
+ pNew = osMmap(0, nNew, flags, MAP_SHARED | MAP_POPULATE, h, 0);
}
if( pNew==MAP_FAILED ){