Permalink
Cannot retrieve contributors at this time
Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign up
Switch branches/tags
3-digit-multiplex-suffix
3.18
64-bit-lengths
Cplusplus-comment
EQP-improvements
IN-operator-improvements
IN-with-ORDERBY
OP_Column-refactor
OP_SorterColumns
OR-clause-improvement
VList
abandoned
affinity-func
affinity-sql-func
align8-fix
alt1-tkt-f97c4637
altShellFix
alter-table-rename-column
amalg-json1-fts5
analyze-empty-tables
analyze-idx
analyze-worst-case
android-large-filles
api-armor
appendvfs
apple-increased-sorting-cost
apple-osx-377
apple-osx-385
apple-osx-3623
apple-osx-exp
apple-osx-ml
apple-osx
apple-wal-readonly
application-id
archive-improvements
asciiMode
ast-trace-demo
attach-in-trans
auto-analyze
auto-explain
autoconf-package
autoinc-enhancement
autoindex-improvements
autoindex-planning
automatic-index-affinity
aux-data-in-rtree
auxdata-cache
av-defense
avoid-buffer-overread
avoid-fallocate
avoid-unusable-match
batch-atomic-write-3.19
batch-atomic-write
begin-concurrent-branch-3.19
begin-concurrent-pnu-tempfix
begin-concurrent-pnu
begin-concurrent
better-distinct-agg
bind-pointer
blob-affinity-rename
blob_reopen-fix
blocking-checkpoint
box-character-graph
branch-3.3.6
branch-3.5.9
branch-3.6.1-exp
branch-3.6.1
branch-3.6.21
branch-3.6.22
branch-3.6.23
branch-3.7.0
branch-3.7.2
branch-3.7.4
branch-3.7.5
branch-3.7.6
branch-3.7.7
branch-3.7.9
branch-3.7.11
branch-3.7.14
branch-3.7.15
branch-3.7.16
branch-3.8.0
branch-3.8.2
branch-3.8.3
branch-3.8.4
branch-3.8.6
branch-3.8.7
branch-3.8.8
branch-3.8.9
branch-3.8.10
branch-3.8.11
branch-3.9
branch-3.9.2
branch-3.10
branch-3.11-matchinfo
branch-3.11
branch-3.12.0
branch-3.14
branch-3.15
branch-3.16
branch-3.17
branch-3.18
branch-3.19
branch-3.20
branch-3.21
branch-3.22
branch-3.23
branch_3_2
branch_3_3_13
branch_3_3_17
branch_3_6_6
branch_3_6_14
branch_3_6_16
broken-build
broken-on-arm
bswap-functions
btree-balance-bias
btree-column-opcode
btree-current-page-cache
btree-debug
btree-fordelete-flag
btree-moveto-neighbor
btree-opt
btree-opt2
btree-optimization
btree-refactor
btree-speedup
btree-tuning
bug-5d863f87
bug-b351d95f9c
buggy-lemon
builtin-bswap64
busy-timeout-pragma
cache-stats
cache_spill=N
cache_spill
cacheflush
callbackConv
calloc
carray_asc
cell-overwrite-prototype
cell-size-check-pragma
changebatch
checkindex
checkpoint-truncate
clear-subtype-fail
clear-subtype-flag
cli-char-width
codecless-inmemory-subjournal
collseq-checking
column-cache-debug
column-usage-hint
combine-disjuncts
common-table-expr
compile_opts
compiler-compat
compound-order-by-fix
configReadOnly
connect-by
constant-refactoring-in-triggers
constraint-error-codes
coroutine-autoindex
coroutine-refactor
corrupt-schema
covering-index-on-expr
covering-index
covering-or
create-table-as-type-fix
csv_ext
cte-via-queue
ctime-refactor
ctimeCompiler
cumulative-progress-count
cursor-hints-displayP4
cursor-hints
cygDirSep
cygDlOpen
cygUtf8
cygwinTempPath
data_version_pragma
date-overflow-fix
db-readonly-api
dbconfig-prepare-flags
dbconfig_maindbname
dbdump
dbgTestFixture
dbhash
dbpage
dbstat-in-amalgamation
dbstatus-cache-spill
dbstatus-prop-cache-used
dead-end
deadend
debug-loopcounters
debug
default-synchronous-fix
default-synchronous
defer-where-subqueries
deferred-close-order
deferred-close
deferred-fk-quirk
deferred-open
defrag-opt
defragmentpage-opt
degenerate_IN
delete-without-rowid-opt
desc-orderby-fix-1
detect-moved-db
dev
disable-restrict
disable-vtab
disposable-vtable
distinct-early-out
dll-build-fix
doc-type
docTypo
does-not-work
drop-win9x-support
dropViewNoStat
dump-recovery
early-column-names
early-vector-size-check
edit-trigger-wrapper
einval-from-fallocate
enable-QPSG
enhanced-mem-check
errCodes
est-count-pragma-vtab
est_count_pragma
ex-robust-open
excel-shell-cmd
exp-agg-opt
exp-avoid-expensive-skipscan
exp-begin-concurrent-pnu
exp-busy-snapshot-fix
exp-dbreset-fix
exp-indexed-clause
exp-retry-atomic-commit
exp-snapshot-open
exp-window-functions
expShell
experimental-autoindex-fix
experimental-costs
experimental-fk-actions
experimental-mmap
experimental-namelist
experimental-pcache
experimental
experimentalIoLog
expert-in-shell
expr-codegen-enhancement
expr-simplify
expr-tuning
extRefactor
extra-testcase-macros
f2fs-test-fixes
factor-constant-funcs
failed-dropCell-opt
failed-optimization
fast-secure-delete
faster-OP_Column
faster-analyze
faster-order-by-limit
faster-pcache1-fetch
faster-typeof-and-length
fcntl_shm_read
file-control-journal
file-control-pragma
filesize-debug
five-digit-year
fix-stale-keyinfo-cache
fkc-missing-parent-tables
fkey-missing-indexes
fkey-optimization
flattener-column-names
flattener-in-new-file
floating-point-conversions
follow-symlinks
fordelete-assert
foreign-key-check
fsDirFix
fsVfsWin
fts-languageid-bits
fts3-changes
fts3-experimental
fts3-expr-rebalance
fts3-int-cursor
fts3-matchinfo-y
fts3-prefix-query-fix
fts3-prefix-search
fts3-refactor
fts3-seekstmt-cache
fts4-auto-incr-merge
fts4-content
fts4-docid-range-constraints
fts4-experimental
fts4-incr-merge-exp
fts4-incr-merge
fts4-languageid
fts4-notindexed
fts4-unicode
fts4aux
fts5-btree-index
fts5-data-version
fts5-incompatible
fts5-offsets
fts5-perf
fts5-snippet-bias
fts5Msvc
fts5NoWarn
fts5
ftsWarnings
fullscan-covering-index
funcTestEncoding
function-ctx-cache
fuzzcheck
generalize-interrupt
geojson
get-trace
gnu-safe-math
group-by-name-resolution
having-where-optimization
hex-literal
hidden-columns-in-tables
hp-optimizer-fix
icc-fix
ieee754-func
ieee754
improved-index-scan
improved-integrity-check
improved-update
in-scan-vs-index
incr-vacuum-opt
increased-sorting-cost
index-expr
index-info-on-table
index-is-operator
index-on-date-func
index-scan-rate
index-shape-1
index_xinfo
indexList
infinite-with-loop-bug
initmode-testctrl
inner-loop-cost
insert-optimization
insert-select-opt
instr
int-float-compare
int-float-precision
integrity-check-heap
integrity-check-improvements
integrity-check-refactor
interruptible-checkpoint
io-opt
is-distinct-from
is-true-operator
join-strength-reduction
json-fuzz
json_mergepatch
json_quote
json
kv-access-opt-demo
kvtest
left-join-fix
left-join-omit-fix
left-join-optimization
left-join-view
leftjoin-or-fix
lemon-improvements
lemon-update-2010
lemon-update
lemon-updates
level-pseudocolumn
like-compare-opt
like-opt-fix
limit-printf-width
linear-interpolation
linenoise
list-pragmas
load-ext-security
load-permanently
loadext
location-function
log-stats
lowlevel-lock-timeout
lsm-metapage-fix
lsm-vtab
malformed-vtab-name
malloc-enhancement
malloc-testing
many-VALUEs
many-app-functions
master-journal-temp-files
master
materialized-view-reuse
max-memory-option
mbcs-shell
memTests
memdb-opt
memdb-warning
memdb
memjournal-exp
memleak
memsys5-performance
merge-sort
micro-optimizations
mingw4x
minmax-opt
missing-journal-file
mistake
mksourceid
mmap-experimental
mmap-size-limit
mmap-wal-bigtrans
mmap-warm
mmapDisabled
mp-releasetest
mptest
msvc2015
msvcDebug
msvcFixes
msvcMakeMin
msvcThreads
msvcW4
msvcWarn
msvcWarnings
multi-arg-pragma
multi-or-covering-index
multikey-opt-idea
multiplex-enhancements
multiplex-parallel-read
multithreaded-checks
mutex-free-pcache
mutex-free-randomness
mutexDbg
mutexDbg2
mutexInitCmpSwap
mutexInitIsInitReCheck
mutexInitSimpleCmpSwap
nVDestroy
name-resolution-fix
named-check-constraints
nested-agg
nextgen-query-plan-exp
nextgen-query-plan-fast
nextgen-query-plan-logcost
no-ckpt-on-close
no-overread
no-rowid-in-cte
noMemBkpt
noMemType
noTclLibs
noWarn
noWarnings
nonblocking-rollback
noop-update-reprepare
normalize
noskipscan-token
nx-devkit
ofd-locks
omit-awk
omit-column-cache
omit-fixes
omit-fstat-after-unlink
omit-join-table-opt
omit-left-join-fix
omit-rowid
omit-wal-fix
one-writable-btree
onepass-delete-or
onepass-delete
onepass-update
oom-handling
open-only-once
optimize-cellinfo
optimize-delete
optimize-vdbecursor
or-opt
or-optimization
orderby-fix
orderby-limit
orderby-planning
ota-update-no-pager_ota_mode
ota-update
output-minmax-row
overflow-pgno-cache
overwrite-avoidance
ovfloffset-macro
pagePerSector
pager-blockalloc
pager-dev
pager-get-method
pager-get-noinit
parser-enhancements
parser-performance
partial-index-variables
partial-indices
pass-pointer-as-blob
pattern-compare-optimization
pcache-bulk-local
pcache1-zero-page
permutations-fix
persistent-extensions
persistent-wal-patch
planner-fix
planner-improvements
pointer-types
pointer-with-destructor
popenMsvc
pragma-as-vtab
pragma-columncount-fix
pragma-noop-update
pragma-onconflict
pragma-table-ipk
pread
prefer-coroutine-sort-subquery
preload-pragma
prepare_v3
preupdate-without-rowid
printf-enhancement
printf-optimization
printf-sql-function
propagate-const-opt
prototype-int-array
pure-date-functions
push-down-backport
push-down-disable
pushdown-optimization
qp-enhancements
query-plan-experiments
query-planner-deadend
query-planner-fix
query-planner-tweaks
query_only
quota-stdio
rbu-delete-then-insert
rbu-percent-progress
rbu-state-api
rbu-vacuum
read-after-rollback
readonly-wal-recovery
recursive-selectdup
reduce-schema-size
reduced-thread-contention
regexp-span
regexp
releasetest-refactor
rememberFunc
reoptimizeArm
reorder-column-opcodes
replace-fix
require-write-txn
reset-database
retry-short-reads
reusable-pragma
reuse-schema
rework-EQP
row-size-est
rowvalue-update-trigger
rowvalue
rtree-32bit-rounding
rtree-blob-agressive-release
rtree-enhancements
rtree-geopoly
rtree-integrity-check
rtree-one-pass
rtree-queue
rtree-sqlite3_blob
rtree-update-optimization
rtreeErrMsg
safer-malloc
save_sorter_stmt
savepoint-rollback
scanstatus
schema-parse-refactor
schema-storage
schema2-vtab
schemalint-failure
schemalint
scrub-backup
see-testing
seek-eq
seekeq-experiment
select-trace
select-wildcard
separate-lock-mutex
serializable-snapshot
server-edition
server-process-edition
session-make
session-retry
sessions-3.7.14
sessions-diff
sessions-fix
sessions-rebase
sessions-stat1
sessions-value-dup
sessions_from_cli
sessions
set-last-insert-rowid
shared-cache-fix
shared-cache-fixes
shared-cache-memdb
shared-mapping-hack
shared-schema
shell-bindings
shell-fix
shell-print-refactor
shell-wall-clock
shm-mapping-fix
showdb-uri-option
shunning-error
simplify-or-clause
simplify
skip-ahead-distinct
skip-scan-improvement
skip-scan
smaller-expr
snapshot-cmp
snapshot-get
snapshots-lock-wal
sort-column-opcodes
sorter-coalesce-writes
sorter-exp
sorter-limit-opt
sorter-opt
sorter-reference
span-refactor
speedtest1
spellfix-constraints
spellfix-matchlen
split-moveto
sqlar-shell-support
sqldiff-changeset
sqldiff-vtab-support
sqlite-corrupt-page
sqlite_stat4
sqlite_system_errno
sqlite3_blob_reset
sqlite3_db_log
sqlite3ext-fix
sqlite3_kv
sqlite3rbu.h-fix
sqlite3_snapshot_describe
sqlite3_stmt_refresh
sqlite3_stmt_retryable
sqlite3_trace_v2
sqlite3_value_nochange
sqlite3_vtab_nochange
sqliteIntMacros
sqllog
ssdsim
stat-vtab-in-shell
stat1-max
stat2-enhancement
stat3-3.7.2
stat3-enhancement
stat3-trunk
stat4-avgeq
stat4-change
stat4-experimental
stat4-function
stat4-skipscan
stat4-without-rowid
status-vm-step
status64
statvfs
std-ext
stdcall-3.8.8
stdcall
stdint.h
step-autoreset
stmt-journal-testing
stmts-vtab
stmtstatus-memused
string-quoting-dump
subquery-as-coroutine
subquery-codegen-refactor
subquery-limit-opt
subquery-opt
subtypes
superlock
syscall-override
tabfunc-in-left-join
table-driven-pragma
table-valued-functions
tclMode
tclsqlite-cleanup
teaDoc
temp-page-size
tempfiles-25
tempfiles-lazy-open
test-bestindex
test-in-subdir
test-using-fuzzcheck
test_delete
testClean
testFixes
testFixtureSrc
testFsWin32
testerOutput
threads-closed
threads-experimental
threads-sort-ex1
threads
threadtest3
threadtest4
ticket-16c9801ce
ticket-71e333e7
ticket-bfbf38e5e9
tkt-002caede898
tkt-2f7170d7
tkt-5eaa61ea18
tkt-8c63ff0eca
tkt-2326c258
tkt-2500cdb9be
tkt-55746f9e
tkt-6709574
tkt-a7b7803e
tkt-a8a0d2996a
tkt-e39d0325
tkt-f97c4637
toTypeFuncs
tokenizer-char-class
toolWarnings
transaction-pages
transitive-constraints
translit-tokenizer
tree-explain
tree-stat1-fix
trigger-trace
trim-nulls
two-mappings
typo
unicode-function
uninit-vdbe-mem
union-vtab
unix-excl
unix-lock-fix-attempt
unix-vfs-optimization
unknown-function
unlikely-func
unordered-index-hack
unpack-opcode
unpacked-IdxInsert
unsetnull-option
update-delete-limit-fix
upsert-opt
upsert-opt2
upsert
uri-00-error
uri-enhancement
uri
user-auth
vacuum-attached-db
value-dup
vcreate-stmt
vdbe-aux-perf
vdbe-performance
vdbe_cycle_limit
vector-compare
vector-size-check
version-3.17.0-rbu-fixes
version_2
vfs-stdio
vfsname-filectrl
view-optimization
vs2013
vsix-3.7.13
vsix2013
vsix2015
vsixFlavor
vsixTest
vsixWin32
vsixWinPhone81
vtab-IN-opt
vtab-colused
vtab-conflict
vtab-experimental
vtab-extra-ops
vtab-func-constraint
vtab-left-join
vtab-like-operator
vtab-onepass
wal-blocking-lock
wal-header-sync
wal-incr-ckpt
wal-overwrite-frames
wal-read-change
wal-readonly
wal-refactor
wal-sync-refactor
wal-trace-372
wal-trace-375
wal-win32
wal
wal2
warnings
weak-fallback
win-check-dir
win10sdk
win32-none
win32-test-fixes
win32GetHandle
win32Resources
win32SetDir
win32dir
win32heap
win32nolock
winCeLocalTime
winCeWarn
winDisableMmap
winFileMapping
winGetLastError
winHdr
winHeapSize
winIoRetry
winLockHandle
winMmapNoWal
winMutex
winNativeHeap
winNotFound
winOsTrace
winPreCache
winSectorSize
winSyscall
winTest
winViewFlush
wince-fixes
wince
winopen-retry-logic
winrt
withdrawn
without-rowid-or-opt
without-rowid-vtab
word-fuzzer
wordcount-enhancement
writable-vtab-without-rowid
write-queue-flush-hack
xbestindex-fix
zDbSName
zero-base-aMem
zero-byte-backup-fix
zero-register
zipfile-timestamp-fix
zipvfs-multifile-commit
zonefile
Nothing to show
version-3.24.0
version-3.23.2
version-3.23.1
version-3.23.0
version-3.22.0
version-3.21.0
version-3.20.1
version-3.20.0
version-3.19.4
version-3.19.3
version-3.19.2
version-3.19.1
version-3.19.0
version-3.18.2
version-3.18.1
version-3.18.0
version-3.17.0
version-3.16.2
version-3.16.1
version-3.16.0
version-3.15.2
version-3.15.1
version-3.15.0
version-3.14.2
version-3.14.1
version-3.14.0
version-3.13.0
version-3.12.2
version-3.12.1
version-3.12.0
version-3.11.1
version-3.11.0
version-3.10.2
version-3.10.1
version-3.10.0
version-3.9.3
version-3.9.2
version-3.9.1
version-3.9.0
version-3.8.11.1
version-3.8.11
version-3.8.10.2
version-3.8.10.1
version-3.8.10
version-3.8.9
version-3.8.8.3
version-3.8.8.2
version-3.8.8.1
version-3.8.8
version-3.8.7.4
version-3.8.7.3
version-3.8.7.2
version-3.8.7.1
version-3.8.7
version-3.8.6.1
version-3.8.6
version-3.8.5
version-3.8.4.3
version-3.8.4.2
version-3.8.4.1
version-3.8.4
version-3.8.3.1
version-3.8.3
version-3.8.2
version-3.8.1
version-3.8.0.2
version-3.8.0.1
version-3.8.0
version-3.7.17
version-3.7.16.2
version-3.7.16.1
version-3.7.16
version-3.7.15.2
version-3.7.15.1
version-3.7.15
version-3.7.14.1
version-3.7.14
version-3.7.13
version-3.7.12.1
version-3.7.12
version-3.7.11
version-3.7.10
version-3.7.9
version-3.7.8
version-3.7.7.1
version-3.7.7
version-3.7.6.3
version-3.7.6.2
version-3.7.6.1
version-3.7.6
version-3.7.5
version-3.7.4
version-3.7.2
version-3.6.15
version-3.6.10
release
mountain-lion
fts3-refactor
experimental
cvs-to-fossil-cutover
Nothing to show
Find file
Copy path
Fetching contributors…
| /* | |
| ** 2001 September 16 | |
| ** | |
| ** The author disclaims copyright to this source code. In place of | |
| ** a legal notice, here is a blessing: | |
| ** | |
| ** May you do good and not evil. | |
| ** May you find forgiveness for yourself and forgive others. | |
| ** May you share freely, never taking more than you give. | |
| ** | |
| ****************************************************************************** | |
| ** | |
| ** This header file (together with is companion C source-code file | |
| ** "os.c") attempt to abstract the underlying operating system so that | |
| ** the SQLite library will work on both POSIX and windows systems. | |
| ** | |
| ** This header file is #include-ed by sqliteInt.h and thus ends up | |
| ** being included by every source file. | |
| */ | |
| #ifndef _SQLITE_OS_H_ | |
| #define _SQLITE_OS_H_ | |
| /* | |
| ** Attempt to automatically detect the operating system and setup the | |
| ** necessary pre-processor macros for it. | |
| */ | |
| #include "os_setup.h" | |
| /* If the SET_FULLSYNC macro is not defined above, then make it | |
| ** a no-op | |
| */ | |
| #ifndef SET_FULLSYNC | |
| # define SET_FULLSYNC(x,y) | |
| #endif | |
| /* | |
| ** The default size of a disk sector | |
| */ | |
| #ifndef SQLITE_DEFAULT_SECTOR_SIZE | |
| # define SQLITE_DEFAULT_SECTOR_SIZE 4096 | |
| #endif | |
| /* | |
| ** Temporary files are named starting with this prefix followed by 16 random | |
| ** alphanumeric characters, and no file extension. They are stored in the | |
| ** OS's standard temporary file directory, and are deleted prior to exit. | |
| ** If sqlite is being embedded in another program, you may wish to change the | |
| ** prefix to reflect your program's name, so that if your program exits | |
| ** prematurely, old temporary files can be easily identified. This can be done | |
| ** using -DSQLITE_TEMP_FILE_PREFIX=myprefix_ on the compiler command line. | |
| ** | |
| ** 2006-10-31: The default prefix used to be "sqlite_". But then | |
| ** Mcafee started using SQLite in their anti-virus product and it | |
| ** started putting files with the "sqlite" name in the c:/temp folder. | |
| ** This annoyed many windows users. Those users would then do a | |
| ** Google search for "sqlite", find the telephone numbers of the | |
| ** developers and call to wake them up at night and complain. | |
| ** For this reason, the default name prefix is changed to be "sqlite" | |
| ** spelled backwards. So the temp files are still identified, but | |
| ** anybody smart enough to figure out the code is also likely smart | |
| ** enough to know that calling the developer will not help get rid | |
| ** of the file. | |
| */ | |
| #ifndef SQLITE_TEMP_FILE_PREFIX | |
| # define SQLITE_TEMP_FILE_PREFIX "etilqs_" | |
| #endif | |
| /* | |
| ** The following values may be passed as the second argument to | |
| ** sqlite3OsLock(). The various locks exhibit the following semantics: | |
| ** | |
| ** SHARED: Any number of processes may hold a SHARED lock simultaneously. | |
| ** RESERVED: A single process may hold a RESERVED lock on a file at | |
| ** any time. Other processes may hold and obtain new SHARED locks. | |
| ** PENDING: A single process may hold a PENDING lock on a file at | |
| ** any one time. Existing SHARED locks may persist, but no new | |
| ** SHARED locks may be obtained by other processes. | |
| ** EXCLUSIVE: An EXCLUSIVE lock precludes all other locks. | |
| ** | |
| ** PENDING_LOCK may not be passed directly to sqlite3OsLock(). Instead, a | |
| ** process that requests an EXCLUSIVE lock may actually obtain a PENDING | |
| ** lock. This can be upgraded to an EXCLUSIVE lock by a subsequent call to | |
| ** sqlite3OsLock(). | |
| */ | |
| #define NO_LOCK 0 | |
| #define SHARED_LOCK 1 | |
| #define RESERVED_LOCK 2 | |
| #define PENDING_LOCK 3 | |
| #define EXCLUSIVE_LOCK 4 | |
| /* | |
| ** File Locking Notes: (Mostly about windows but also some info for Unix) | |
| ** | |
| ** We cannot use LockFileEx() or UnlockFileEx() on Win95/98/ME because | |
| ** those functions are not available. So we use only LockFile() and | |
| ** UnlockFile(). | |
| ** | |
| ** LockFile() prevents not just writing but also reading by other processes. | |
| ** A SHARED_LOCK is obtained by locking a single randomly-chosen | |
| ** byte out of a specific range of bytes. The lock byte is obtained at | |
| ** random so two separate readers can probably access the file at the | |
| ** same time, unless they are unlucky and choose the same lock byte. | |
| ** An EXCLUSIVE_LOCK is obtained by locking all bytes in the range. | |
| ** There can only be one writer. A RESERVED_LOCK is obtained by locking | |
| ** a single byte of the file that is designated as the reserved lock byte. | |
| ** A PENDING_LOCK is obtained by locking a designated byte different from | |
| ** the RESERVED_LOCK byte. | |
| ** | |
| ** On WinNT/2K/XP systems, LockFileEx() and UnlockFileEx() are available, | |
| ** which means we can use reader/writer locks. When reader/writer locks | |
| ** are used, the lock is placed on the same range of bytes that is used | |
| ** for probabilistic locking in Win95/98/ME. Hence, the locking scheme | |
| ** will support two or more Win95 readers or two or more WinNT readers. | |
| ** But a single Win95 reader will lock out all WinNT readers and a single | |
| ** WinNT reader will lock out all other Win95 readers. | |
| ** | |
| ** The following #defines specify the range of bytes used for locking. | |
| ** SHARED_SIZE is the number of bytes available in the pool from which | |
| ** a random byte is selected for a shared lock. The pool of bytes for | |
| ** shared locks begins at SHARED_FIRST. | |
| ** | |
| ** The same locking strategy and | |
| ** byte ranges are used for Unix. This leaves open the possibility of having | |
| ** clients on win95, winNT, and unix all talking to the same shared file | |
| ** and all locking correctly. To do so would require that samba (or whatever | |
| ** tool is being used for file sharing) implements locks correctly between | |
| ** windows and unix. I'm guessing that isn't likely to happen, but by | |
| ** using the same locking range we are at least open to the possibility. | |
| ** | |
| ** Locking in windows is manditory. For this reason, we cannot store | |
| ** actual data in the bytes used for locking. The pager never allocates | |
| ** the pages involved in locking therefore. SHARED_SIZE is selected so | |
| ** that all locks will fit on a single page even at the minimum page size. | |
| ** PENDING_BYTE defines the beginning of the locks. By default PENDING_BYTE | |
| ** is set high so that we don't have to allocate an unused page except | |
| ** for very large databases. But one should test the page skipping logic | |
| ** by setting PENDING_BYTE low and running the entire regression suite. | |
| ** | |
| ** Changing the value of PENDING_BYTE results in a subtly incompatible | |
| ** file format. Depending on how it is changed, you might not notice | |
| ** the incompatibility right away, even running a full regression test. | |
| ** The default location of PENDING_BYTE is the first byte past the | |
| ** 1GB boundary. | |
| ** | |
| */ | |
| #ifdef SQLITE_OMIT_WSD | |
| # define PENDING_BYTE (0x40000000) | |
| #else | |
| # define PENDING_BYTE sqlite3PendingByte | |
| #endif | |
| #define RESERVED_BYTE (PENDING_BYTE+1) | |
| #define SHARED_FIRST (PENDING_BYTE+2) | |
| #define SHARED_SIZE 510 | |
| /* | |
| ** Wrapper around OS specific sqlite3_os_init() function. | |
| */ | |
| int sqlite3OsInit(void); | |
| /* | |
| ** Functions for accessing sqlite3_file methods | |
| */ | |
| int sqlite3OsClose(sqlite3_file*); | |
| int sqlite3OsRead(sqlite3_file*, void*, int amt, i64 offset); | |
| int sqlite3OsWrite(sqlite3_file*, const void*, int amt, i64 offset); | |
| int sqlite3OsTruncate(sqlite3_file*, i64 size); | |
| int sqlite3OsSync(sqlite3_file*, int); | |
| int sqlite3OsFileSize(sqlite3_file*, i64 *pSize); | |
| int sqlite3OsLock(sqlite3_file*, int); | |
| int sqlite3OsUnlock(sqlite3_file*, int); | |
| int sqlite3OsCheckReservedLock(sqlite3_file *id, int *pResOut); | |
| int sqlite3OsFileControl(sqlite3_file*,int,void*); | |
| void sqlite3OsFileControlHint(sqlite3_file*,int,void*); | |
| #define SQLITE_FCNTL_DB_UNCHANGED 0xca093fa0 | |
| int sqlite3OsSectorSize(sqlite3_file *id); | |
| int sqlite3OsDeviceCharacteristics(sqlite3_file *id); | |
| int sqlite3OsShmMap(sqlite3_file *,int,int,int,void volatile **); | |
| int sqlite3OsShmLock(sqlite3_file *id, int, int, int); | |
| void sqlite3OsShmBarrier(sqlite3_file *id); | |
| int sqlite3OsShmUnmap(sqlite3_file *id, int); | |
| int sqlite3OsFetch(sqlite3_file *id, i64, int, void **); | |
| int sqlite3OsUnfetch(sqlite3_file *, i64, void *); | |
| /* | |
| ** Functions for accessing sqlite3_vfs methods | |
| */ | |
| int sqlite3OsOpen(sqlite3_vfs *, const char *, sqlite3_file*, int, int *); | |
| int sqlite3OsDelete(sqlite3_vfs *, const char *, int); | |
| int sqlite3OsAccess(sqlite3_vfs *, const char *, int, int *pResOut); | |
| int sqlite3OsFullPathname(sqlite3_vfs *, const char *, int, char *); | |
| #ifndef SQLITE_OMIT_LOAD_EXTENSION | |
| void *sqlite3OsDlOpen(sqlite3_vfs *, const char *); | |
| void sqlite3OsDlError(sqlite3_vfs *, int, char *); | |
| void (*sqlite3OsDlSym(sqlite3_vfs *, void *, const char *))(void); | |
| void sqlite3OsDlClose(sqlite3_vfs *, void *); | |
| #endif /* SQLITE_OMIT_LOAD_EXTENSION */ | |
| int sqlite3OsRandomness(sqlite3_vfs *, int, char *); | |
| int sqlite3OsSleep(sqlite3_vfs *, int); | |
| int sqlite3OsCurrentTimeInt64(sqlite3_vfs *, sqlite3_int64*); | |
| /* | |
| ** Convenience functions for opening and closing files using | |
| ** sqlite3_malloc() to obtain space for the file-handle structure. | |
| */ | |
| int sqlite3OsOpenMalloc(sqlite3_vfs *, const char *, sqlite3_file **, int,int*); | |
| int sqlite3OsCloseFree(sqlite3_file *); | |
| #endif /* _SQLITE_OS_H_ */ |
Copy lines Copy permalink - View git blame