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 59 #include <sys/types.h> 68 #define TKEYVFS_TRACE 0 74 #ifndef TKEYVFS_NO_ROOT 76 #endif // TKEYVFS_NO_ROOT 87 #define MAX_PATHNAME 512 89 #define SQLITE_TEMP_FILE_PREFIX "etilqs_" 96 sqlite3_io_methods
const*
pMethod;
97 #ifndef TKEYVFS_NO_ROOT 100 #endif // TKEYVFS_NO_ROOT 126 #define O_LARGEFILE 0 128 #ifdef SQLITE_DISABLE_LFS 130 #define O_LARGEFILE 0 140 typedef void (*sqlite3_syscall_ptr)(void);
159 static int unixRead(sqlite3_file*
id,
168 static int unixSync(sqlite3_file*
id,
int flags);
170 static int nolockLock(sqlite3_file* NotUsed,
int NotUsed2);
171 static int nolockUnlock(sqlite3_file* NotUsed,
int NotUsed2);
177 static int unixOpen(sqlite3_vfs* pVfs,
182 static int unixDelete(sqlite3_vfs* NotUsed,
const char*
zPath,
int dirSync);
191 static void*
unixDlOpen(sqlite3_vfs* NotUsed,
const char* zFilename);
192 static void unixDlError(sqlite3_vfs* NotUsed,
int nBuf,
char* zBufOut);
193 static void (*
unixDlSym(sqlite3_vfs* NotUsed,
void*
p,
const char* zSym))(void);
194 static void unixDlClose(sqlite3_vfs* NotUsed,
void* pHandle);
195 static int unixRandomness(sqlite3_vfs* NotUsed,
int nBuf,
char* zBuf);
196 static int unixSleep(sqlite3_vfs* NotUsed,
int microseconds);
198 static int unixGetLastError(sqlite3_vfs* NotUsed,
int NotUsed2,
char* NotUsed3);
202 sqlite3_syscall_ptr pNewFunc);
211 "tkeyvfs.c: cannot open file at line %d of [%.10s]",
213 20 + sqlite3_sourceid());
214 return SQLITE_CANTOPEN;
216 #define SQLITE_CANTOPEN_BKPT sqlite3CantopenError(__LINE__) 236 return 0x3fffffff & (
int)(z2 - z);
247 sqlite3_syscall_ptr pCurrent;
248 sqlite3_syscall_ptr pDefault;
250 {
"open", (sqlite3_syscall_ptr)
open, 0},
253 {
"close", (sqlite3_syscall_ptr)close, 0},
256 {
"access", (sqlite3_syscall_ptr)
access, 0},
259 {
"getcwd", (sqlite3_syscall_ptr)getcwd, 0},
262 {
"stat", (sqlite3_syscall_ptr)
stat, 0},
273 #define osFstat(a, b, c) 0 275 {
"fstat", (sqlite3_syscall_ptr)fstat, 0},
279 {
"ftruncate", (sqlite3_syscall_ptr)ftruncate, 0},
282 {
"fcntl", (sqlite3_syscall_ptr)fcntl, 0},
285 {
"read", (sqlite3_syscall_ptr)read, 0},
288 #
if defined(USE_PREAD)
289 {
"pread", (sqlite3_syscall_ptr)pread, 0},
291 {
"pread", (sqlite3_syscall_ptr)0, 0},
295 #
if defined(USE_PREAD64)
296 {
"pread64", (sqlite3_syscall_ptr)pread64, 0},
298 {
"pread64", (sqlite3_syscall_ptr)0, 0},
302 {
"write", (sqlite3_syscall_ptr)write, 0},
305 #
if defined(USE_PREAD)
306 {
"pwrite", (sqlite3_syscall_ptr)pwrite, 0},
308 {
"pwrite", (sqlite3_syscall_ptr)0, 0},
313 #
if defined(USE_PREAD64)
314 {
"pwrite64", (sqlite3_syscall_ptr)pwrite64, 0},
316 {
"pwrite64", (sqlite3_syscall_ptr)0, 0},
321 {
"fchmod", (sqlite3_syscall_ptr)0, 0},
324 #
if defined(HAVE_POSIX_FALLOCATE) && HAVE_POSIX_FALLOCATE
325 {
"fallocate", (sqlite3_syscall_ptr)posix_fallocate, 0},
327 {
"fallocate", (sqlite3_syscall_ptr)0, 0},
355 static const sqlite3_io_methods*
367 typedef const sqlite3_io_methods* (*finder_type)(
const char*,
unixFile*);
385 #define unixLogError(a, b, c) unixLogErrorAtLine(a, b, c, __LINE__) 395 zErr = strerror(iErrno);
400 "tkeyvfs.c:%d: (%d) %s(%s) - %s",
417 fprintf(
stderr,
"Begin robust_open ...\n");
421 }
while (rc < 0 && errno == EINTR);
423 fprintf(
stderr,
"End robust_open ...\n");
446 fprintf(
stderr,
"Begin robust_close ...\n");
456 fprintf(
stderr,
"End robust_close ...\n");
476 fprintf(
stderr,
"Begin closeUnixFile ...\n");
480 #ifndef TKEYVFS_NO_ROOT 482 #endif // TKEYVFS_NO_ROOT 484 #ifndef TKEYVFS_NO_ROOT 489 stderr,
"fileSize: 0x%016lx\n", (
unsigned long long)pFile->
fileSize);
493 TKey*
k =
new TKey(pFile->
zPath,
494 "sqlite3 database file",
500 Int_t objlen = k->GetObjlen();
501 fprintf(
stderr,
"objlen: %d\n", objlen);
505 Int_t cycle = pFile->
rootFile->AppendKey(k);
507 char*
p = k->GetBuffer();
509 (
void*)memcpy((
void*)
p, (
void*)pFile->
pBuf, (
size_t)pFile->
fileSize);
513 Int_t cnt = k->WriteFile(cycle, 0 );
517 "tkeyvfs: failed to write root tkey containing database " 525 fprintf(
stderr,
"tkeyvfs: failed to write root file to disk!\n");
528 #endif // TKEYVFS_NO_ROOT 529 if (pFile->
pBuf !=
nullptr) {
532 if (pFile->
zPath !=
nullptr) {
533 free((
void*)pFile->
zPath);
537 fprintf(
stderr,
"End closeUnixFile ...\n");
550 static const unsigned char zChars[] =
"abcdefghijklmnopqrstuvwxyz" 551 "ABCDEFGHIJKLMNOPQRSTUVWXYZ" 555 fprintf(
stderr,
"Begin unixGetTempname ...\n");
563 fprintf(
stderr,
"End unixGetTempname ...\n");
568 j = (
int)strlen(zBuf);
569 sqlite3_randomness(15, &zBuf[j]);
570 for (i = 0; i < 15; i++, j++) {
571 zBuf[j] = (char)zChars[((
unsigned char)zBuf[j]) % (
sizeof(zChars) - 1)];
575 fprintf(
stderr,
"End unixGetTempname ...\n");
593 fprintf(
stderr,
"Begin fcntlSizeHint ...\n");
602 char* pNewBuf = (
char*)realloc((
void*)pFile->
pBuf, (size_t)nAlloc);
603 if (pNewBuf ==
nullptr) {
606 fprintf(
stderr,
"End fcntlSizeHint ...\n");
608 return SQLITE_IOERR_WRITE;
612 pFile->
pBuf = pNewBuf;
622 fprintf(
stderr,
"End fcntlSizeHint ...\n");
645 fprintf(
stderr,
"Begin seekAndRead ...\n");
650 fprintf(
stderr,
"End seekAndRead ...\n");
654 if ((offset + cnt) > id->
fileSize) {
655 cnt = (offset + cnt) - id->
fileSize;
657 (
void*)memcpy(pBuf, (
const void*)(
id->pBuf +
offset), (
size_t)cnt);
659 fprintf(
stderr,
"End seekAndRead ...\n");
676 fprintf(
stderr,
"Begin seekAndWrite ...\n");
681 nByte = offset + ((
i64)cnt);
688 char* pNewBuf = (
char*)realloc((
void*)
id->pBuf, (size_t)(newBufSize));
689 if (pNewBuf ==
nullptr) {
690 id->lastErrno = errno;
692 fprintf(
stderr,
"End seekAndWrite ...\n");
696 if ((offset + (
i64)cnt) < newBufSize) {
697 i64 zeroCnt = newBufSize - (offset + (
i64)cnt);
698 (
void*)memset((
void*)(pNewBuf + offset + (
i64)cnt), 0, (size_t)zeroCnt);
701 id->bufAllocated = newBufSize;
703 (
void*)memcpy((
void*)(
id->pBuf +
offset), pBuf, (
size_t)cnt);
705 id->fileSize = offset + (
i64)cnt;
708 fprintf(
stderr,
"End seekAndWrite ...\n");
721 fprintf(
stderr,
"Begin nolockClose ...\n");
725 fprintf(
stderr,
"End nolockClose ...\n");
741 fprintf(
stderr,
"Begin unixRead ...\n");
746 stderr,
"offset: 0x%016lx amt: 0x%08x\n", (
unsigned long long)offset, amt);
752 fprintf(
stderr,
"End unixRead ...\n");
755 }
else if (got < 0) {
758 fprintf(
stderr,
"End unixRead ...\n");
760 return SQLITE_IOERR_READ;
764 memset(&((
char*)pBuf)[got], 0, amt - got);
766 fprintf(
stderr,
"End unixRead ...\n");
768 return SQLITE_IOERR_SHORT_READ;
782 fprintf(
stderr,
"Begin unixWrite ...\n");
787 stderr,
"offset: 0x%016lx amt: 0x%08x\n", (
unsigned long long)offset, amt);
797 if ((offset <= 24) && (offset + amt >= 27)) {
801 if (rc != 4 || memcmp(oldCntr, &((
char*)pBuf)[24 - offset], 4) != 0) {
806 while ((amt > 0) && ((wrote =
seekAndWrite(pFile, offset, pBuf, amt)) > 0)) {
809 pBuf = &((
char*)pBuf)[wrote];
815 fprintf(
stderr,
"End unixWrite ...\n");
817 return SQLITE_IOERR_WRITE;
821 fprintf(
stderr,
"End unixWrite ...\n");
827 fprintf(
stderr,
"End unixWrite ...\n");
841 fprintf(
stderr,
"Begin unixTruncate ...\n");
845 fprintf(
stderr,
"nByte: 0x%016lx\n", (
unsigned long long)nByte);
858 if (pFile->
pBuf ==
nullptr) {
863 fprintf(
stderr,
"End unixTruncate ...\n");
872 i64 zeroCnt = newBufSize - nByte;
873 char* pNewBuf = (
char*)realloc((
void*)pFile->
pBuf, (size_t)newBufSize);
874 if (pNewBuf ==
nullptr) {
877 fprintf(
stderr,
"End unixTruncate ...\n");
881 (
void*)memset((
void*)(pNewBuf + nByte), 0, (
size_t)zeroCnt);
882 pFile->
pBuf = pNewBuf;
897 fprintf(
stderr,
"End unixTruncate ...\n");
922 fprintf(
stderr,
"Begin unixSync ...\n");
928 fprintf(
stderr,
"End unixSync ...\n");
941 fprintf(
stderr,
"Begin unixFileSize ...\n");
957 fprintf(
stderr,
"End unixFileSize ...\n");
968 fprintf(
stderr,
"Begin nolockLock ...\n");
974 fprintf(
stderr,
"End nolockLock ...\n");
985 fprintf(
stderr,
"Begin nolockUnlock ...\n");
991 fprintf(
stderr,
"End nolockUnlock ...\n");
1001 fprintf(
stderr,
"Begin nolockCheckReservedLock ...\n");
1008 fprintf(
stderr,
"End nolockCheckReservedLock ...\n");
1021 fprintf(
stderr,
"Begin unixFileControl ...\n");
1027 case SQLITE_FCNTL_LOCKSTATE: {
1030 fprintf(
stderr,
"op: LOCKSTATE\n");
1035 fprintf(
stderr,
"End unixFileControl ...\n");
1039 case SQLITE_LAST_ERRNO: {
1042 fprintf(
stderr,
"op: LAST_ERRNO\n");
1046 fprintf(
stderr,
"End unixFileControl ...\n");
1053 fprintf(
stderr,
"op: CHUNK_SIZE\n");
1054 fprintf(
stderr,
"szChunk: %d\n", *(
int*)pArg);
1056 ((
unixFile*)
id)->szChunk = *(
int*)pArg;
1058 fprintf(
stderr,
"End unixFileControl ...\n");
1065 fprintf(
stderr,
"op: SIZE_HINT\n");
1066 fprintf(
stderr,
"hint: 0x%016lx\n", *(
i64*)pArg);
1070 fprintf(
stderr,
"End unixFileControl ...\n");
1082 fprintf(
stderr,
"op: DB_UNCHANGED\n");
1086 fprintf(
stderr,
"End unixFileControl ...\n");
1093 fprintf(
stderr,
"op: SYNC_OMITTED\n");
1094 fprintf(
stderr,
"End unixFileControl ...\n");
1100 fprintf(
stderr,
"End unixFileControl ...\n");
1102 return SQLITE_NOTFOUND;
1120 fprintf(
stderr,
"Begin unixSectorSize ...\n");
1123 fprintf(
stderr,
"End unixSectorSize ...\n");
1136 fprintf(
stderr,
"Begin unixDeviceCharacteristics ...\n");
1139 fprintf(
stderr,
"End unixDeviceCharacteristics ...\n");
1172 sqlite3_file* pFile,
1178 int eType = flags & 0xFFFFFF00;
1181 int isDelete = (flags & SQLITE_OPEN_DELETEONCLOSE);
1182 int isCreate = (flags & SQLITE_OPEN_CREATE);
1183 int isReadonly = (flags & SQLITE_OPEN_READONLY);
1184 int isReadWrite = (flags & SQLITE_OPEN_READWRITE);
1186 const char* zName =
zPath;
1188 fprintf(
stderr,
"Begin unixOpen ...\n");
1189 if (zPath !=
nullptr) {
1190 fprintf(
stderr,
"filename: %s\n", zPath);
1199 if (rc != SQLITE_OK) {
1204 if (zName !=
nullptr) {
1205 p->
zPath = (
char*)malloc(strlen(zName) + 1);
1206 if (p->
zPath !=
nullptr) {
1207 (
void*)strcpy((
char*)p->
zPath, zName);
1212 #ifndef TKEYVFS_NO_ROOT 1214 if (eType & SQLITE_OPEN_MAIN_DB) {
1219 (eType & SQLITE_OPEN_MAIN_DB) && (isCreate || isReadWrite) && !isDelete);
1220 #endif // TKEYVFS_NO_ROOT 1221 if ((eType & SQLITE_OPEN_MAIN_DB) && !isCreate) {
1225 #ifndef TKEYVFS_NO_ROOT 1226 Bool_t status = kFALSE;
1235 status = k->ReadFile();
1239 fprintf(
stderr,
"End unixOpen ...\n");
1245 pKeyBuf = k->GetBuffer();
1247 nBytes = k->GetObjlen();
1251 p->
pBuf = (
char*)malloc((
size_t)nAlloc);
1252 #else // TKEYVFS_NO_ROOT 1257 #endif // TKEYVFS_NO_ROOT 1258 if (p->
pBuf ==
nullptr) {
1261 fprintf(
stderr,
"End unixOpen ...\n");
1266 #ifndef TKEYVFS_NO_ROOT 1269 (
void*)memcpy(p->
pBuf, pKeyBuf, (
size_t)nBytes);
1270 #endif // TKEYVFS_NO_ROOT 1276 if (p->
pBuf ==
nullptr) {
1279 fprintf(
stderr,
"End unixOpen ...\n");
1289 fprintf(
stderr,
"End unixOpen ...\n");
1307 fprintf(
stderr,
"Begin unixDelete ...\n");
1308 if (
zPath !=
nullptr) {
1313 fprintf(
stderr,
"End unixDelete ...\n");
1338 fprintf(
stderr,
"Begin unixAccess ...\n");
1339 if (
zPath !=
nullptr) {
1344 case SQLITE_ACCESS_EXISTS:
1347 fprintf(
stderr,
"op: SQLITE_ACCESS_EXISTS\n");
1351 case SQLITE_ACCESS_READWRITE:
1354 fprintf(
stderr,
"op: SQLITE_ACCESS_READWRITE\n");
1356 amode = W_OK | R_OK;
1358 case SQLITE_ACCESS_READ:
1361 fprintf(
stderr,
"op: SQLITE_ACCESS_READ\n");
1366 assert(!
"Invalid flags argument");
1370 fprintf(
stderr,
"End unixAccess ...\n");
1393 fprintf(
stderr,
"Begin unixFullPathName ...\n");
1394 if (zPath !=
nullptr) {
1395 fprintf(
stderr,
"filename: %s\n", zPath);
1400 zOut[nOut - 1] =
'\0';
1401 sqlite3_snprintf(nOut, zOut,
"%s", zPath);
1403 fprintf(
stderr,
"End unixFullPathName ...\n");
1417 fprintf(
stderr,
"Begin unixFullPathName ...\n");
1419 void*
p = dlopen(zFilename, RTLD_NOW | RTLD_GLOBAL);
1421 fprintf(
stderr,
"End unixFullPathName ...\n");
1439 fprintf(
stderr,
"Begin unixDlError ...\n");
1443 sqlite3_snprintf(nBuf, zBufOut,
"%s", zErr);
1446 fprintf(
stderr,
"End unixDlError ...\n");
1451 static void (*
unixDlSym(sqlite3_vfs* NotUsed,
void*
p,
const char* zSym))(void)
1470 void (*(*
x)(
void*,
const char*))(void);
1473 fprintf(
stderr,
"Begin unixDlSym ...\n");
1475 x = (void (*(*)(
void*,
const char*))(void))dlsym;
1476 return (*
x)(
p, zSym);
1484 fprintf(
stderr,
"Begin unixDlClose ...\n");
1488 fprintf(
stderr,
"End unixDlClose ...\n");
1500 assert((
size_t)nBuf >= (
sizeof(time_t) +
sizeof(
int)));
1502 fprintf(
stderr,
"Begin unixRandomness ...\n");
1516 memset(zBuf, 0, nBuf);
1523 memcpy(zBuf, &t,
sizeof(t));
1525 memcpy(&zBuf[
sizeof(t)], &pid,
sizeof(pid));
1526 assert(
sizeof(t) +
sizeof(pid) <= (
size_t)nBuf);
1527 nBuf =
sizeof(
t) +
sizeof(pid);
1530 nBuf =
osRead(fd, zBuf, nBuf);
1531 }
while (nBuf < 0 && errno == EINTR);
1536 fprintf(
stderr,
"End unixRandomness ...\n");
1554 fprintf(
stderr,
"Begin unixSleep ...\n");
1556 usleep(microseconds);
1558 fprintf(
stderr,
"End unixSleep ...\n");
1560 return microseconds;
1574 fprintf(
stderr,
"Begin unixCurrentTime ...\n");
1577 *prNow = i / 86400000.0;
1579 fprintf(
stderr,
"End unixCurrentTime ...\n");
1598 fprintf(
stderr,
"Begin unixGetLastError ...\n");
1599 fprintf(
stderr,
"End unixGetLastError ...\n");
1616 static const sqlite3_int64 unixEpoch = 24405875 * (sqlite3_int64)8640000;
1617 struct timeval sNow;
1619 fprintf(
stderr,
"Begin unixCurrentTimeInt64 ...\n");
1621 gettimeofday(&sNow, 0);
1622 *piNow = unixEpoch + 1000 * (sqlite3_int64)sNow.tv_sec + sNow.tv_usec / 1000;
1625 fprintf(
stderr,
"End unixCurrentTimeInt64 ...\n");
1638 sqlite3_vfs* pNotUsed,
1640 sqlite3_syscall_ptr pNewFunc
1644 int rc = SQLITE_NOTFOUND;
1647 fprintf(
stderr,
"Begin unixSetSystemCall ...\n");
1664 if (strcmp(zName,
aSyscall[i].zName) == 0) {
1669 if (pNewFunc == 0) {
1678 fprintf(
stderr,
"End unixSetSystemCall ...\n");
1688 static sqlite3_syscall_ptr
1694 fprintf(
stderr,
"Begin unixGetSystemCall ...\n");
1697 if (strcmp(zName,
aSyscall[i].zName) == 0) {
1700 fprintf(
stderr,
"End unixGetSystemCall ...\n");
1706 fprintf(
stderr,
"End unixGetSystemCall ...\n");
1723 fprintf(
stderr,
"Begin unixNextSystemCall ...\n");
1727 if (strcmp(zName,
aSyscall[i].zName) == 0) {
1736 fprintf(
stderr,
"End unixNextSystemCall ...\n");
1742 fprintf(
stderr,
"End unixNextSystemCall ...\n");
1747 #ifndef TKEYVFS_NO_ROOT 1789 #define UNIXVFS(VFSNAME, FINDER) \ 1821 static sqlite3_vfs aVfs[] = {
1829 for (i = 0; i < (
sizeof(aVfs) /
sizeof(sqlite3_vfs)); i++) {
1830 sqlite3_vfs_register(&aVfs[i], 0);
1839 #ifndef TKEYVFS_NO_ROOT
1845 #ifndef TKEYVFS_NO_ROOT 1853 #endif // TKEYVFS_NO_ROOT 1854 return sqlite3_open_v2(filename,
1857 #ifdef TKEYVFS_NO_ROOT
static int nolockLock(sqlite3_file *NotUsed, int NotUsed2)
#define unixLogError(a, b, c)
static int unixTruncate(sqlite3_file *id, i64 nByte)
static void unixDlClose(sqlite3_vfs *NotUsed, void *pHandle)
unsigned char transCntrChng
#define UNUSED_PARAMETER2(x, y)
RootFileSentry(TFile *fPtr)
static int unixWrite(sqlite3_file *id, const void *pBuf, int amt, sqlite3_int64 offset)
static int unixCurrentTimeInt64(sqlite3_vfs *NotUsed, sqlite3_int64 *piNow)
sqlite3_syscall_ptr pDefault
static int sqlite3CantopenError(int lineno)
#define SQLITE_FCNTL_SYNC_OMITTED
static int unixDelete(sqlite3_vfs *NotUsed, const char *zPath, int dirSync)
static int unixSetSystemCall(sqlite3_vfs *pNotUsed, const char *zName, sqlite3_syscall_ptr pNewFunc)
static int unixRead(sqlite3_file *id, void *pBuf, int amt, sqlite3_int64 offset)
sqlite3_syscall_ptr pCurrent
static int unixLogErrorAtLine(int errcode, const char *zFunc, const char *zPath, int iLine)
static const sqlite3_io_methods *(*const nolockIoFinder)(const char *, unixFile *p)
#define SQLITE_FCNTL_DB_UNCHANGED
static int nolockCheckReservedLock(sqlite3_file *NotUsed, int *pResOut)
static int seekAndWrite(unixFile *id, i64 offset, const void *pBuf, int cnt)
static int unixAccess(sqlite3_vfs *NotUsed, const char *zPath, int flags, int *pResOut)
static int unixCurrentTime(sqlite3_vfs *NotUsed, double *prNow)
static int robust_open(const char *z, int f, int m)
static void unixDlError(sqlite3_vfs *NotUsed, int nBuf, char *zBufOut)
static int unixOpen(sqlite3_vfs *pVfs, const char *zPath, sqlite3_file *pFile, int flags, int *pOutFlags)
#define SQLITE_TEMP_FILE_PREFIX
#define SQLITE_FCNTL_SIZE_HINT
~RootFileSentry() noexcept
static const sqlite3_io_methods * nolockIoFinderImpl(const char *z, unixFile *p)
static struct unix_syscall aSyscall[]
static int unixSync(sqlite3_file *id, int flags)
static int unixGetLastError(sqlite3_vfs *NotUsed, int NotUsed2, char *NotUsed3)
static const char * unixNextSystemCall(sqlite3_vfs *p, const char *zName)
static int closeUnixFile(sqlite3_file *id)
static sqlite3_syscall_ptr unixGetSystemCall(sqlite3_vfs *pNotUsed, const char *zName)
static int unixGetTempname(int nBuf, char *zBuf)
sqlite3_io_methods const * pMethod
static void robust_close(unixFile *pFile, int h, int lineno)
unsigned char inNormalWrite
#define UNUSED_PARAMETER(x)
static void(*)(void) unixDlSym(sqlite3_vfs *NotUsed, void *p, const char *zSym)
static int nolockClose(sqlite3_file *id)
int tkeyvfs_open_v2(const char *filename, sqlite3 **ppDb, int flags, TFile *rootFile )
static int unixDeviceCharacteristics(sqlite3_file *NotUsed)
static int unixFileSize(sqlite3_file *id, i64 *pSize)
static int fcntlSizeHint(unixFile *pFile, i64 nByte)
static int unixRandomness(sqlite3_vfs *NotUsed, int nBuf, char *zBuf)
static int nolockUnlock(sqlite3_file *NotUsed, int NotUsed2)
static int sqlite3Strlen30(const char *z)
static const sqlite3_io_methods nolockIoMethods
static int unixFullPathname(sqlite3_vfs *pVfs, const char *zPath, int nOut, char *zOut)
#define SQLITE_CANTOPEN_BKPT
#define UNIXVFS(VFSNAME, FINDER)
static int seekAndRead(unixFile *id, sqlite3_int64 offset, void *pBuf, int cnt)
static int unixSleep(sqlite3_vfs *NotUsed, int microseconds)
def open(path, mode='r', buf=-1)
#define SQLITE_FCNTL_CHUNK_SIZE
static int unixSectorSize(sqlite3_file *NotUsed)
static void * unixDlOpen(sqlite3_vfs *NotUsed, const char *zFilename)
static int unixFileControl(sqlite3_file *id, int op, void *pArg)
#define SQLITE_DEFAULT_SECTOR_SIZE