diff options
author | drh <drh@noemail.net> | 2013-04-03 13:09:18 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2013-04-03 13:09:18 +0000 |
commit | 34f7490311f77d0da8c90260d083f19550fd6c61 (patch) | |
tree | 31047e707778f74709adffbe56477c145677fe6e /src/os_unix.c | |
parent | 6c96946475fd5b61168ba6b7e43b33e46fee2a9f (diff) | |
download | sqlite-34f7490311f77d0da8c90260d083f19550fd6c61.tar.gz sqlite-34f7490311f77d0da8c90260d083f19550fd6c61.zip |
Change the mmap_limit pragma to report the new limit, or to report the
existing limit if called with no arguments. Report the default mmap_limit
as part of PRAGMA compile_options. Set the default mmmap_limit to 0 for
all systems other than linux, mac, windows, and solaris.
FossilOrigin-Name: 2d9f1327fe79e40435ce1e2594d7cd9a5aea0ef2
Diffstat (limited to 'src/os_unix.c')
-rw-r--r-- | src/os_unix.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/os_unix.c b/src/os_unix.c index 39a31cb18..75f923601 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -3710,7 +3710,9 @@ static int unixFileControl(sqlite3_file *id, int op, void *pArg){ return SQLITE_OK; } case SQLITE_FCNTL_MMAP_LIMIT: { - pFile->mmapLimit = *(i64*)pArg; + i64 newLimit = *(i64*)pArg; + *(i64*)pArg = pFile->mmapLimit; + if( newLimit>=0 ) pFile->mmapLimit = newLimit; return SQLITE_OK; } #ifdef SQLITE_DEBUG |