5 #pragma GCC diagnostic ignored "-Wcast-qual" 6 #pragma GCC diagnostic ignored "-Wmissing-field-initializers" 7 #pragma GCC diagnostic ignored "-Wunused-function" 8 #pragma GCC diagnostic ignored "-Wunused-parameter" 9 #pragma GCC diagnostic ignored "-Wunused-variable" 12 #pragma clang diagnostic ignored "-Wunused-value" 13 #pragma clang diagnostic ignored "-Wc++11-narrowing" 15 #pragma GCC diagnostic ignored "-Wunused-but-set-variable" 21 #define SQLITE_OPEN_WAL 0x00080000 22 #define SQLITE_FCNTL_SIZE_HINT 5 23 #define SQLITE_FCNTL_CHUNK_SIZE 6 24 #define SQLITE_FCNTL_SYNC_OMITTED 8 26 #define SQLITE_FCNTL_DB_UNCHANGED 0xca093fa0 27 #define SQLITE_DEFAULT_SECTOR_SIZE 512 29 #define UNUSED_PARAMETER(x) (void)(x) 30 #define UNUSED_PARAMETER2(x, y) UNUSED_PARAMETER(x), UNUSED_PARAMETER(y) 32 #define ArraySize(X) ((int)(sizeof(X) / sizeof(X[0]))) 34 typedef sqlite_int64
i64;
37 #define _FILE_OFFSET_BITS 64 38 #define _LARGEFILE_SOURCE 1 44 #ifndef TKEYVFS_NO_ROOT 47 #endif // TKEYVFS_NO_ROOT 60 #include <sys/types.h> 69 #define TKEYVFS_TRACE 0 75 #ifndef TKEYVFS_NO_ROOT 77 #endif // TKEYVFS_NO_ROOT 88 #define MAX_PATHNAME 512 90 #define SQLITE_TEMP_FILE_PREFIX "etilqs_" 98 #ifndef TKEYVFS_NO_ROOT 101 #endif // TKEYVFS_NO_ROOT 127 #define O_LARGEFILE 0 129 #ifdef SQLITE_DISABLE_LFS 131 #define O_LARGEFILE 0 141 typedef void (*sqlite3_syscall_ptr)(void);
160 static int unixRead(sqlite3_file*
id,
169 static int unixSync(sqlite3_file*
id,
int flags);
171 static int nolockLock(sqlite3_file* NotUsed,
int NotUsed2);
172 static int nolockUnlock(sqlite3_file* NotUsed,
int NotUsed2);
178 static int unixOpen(sqlite3_vfs* pVfs,
183 static int unixDelete(sqlite3_vfs* NotUsed,
const char*
zPath,
int dirSync);
192 static void*
unixDlOpen(sqlite3_vfs* NotUsed,
const char* zFilename);
193 static void unixDlError(sqlite3_vfs* NotUsed,
int nBuf,
char* zBufOut);
194 static void (*
unixDlSym(sqlite3_vfs* NotUsed,
void*
p,
const char* zSym))(void);
195 static void unixDlClose(sqlite3_vfs* NotUsed,
void* pHandle);
196 static int unixRandomness(sqlite3_vfs* NotUsed,
int nBuf,
char* zBuf);
197 static int unixSleep(sqlite3_vfs* NotUsed,
int microseconds);
199 static int unixGetLastError(sqlite3_vfs* NotUsed,
int NotUsed2,
char* NotUsed3);
203 sqlite3_syscall_ptr pNewFunc);
212 "tkeyvfs.c: cannot open file at line %d of [%.10s]",
214 20 + sqlite3_sourceid());
215 return SQLITE_CANTOPEN;
217 #define SQLITE_CANTOPEN_BKPT sqlite3CantopenError(__LINE__) 237 return 0x3fffffff & (
int)(z2 - z);
251 {
"open", (sqlite3_syscall_ptr)
open, 0},
254 {
"close", (sqlite3_syscall_ptr)close, 0},
257 {
"access", (sqlite3_syscall_ptr)
access, 0},
260 {
"getcwd", (sqlite3_syscall_ptr)getcwd, 0},
263 {
"stat", (sqlite3_syscall_ptr)
stat, 0},
274 #define osFstat(a, b, c) 0 276 {
"fstat", (sqlite3_syscall_ptr)fstat, 0},
280 {
"ftruncate", (sqlite3_syscall_ptr)ftruncate, 0},
283 {
"fcntl", (sqlite3_syscall_ptr)fcntl, 0},
286 {
"read", (sqlite3_syscall_ptr)read, 0},
289 #
if defined(USE_PREAD)
290 {
"pread", (sqlite3_syscall_ptr)pread, 0},
292 {
"pread", (sqlite3_syscall_ptr)0, 0},
296 #
if defined(USE_PREAD64)
297 {
"pread64", (sqlite3_syscall_ptr)pread64, 0},
299 {
"pread64", (sqlite3_syscall_ptr)0, 0},
303 {
"write", (sqlite3_syscall_ptr)write, 0},
306 #
if defined(USE_PREAD)
307 {
"pwrite", (sqlite3_syscall_ptr)pwrite, 0},
309 {
"pwrite", (sqlite3_syscall_ptr)0, 0},
314 #
if defined(USE_PREAD64)
315 {
"pwrite64", (sqlite3_syscall_ptr)pwrite64, 0},
317 {
"pwrite64", (sqlite3_syscall_ptr)0, 0},
322 {
"fchmod", (sqlite3_syscall_ptr)0, 0},
325 #
if defined(HAVE_POSIX_FALLOCATE) && HAVE_POSIX_FALLOCATE
326 {
"fallocate", (sqlite3_syscall_ptr)posix_fallocate, 0},
328 {
"fallocate", (sqlite3_syscall_ptr)0, 0},
356 static const sqlite3_io_methods*
368 typedef const sqlite3_io_methods* (*finder_type)(
const char*,
unixFile*);
386 #define unixLogError(a, b, c) unixLogErrorAtLine(a, b, c, __LINE__) 396 zErr = strerror(iErrno);
401 "tkeyvfs.c:%d: (%d) %s(%s) - %s",
418 fprintf(
stderr,
"Begin robust_open ...\n");
422 }
while (rc < 0 && errno == EINTR);
424 fprintf(
stderr,
"End robust_open ...\n");
447 fprintf(
stderr,
"Begin robust_close ...\n");
457 fprintf(
stderr,
"End robust_close ...\n");
477 fprintf(
stderr,
"Begin closeUnixFile ...\n");
481 #ifndef TKEYVFS_NO_ROOT 483 #endif // TKEYVFS_NO_ROOT 485 #ifndef TKEYVFS_NO_ROOT 490 stderr,
"fileSize: 0x%016lx\n", (
unsigned long long)pFile->
fileSize);
494 TKey*
k =
new TKey(pFile->
zPath,
495 "sqlite3 database file",
501 Int_t objlen = k->GetObjlen();
502 fprintf(
stderr,
"objlen: %d\n", objlen);
506 Int_t cycle = pFile->
rootFile->AppendKey(k);
508 char*
p = k->GetBuffer();
510 (
void*)memcpy((
void*)
p, (
void*)pFile->
pBuf, (
size_t)pFile->
fileSize);
514 Int_t cnt = k->WriteFile(cycle, 0 );
518 "tkeyvfs: failed to write root tkey containing database " 523 cnt = pFile->
rootFile->Write(
"", TObject::kOverwrite);
526 fprintf(
stderr,
"tkeyvfs: failed to write root file to disk!\n");
529 #endif // TKEYVFS_NO_ROOT 530 if (pFile->
pBuf !=
nullptr) {
533 if (pFile->
zPath !=
nullptr) {
534 free((
void*)pFile->
zPath);
538 fprintf(
stderr,
"End closeUnixFile ...\n");
551 static const unsigned char zChars[] =
"abcdefghijklmnopqrstuvwxyz" 552 "ABCDEFGHIJKLMNOPQRSTUVWXYZ" 556 fprintf(
stderr,
"Begin unixGetTempname ...\n");
564 fprintf(
stderr,
"End unixGetTempname ...\n");
569 j = (
int)strlen(zBuf);
570 sqlite3_randomness(15, &zBuf[j]);
571 for (i = 0; i < 15; i++, j++) {
572 zBuf[j] = (char)zChars[((
unsigned char)zBuf[j]) % (
sizeof(zChars) - 1)];
576 fprintf(
stderr,
"End unixGetTempname ...\n");
594 fprintf(
stderr,
"Begin fcntlSizeHint ...\n");
603 char* pNewBuf = (
char*)realloc((
void*)pFile->
pBuf, (size_t)nAlloc);
604 if (pNewBuf ==
nullptr) {
607 fprintf(
stderr,
"End fcntlSizeHint ...\n");
609 return SQLITE_IOERR_WRITE;
613 pFile->
pBuf = pNewBuf;
623 fprintf(
stderr,
"End fcntlSizeHint ...\n");
646 fprintf(
stderr,
"Begin seekAndRead ...\n");
651 fprintf(
stderr,
"End seekAndRead ...\n");
655 if ((offset + cnt) > id->
fileSize) {
656 cnt = (offset + cnt) - id->
fileSize;
658 (
void*)memcpy(pBuf, (
const void*)(
id->pBuf +
offset), (
size_t)cnt);
660 fprintf(
stderr,
"End seekAndRead ...\n");
677 fprintf(
stderr,
"Begin seekAndWrite ...\n");
682 nByte = offset + ((
i64)cnt);
689 char* pNewBuf = (
char*)realloc((
void*)
id->pBuf, (size_t)(newBufSize));
690 if (pNewBuf ==
nullptr) {
691 id->lastErrno = errno;
693 fprintf(
stderr,
"End seekAndWrite ...\n");
697 if ((offset + (
i64)cnt) < newBufSize) {
698 i64 zeroCnt = newBufSize - (offset + (
i64)cnt);
699 (
void*)memset((
void*)(pNewBuf + offset + (
i64)cnt), 0, (size_t)zeroCnt);
702 id->bufAllocated = newBufSize;
704 (
void*)memcpy((
void*)(
id->pBuf +
offset), pBuf, (
size_t)cnt);
706 id->fileSize = offset + (
i64)cnt;
709 fprintf(
stderr,
"End seekAndWrite ...\n");
722 fprintf(
stderr,
"Begin nolockClose ...\n");
726 fprintf(
stderr,
"End nolockClose ...\n");
742 fprintf(
stderr,
"Begin unixRead ...\n");
747 stderr,
"offset: 0x%016lx amt: 0x%08x\n", (
unsigned long long)offset, amt);
753 fprintf(
stderr,
"End unixRead ...\n");
756 }
else if (got < 0) {
759 fprintf(
stderr,
"End unixRead ...\n");
761 return SQLITE_IOERR_READ;
765 memset(&((
char*)pBuf)[got], 0, amt - got);
767 fprintf(
stderr,
"End unixRead ...\n");
769 return SQLITE_IOERR_SHORT_READ;
783 fprintf(
stderr,
"Begin unixWrite ...\n");
788 stderr,
"offset: 0x%016lx amt: 0x%08x\n", (
unsigned long long)offset, amt);
798 if ((offset <= 24) && (offset + amt >= 27)) {
802 if (rc != 4 || memcmp(oldCntr, &((
char*)pBuf)[24 - offset], 4) != 0) {
807 while ((amt > 0) && ((wrote =
seekAndWrite(pFile, offset, pBuf, amt)) > 0)) {
810 pBuf = &((
char*)pBuf)[wrote];
816 fprintf(
stderr,
"End unixWrite ...\n");
818 return SQLITE_IOERR_WRITE;
822 fprintf(
stderr,
"End unixWrite ...\n");
828 fprintf(
stderr,
"End unixWrite ...\n");
842 fprintf(
stderr,
"Begin unixTruncate ...\n");
846 fprintf(
stderr,
"nByte: 0x%016lx\n", (
unsigned long long)nByte);
859 if (pFile->
pBuf ==
nullptr) {
864 fprintf(
stderr,
"End unixTruncate ...\n");
873 i64 zeroCnt = newBufSize - nByte;
874 char* pNewBuf = (
char*)realloc((
void*)pFile->
pBuf, (size_t)newBufSize);
875 if (pNewBuf ==
nullptr) {
878 fprintf(
stderr,
"End unixTruncate ...\n");
882 (
void*)memset((
void*)(pNewBuf + nByte), 0, (
size_t)zeroCnt);
883 pFile->
pBuf = pNewBuf;
898 fprintf(
stderr,
"End unixTruncate ...\n");
923 fprintf(
stderr,
"Begin unixSync ...\n");
929 fprintf(
stderr,
"End unixSync ...\n");
942 fprintf(
stderr,
"Begin unixFileSize ...\n");
958 fprintf(
stderr,
"End unixFileSize ...\n");
969 fprintf(
stderr,
"Begin nolockLock ...\n");
975 fprintf(
stderr,
"End nolockLock ...\n");
986 fprintf(
stderr,
"Begin nolockUnlock ...\n");
992 fprintf(
stderr,
"End nolockUnlock ...\n");
1002 fprintf(
stderr,
"Begin nolockCheckReservedLock ...\n");
1009 fprintf(
stderr,
"End nolockCheckReservedLock ...\n");
1022 fprintf(
stderr,
"Begin unixFileControl ...\n");
1028 case SQLITE_FCNTL_LOCKSTATE: {
1031 fprintf(
stderr,
"op: LOCKSTATE\n");
1036 fprintf(
stderr,
"End unixFileControl ...\n");
1040 case SQLITE_LAST_ERRNO: {
1043 fprintf(
stderr,
"op: LAST_ERRNO\n");
1047 fprintf(
stderr,
"End unixFileControl ...\n");
1054 fprintf(
stderr,
"op: CHUNK_SIZE\n");
1055 fprintf(
stderr,
"szChunk: %d\n", *(
int*)pArg);
1057 ((
unixFile*)
id)->szChunk = *(
int*)pArg;
1059 fprintf(
stderr,
"End unixFileControl ...\n");
1066 fprintf(
stderr,
"op: SIZE_HINT\n");
1067 fprintf(
stderr,
"hint: 0x%016lx\n", *(
i64*)pArg);
1071 fprintf(
stderr,
"End unixFileControl ...\n");
1083 fprintf(
stderr,
"op: DB_UNCHANGED\n");
1087 fprintf(
stderr,
"End unixFileControl ...\n");
1094 fprintf(
stderr,
"op: SYNC_OMITTED\n");
1095 fprintf(
stderr,
"End unixFileControl ...\n");
1101 fprintf(
stderr,
"End unixFileControl ...\n");
1103 return SQLITE_NOTFOUND;
1121 fprintf(
stderr,
"Begin unixSectorSize ...\n");
1124 fprintf(
stderr,
"End unixSectorSize ...\n");
1137 fprintf(
stderr,
"Begin unixDeviceCharacteristics ...\n");
1140 fprintf(
stderr,
"End unixDeviceCharacteristics ...\n");
1173 sqlite3_file* pFile,
1179 int eType = flags & 0xFFFFFF00;
1182 int isDelete = (flags & SQLITE_OPEN_DELETEONCLOSE);
1183 int isCreate = (flags & SQLITE_OPEN_CREATE);
1184 int isReadonly = (flags & SQLITE_OPEN_READONLY);
1185 int isReadWrite = (flags & SQLITE_OPEN_READWRITE);
1187 const char* zName =
zPath;
1189 fprintf(
stderr,
"Begin unixOpen ...\n");
1190 if (zPath !=
nullptr) {
1191 fprintf(
stderr,
"filename: %s\n", zPath);
1200 if (rc != SQLITE_OK) {
1205 if (zName !=
nullptr) {
1206 p->
zPath = (
char*)malloc(strlen(zName) + 1);
1207 if (p->
zPath !=
nullptr) {
1208 (
void*)strcpy((
char*)p->
zPath, zName);
1213 #ifndef TKEYVFS_NO_ROOT 1215 if (eType & SQLITE_OPEN_MAIN_DB) {
1220 (eType & SQLITE_OPEN_MAIN_DB) && (isCreate || isReadWrite) && !isDelete);
1221 #endif // TKEYVFS_NO_ROOT 1222 if ((eType & SQLITE_OPEN_MAIN_DB) && !isCreate) {
1226 #ifndef TKEYVFS_NO_ROOT 1227 Bool_t status = kFALSE;
1236 status = k->ReadFile();
1240 fprintf(
stderr,
"End unixOpen ...\n");
1246 pKeyBuf = k->GetBuffer();
1248 nBytes = k->GetObjlen();
1252 p->
pBuf = (
char*)malloc((
size_t)nAlloc);
1253 #else // TKEYVFS_NO_ROOT 1258 #endif // TKEYVFS_NO_ROOT 1259 if (p->
pBuf ==
nullptr) {
1262 fprintf(
stderr,
"End unixOpen ...\n");
1267 #ifndef TKEYVFS_NO_ROOT 1270 (
void*)memcpy(p->
pBuf, pKeyBuf, (
size_t)nBytes);
1271 #endif // TKEYVFS_NO_ROOT 1277 if (p->
pBuf ==
nullptr) {
1280 fprintf(
stderr,
"End unixOpen ...\n");
1290 fprintf(
stderr,
"End unixOpen ...\n");
1308 fprintf(
stderr,
"Begin unixDelete ...\n");
1309 if (
zPath !=
nullptr) {
1314 fprintf(
stderr,
"End unixDelete ...\n");
1339 fprintf(
stderr,
"Begin unixAccess ...\n");
1340 if (
zPath !=
nullptr) {
1345 case SQLITE_ACCESS_EXISTS:
1348 fprintf(
stderr,
"op: SQLITE_ACCESS_EXISTS\n");
1352 case SQLITE_ACCESS_READWRITE:
1355 fprintf(
stderr,
"op: SQLITE_ACCESS_READWRITE\n");
1357 amode = W_OK | R_OK;
1359 case SQLITE_ACCESS_READ:
1362 fprintf(
stderr,
"op: SQLITE_ACCESS_READ\n");
1367 assert(!
"Invalid flags argument");
1371 fprintf(
stderr,
"End unixAccess ...\n");
1394 fprintf(
stderr,
"Begin unixFullPathName ...\n");
1395 if (zPath !=
nullptr) {
1396 fprintf(
stderr,
"filename: %s\n", zPath);
1401 zOut[nOut - 1] =
'\0';
1402 sqlite3_snprintf(nOut, zOut,
"%s", zPath);
1404 fprintf(
stderr,
"End unixFullPathName ...\n");
1418 fprintf(
stderr,
"Begin unixFullPathName ...\n");
1420 void*
p = dlopen(zFilename, RTLD_NOW | RTLD_GLOBAL);
1422 fprintf(
stderr,
"End unixFullPathName ...\n");
1440 fprintf(
stderr,
"Begin unixDlError ...\n");
1444 sqlite3_snprintf(nBuf, zBufOut,
"%s", zErr);
1447 fprintf(
stderr,
"End unixDlError ...\n");
1452 static void (*
unixDlSym(sqlite3_vfs* NotUsed,
void*
p,
const char* zSym))(void)
1471 void (*(*
x)(
void*,
const char*))(void);
1474 fprintf(
stderr,
"Begin unixDlSym ...\n");
1476 x = (void (*(*)(
void*,
const char*))(void))dlsym;
1477 return (*
x)(
p, zSym);
1485 fprintf(
stderr,
"Begin unixDlClose ...\n");
1489 fprintf(
stderr,
"End unixDlClose ...\n");
1501 assert((
size_t)nBuf >= (
sizeof(time_t) +
sizeof(
int)));
1503 fprintf(
stderr,
"Begin unixRandomness ...\n");
1517 memset(zBuf, 0, nBuf);
1524 memcpy(zBuf, &t,
sizeof(t));
1526 memcpy(&zBuf[
sizeof(t)], &pid,
sizeof(pid));
1527 assert(
sizeof(t) +
sizeof(pid) <= (
size_t)nBuf);
1528 nBuf =
sizeof(
t) +
sizeof(pid);
1531 nBuf =
osRead(fd, zBuf, nBuf);
1532 }
while (nBuf < 0 && errno == EINTR);
1537 fprintf(
stderr,
"End unixRandomness ...\n");
1555 fprintf(
stderr,
"Begin unixSleep ...\n");
1557 usleep(microseconds);
1559 fprintf(
stderr,
"End unixSleep ...\n");
1561 return microseconds;
1575 fprintf(
stderr,
"Begin unixCurrentTime ...\n");
1578 *prNow = i / 86400000.0;
1580 fprintf(
stderr,
"End unixCurrentTime ...\n");
1599 fprintf(
stderr,
"Begin unixGetLastError ...\n");
1600 fprintf(
stderr,
"End unixGetLastError ...\n");
1617 static const sqlite3_int64 unixEpoch = 24405875 * (sqlite3_int64)8640000;
1618 struct timeval sNow;
1620 fprintf(
stderr,
"Begin unixCurrentTimeInt64 ...\n");
1622 gettimeofday(&sNow, 0);
1623 *piNow = unixEpoch + 1000 * (sqlite3_int64)sNow.tv_sec + sNow.tv_usec / 1000;
1626 fprintf(
stderr,
"End unixCurrentTimeInt64 ...\n");
1639 sqlite3_vfs* pNotUsed,
1641 sqlite3_syscall_ptr pNewFunc
1645 int rc = SQLITE_NOTFOUND;
1648 fprintf(
stderr,
"Begin unixSetSystemCall ...\n");
1665 if (strcmp(zName,
aSyscall[i].zName) == 0) {
1670 if (pNewFunc == 0) {
1679 fprintf(
stderr,
"End unixSetSystemCall ...\n");
1689 static sqlite3_syscall_ptr
1695 fprintf(
stderr,
"Begin unixGetSystemCall ...\n");
1698 if (strcmp(zName,
aSyscall[i].zName) == 0) {
1701 fprintf(
stderr,
"End unixGetSystemCall ...\n");
1707 fprintf(
stderr,
"End unixGetSystemCall ...\n");
1724 fprintf(
stderr,
"Begin unixNextSystemCall ...\n");
1728 if (strcmp(zName,
aSyscall[i].zName) == 0) {
1737 fprintf(
stderr,
"End unixNextSystemCall ...\n");
1743 fprintf(
stderr,
"End unixNextSystemCall ...\n");
1748 #ifndef TKEYVFS_NO_ROOT 1790 #define UNIXVFS(VFSNAME, FINDER) \ 1822 static sqlite3_vfs aVfs[] = {
1830 for (i = 0; i < (
sizeof(aVfs) /
sizeof(sqlite3_vfs)); i++) {
1831 sqlite3_vfs_register(&aVfs[i], 0);
1840 #ifndef TKEYVFS_NO_ROOT
1846 #ifndef TKEYVFS_NO_ROOT 1854 #endif // TKEYVFS_NO_ROOT 1855 return sqlite3_open_v2(filename,
1858 #ifdef TKEYVFS_NO_ROOT
static const sqlite3_io_methods *(*const nolockIoFinder)(const char *, unixFile *p)
static void * unixDlOpen(sqlite3_vfs *NotUsed, const char *zFilename)
#define SQLITE_FCNTL_SYNC_OMITTED
static int unixGetTempname(int nBuf, char *zBuf)
#define UNUSED_PARAMETER2(x, y)
unsigned char transCntrChng
RootFileSentry(TFile *fPtr)
sqlite3_syscall_ptr pDefault
static int unixCurrentTimeInt64(sqlite3_vfs *NotUsed, sqlite3_int64 *piNow)
static int unixWrite(sqlite3_file *id, const void *pBuf, int amt, sqlite3_int64 offset)
static int unixSectorSize(sqlite3_file *NotUsed)
sqlite3_syscall_ptr pCurrent
static void robust_close(unixFile *pFile, int h, int lineno)
#define UNUSED_PARAMETER(x)
static int unixCurrentTime(sqlite3_vfs *NotUsed, double *prNow)
static int unixSetSystemCall(sqlite3_vfs *pNotUsed, const char *zName, sqlite3_syscall_ptr pNewFunc)
static int fcntlSizeHint(unixFile *pFile, i64 nByte)
static int unixGetLastError(sqlite3_vfs *NotUsed, int NotUsed2, char *NotUsed3)
static void(*)(void) unixDlSym(sqlite3_vfs *NotUsed, void *p, const char *zSym)
#define SQLITE_DEFAULT_SECTOR_SIZE
static const char * unixNextSystemCall(sqlite3_vfs *p, const char *zName)
static int seekAndWrite(unixFile *id, i64 offset, const void *pBuf, int cnt)
~RootFileSentry() noexcept
static const sqlite3_io_methods nolockIoMethods
#define SQLITE_FCNTL_CHUNK_SIZE
static int nolockUnlock(sqlite3_file *NotUsed, int NotUsed2)
static int unixTruncate(sqlite3_file *id, i64 nByte)
int tkeyvfs_open_v2(const char *filename, sqlite3 **ppDb, int flags, TFile *rootFile )
static int unixFileControl(sqlite3_file *id, int op, void *pArg)
static int unixRead(sqlite3_file *id, void *pBuf, int amt, sqlite3_int64 offset)
static sqlite3_syscall_ptr unixGetSystemCall(sqlite3_vfs *pNotUsed, const char *zName)
static int nolockLock(sqlite3_file *NotUsed, int NotUsed2)
static int nolockClose(sqlite3_file *id)
sqlite3_io_methods const * pMethod
static void unixDlError(sqlite3_vfs *NotUsed, int nBuf, char *zBufOut)
unsigned char inNormalWrite
static int sqlite3Strlen30(const char *z)
#define SQLITE_CANTOPEN_BKPT
#define SQLITE_FCNTL_SIZE_HINT
static int unixOpen(sqlite3_vfs *pVfs, const char *zPath, sqlite3_file *pFile, int flags, int *pOutFlags)
#define SQLITE_TEMP_FILE_PREFIX
static int unixRandomness(sqlite3_vfs *NotUsed, int nBuf, char *zBuf)
#define SQLITE_FCNTL_DB_UNCHANGED
static int unixDeviceCharacteristics(sqlite3_file *NotUsed)
static int unixFullPathname(sqlite3_vfs *pVfs, const char *zPath, int nOut, char *zOut)
static struct unix_syscall aSyscall[]
static void unixDlClose(sqlite3_vfs *NotUsed, void *pHandle)
static int unixLogErrorAtLine(int errcode, const char *zFunc, const char *zPath, int iLine)
static const sqlite3_io_methods * nolockIoFinderImpl(const char *z, unixFile *p)
static int closeUnixFile(sqlite3_file *id)
#define UNIXVFS(VFSNAME, FINDER)
static int unixAccess(sqlite3_vfs *NotUsed, const char *zPath, int flags, int *pResOut)
def open(path, mode='r', buf=-1)
static int sqlite3CantopenError(int lineno)
static int robust_open(const char *z, int f, int m)
static int unixDelete(sqlite3_vfs *NotUsed, const char *zPath, int dirSync)
static int nolockCheckReservedLock(sqlite3_file *NotUsed, int *pResOut)
static int unixSync(sqlite3_file *id, int flags)
static int seekAndRead(unixFile *id, sqlite3_int64 offset, void *pBuf, int cnt)
#define unixLogError(a, b, c)
static int unixSleep(sqlite3_vfs *NotUsed, int microseconds)
static int unixFileSize(sqlite3_file *id, i64 *pSize)