Commit Graph

553 Commits

Author SHA1 Message Date
drh
19541f3018 Attempt to make the xDelete method of the unix VFS more robust on VxWorks.
FossilOrigin-Name: b0f6b91f36b503d8ba8d5257bb194f8c1afb4833
2014-09-01 13:37:55 +00:00
drh
bd9455457a Minor change to unixDelete for VxWorks with a DOS filesystem.
FossilOrigin-Name: f01d42cc8b00d2b7c4f14defcb05fdc493cf1bfd
2014-08-13 11:39:42 +00:00
drh
61ffea5490 Fix typos in the VxWorks code of os_unix.c.
FossilOrigin-Name: 19682e8fdc4a3b7884dba3e4387763e435ec16e6
2014-08-12 12:19:25 +00:00
drh
91be7dc320 Changes that will perhaps enable SQLite to work better on VxWorks.
FossilOrigin-Name: de27c742c0dcda20b51339598bf6094a8dcf5fb9
2014-08-11 13:53:30 +00:00
drh
3c19bbea0a The SQLITE_IOERR_BLOCKED extended error code is not longer used, so remove
assert() statements and documentation for that error code.  Also make other
documentation improvements.

FossilOrigin-Name: 36b7c5cefcad6bad044806092593c84876fee8bc
2014-08-08 15:38:11 +00:00
dan
702eec1cea Fix a problem with SQLITE_OMIT_WAL builds.
FossilOrigin-Name: 612b6d1b1f74eaf618520b90811eca10f978fc71
2014-06-23 10:04:58 +00:00
drh
0bdbc90db8 Add the SQLITE_UNLINK_AFTER_CLOSE compile-time option. If enabled, the
unlink of temporary files on unix is deferred until after the file is closed.

FossilOrigin-Name: e43a2f92b616ec885a1ee62911fa8f6991d277f7
2014-06-16 18:35:06 +00:00
drh
3044b51d2f Back out the unix VFS changes that seeks to avoid fstat() calls after an
unlink().  That change did not clear the problem on FuseFS.

FossilOrigin-Name: 0617e20a33e08754aea14e60db44e557c13978e3
2014-06-16 16:41:52 +00:00
drh
77ae7ca643 Avoid an unnecessary initialization of the szFile field of unixFile in
the unix VFS.

FossilOrigin-Name: 6484fb5a25c2a0e5d26694285a4908a22c67ba17
2014-06-09 20:39:03 +00:00
drh
f5154c6a1c Enhance the unix VFS so that it keeps track of the size of unlinked files
internally and thus avoids the need to call fstat() on those files, since
fstat() does not work reliably on unlinked files on some implementations of
FuseFS.

FossilOrigin-Name: c41df393c6afbfbfdc4d1b885024e083c6f6de1f
2014-06-09 20:06:01 +00:00
dan
bc76063cd2 Add a test to ensure os_unix.c works with 64KiB OS pages.
FossilOrigin-Name: e3d2be3ba47cdaafd26347620ae3bc2813203f16
2014-03-20 09:42:09 +00:00
dan
781e34cde3 Add an experimental fix to avoid attempting to mmap memory from an offset that is not a multiple of the system page size on systems with page sizes larger than 32KB.
FossilOrigin-Name: 6f3a5c24d254fc6faf607b505bdef4a7aafc21af
2014-03-20 08:59:47 +00:00
drh
dddf6978d2 Fix redundant definitions of _LARGE_FILE and _LARGEFILE_SOURCE.
FossilOrigin-Name: 4043d879795bfad55af35e9cb48e0a42eb4087ae
2014-02-07 19:33:31 +00:00
drh
693e671936 Fixes for various clang warnings.
FossilOrigin-Name: 87bf60637e5863c54c5e2d05aaaca0835b7aace8
2014-01-24 22:58:00 +00:00
dan
9871c59a2d Fix another harmless compiler warning in unixUnfetch().
FossilOrigin-Name: 0484549bb82ca5246488330c8d266e429ccd19b9
2014-01-10 16:40:21 +00:00
drh
1bcbc621df Fix harmless compiler warning in unixUnfetch().
FossilOrigin-Name: 618f248f4ea9fb0b6ff019a4c2cd72857389301f
2014-01-09 13:39:07 +00:00
drh
b00d862139 Try to detect process ID changes due to fork() calls in os_unix.c and
reset the PRNG when a process ID change is detected.

FossilOrigin-Name: e1eba1fb09d7db49d77928bd115b27b8002ae640
2014-01-01 15:18:36 +00:00
drh
b959a017b6 Actually look at i-node numbers to determine whether or not the database
file has moved.

FossilOrigin-Name: 2b1884dc14f9a04a04eebb3245fbe0daaff399eb
2013-12-07 12:29:22 +00:00
drh
47676fedf6 Fix two potential (and apparently harmless) shift overflows discovered by
the -fcatch-undefined-behavior option of clang.

FossilOrigin-Name: e19eead8c9977ed4f00eac54c5bc7e90db78caa8
2013-12-05 16:41:55 +00:00
dan
f52a4690b0 Fix a problem in os_unix.c causing compilation failure if SQLITE_DEBUG and SQLITE_MAX_MMAP_SIZE=0 are both defined.
FossilOrigin-Name: 090db8c81d8ca216277d11c8c4751c0a37801524
2013-10-31 18:49:58 +00:00
mistachkin
d95a3d3527 Add support for Cygwin when handling temporary file names. Improve error codes and diagnostic messages for temporary file name handling on Windows. Rename winConvertUtf8Filename to winConvertFromUtf8Filename. Improve placement and comments for forward function declarations.
FossilOrigin-Name: a411df725153119acb3bcf44fb71deecaa307887
2013-08-30 21:52:38 +00:00
drh
77a3fdc1b0 Add the SQLITE_MINIMUM_FILE_DESCRIPTOR compile-time option, for control over
exactly which low-numbered file descriptors SQLite will use.

FossilOrigin-Name: ba5190534330a25722eeb7ea9c42da7a6d146014
2013-08-30 14:24:12 +00:00
drh
5128d009c6 Improvements to the robust_open() logic in the unix VFS so that if an attempt
is made to open a repository on file descriptors 0, 1, or 2, and blocking
that file descriptor by opening it on /dev/null fails, then the open will
fail.

FossilOrigin-Name: d9c018f8155ab48df8e0e02519bba50588fe49fc
2013-08-30 06:20:23 +00:00
drh
35a0379a05 Change the unix VFS so that it refuses to open a database file using
a file descriptor less than 3.

FossilOrigin-Name: 66dddda06898abbf97fe0ac6a10ce1527ca8605e
2013-08-29 23:34:53 +00:00
drh
0c9a8e345e Never leave an open file descriptor pointing into the middle of the
database file if the file descriptor number is 2 or less.

FossilOrigin-Name: 3426673e4659eb68dbd14a3e41d4620d748432db
2013-08-29 21:26:26 +00:00
mistachkin
09b404419a Merge updates from trunk.
FossilOrigin-Name: 9d6860098f96efc7ea60e2d6116fb7d0e2685a55
2013-08-26 19:36:18 +00:00
dan
4dd5144366 Fix for builds with both SQLITE_OMIT_WAL and SQLITE_MAX_MMAP_SIZE=0 defined.
FossilOrigin-Name: edd5dbdc3239fc88799b822941603fcc828ecbb6
2013-08-26 14:30:25 +00:00
mistachkin
b5ca3cbcd3 Fix a couple compilation issues on Unix.
FossilOrigin-Name: 25b029d8f32440a94ef8af45153423f6702d7431
2013-08-24 01:12:03 +00:00
mistachkin
e98844f723 Unify the result of PRAGMA mmap_size when mmap support is disabled.
FossilOrigin-Name: 032c31593d6f569842830cac6222362be68b2084
2013-08-24 00:59:24 +00:00
drh
b01e5b59a2 Disable posix_fallocate() for all systems, all the time, unless the
HAVE_POSIX_FALLOCATE compile-time macro is supplied.

FossilOrigin-Name: b674462243138fcee192ef05d434665e30c681c4
2013-06-20 14:07:37 +00:00
drh
2daffdf0b5 Only default HAVE_POSIX_FALLOCATE on for linux, and then only if it is not
previously defined.

FossilOrigin-Name: 2b2ade92788be623af6f57e37d98994be2cec142
2013-06-19 14:49:14 +00:00
drh
7fb1b30118 Only enable posix_fallocate by default on linux and mac.
FossilOrigin-Name: b9b30d4f9845d212e2d3206abbf2795099e5d71d
2013-06-19 14:28:34 +00:00
drh
34e258c942 Cause the mmap_size PRAGMA to immediately change the mmap space if the
database connection is already active.  In particular, reducing mmap_size
will immediately free up process address space.

FossilOrigin-Name: 761177927cb51e4f5e66061ca39cf37edbe8346b
2013-05-23 01:40:53 +00:00
dan
ede01a97d3 In os_unix.c and os_win.c, initialize the default mmap-limit of a new file descriptor to the current global default mmap-limit, not the current global maximum allowable mmap-limit.
FossilOrigin-Name: 1def4ea3a02afc19648f4cd928b247f8fa55da80
2013-05-17 12:10:52 +00:00
drh
6cf9d8d63a Add assert()s to the implementation of xRead() in the built-in VFSes to
verify that the offset parameter is always non-negative.

FossilOrigin-Name: cf5c3642247fdd34d87f0368594cd7b8f081636a
2013-05-09 18:12:40 +00:00
dan
32c12fe2bb Minor fixes for compilation with SQLITE_OMIT_WAL defined.
FossilOrigin-Name: b81e87e72b976e7157a53a50abc5422e2a6c4c39
2013-05-02 17:37:31 +00:00
drh
c5797545de Untested fix for building on VxWorks.
FossilOrigin-Name: f14d55cf358b0392d3b8cd61dc85f43a610a8edf
2013-04-27 12:13:29 +00:00
dan
47a2b4a0b0 Avoid using posix_fallocate() in WAL mode, as it is not supported by all file-systems.
FossilOrigin-Name: 9c7523dabf4aee609287732ce787c9b9a9087e7f
2013-04-26 16:09:29 +00:00
drh
da8caa0b2d Fix harmless compiler warnings.
FossilOrigin-Name: 1a1cf5aa86734c832d845e07780262a178188d56
2013-04-22 23:38:50 +00:00
drh
9b4c59fa1b Refactoring the mmap interface. The controlling pragma is now "mmap_size"
instead of "mmap_limit".  Also change SQLITE_CONFIG_MMAP_LIMIT and
SQLITE_FCNTL_MMAP_LIMIT to SQLITE_CONFIG_MMAP_SIZE and
SQLITE_FCNTL_MMAP_SIZE, respecctively.  
The default mmap_size is now always 0, meaning that
memory mapped I/O is off by default.  There is a new compile-time option
SQLITE_MAX_MMAP_SIZE that determines a hard upper bound on the mmap_size.
Setting SQLITE_MAX_MMAP_SIZE to zero disables the memory-mapped I/O logic
and causes it to be omitted from the build.  An extra argument is added
to SQLITE_CONFIG_MMAP_SIZE that can optionally lower the SQLITE_MAX_MMAP_SIZE
at start-time. The SQLITE_MAX_MMAP_SIZE is zero for platforms where we 
know that it does not work, meaning that it cannot be turned on by mistake
on those platforms.

FossilOrigin-Name: ea1404a10abd7f68e1f8e0708c8a3199d1f79665
2013-04-15 17:03:42 +00:00
drh
fbc7e8845d Have the UNIX VFS issue warnings via sqlite3_log() if a database file is
renamed or unlinked or linked to more than one name while the file is open.

FossilOrigin-Name: e238dcf9189c029fbdcf89339e21d9cdd8fbf2c5
2013-04-11 01:16:15 +00:00
drh
6e0b6d52da Add extra #ifndef statements in os_unix.c and os_win.c to make sure the
memory mapped I/O really is disabled when SQLITE_DISABLE_MMAP is set.

FossilOrigin-Name: c1e2523c9051782569291fff998140f7e0b70b6d
2013-04-09 16:19:20 +00:00
dan
bcb8a868ce Handle the case in os_unix.c where SQLITE_FCNTL_MMAP_LIMIT requests that the mmap limit be set to a value smaller than the current mapping.
FossilOrigin-Name: 360473493ec1a7094a2b1c5436f3b70914a6dfdd
2013-04-08 15:30:41 +00:00
drh
34f7490311 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
2013-04-03 13:09:18 +00:00
drh
2b8246e3e2 Initialize the mmap_limit of temporary files to the configured mmap_limit.
FossilOrigin-Name: 24bab7596bb7385981a5d331df5eeb05353547f7
2013-04-03 10:50:02 +00:00
drh
85830a70c2 Fix the unix driver to check defined(_BSD_SOURCE) rather than just the plain
_BSD_SOURCE macro.  This fixes the build for OpenBSD.

FossilOrigin-Name: 1dd42ef4144ee08fb4ee1676d934a56a0e34bac2
2013-04-03 00:42:01 +00:00
dan
48ccef8059 Fix a resource leak in os_unix.c.
FossilOrigin-Name: b29cda03fe4e8d8f5b5acbbea2d69f284a2bdf23
2013-04-02 20:55:01 +00:00
dan
4ff7bc45c6 Add test cases for errors in mmap() or mremap() is os_unix.c.
FossilOrigin-Name: 3098a3c1e7305033904a496ef534cb312a876fab
2013-04-02 12:04:09 +00:00
drh
3861f546e3 Remove a debugging printf() accidently left in the previous check-in.
FossilOrigin-Name: 8198cdd8ac5dcc1c677fffa869ac965186b96abf
2013-04-01 22:42:48 +00:00
drh
a1f42c7c32 Add the SQLITE_CONFIG_MMAP_LIMIT configuration option for overriding the
SQLITE_DEFAULT_MMAP_LIMIT compile-time setting.  Enhance "PRAGMA mmap_limit"
so that without a specific database name, it sets the limit on all database
files and changes the default for any future databases that might be added
using ATTACH.

FossilOrigin-Name: 78141d0a16dd1d56b575fccd149de7fa789cb06c
2013-04-01 22:38:06 +00:00