diff options
author | drh <drh@noemail.net> | 2011-12-14 17:53:36 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2011-12-14 17:53:36 +0000 |
commit | de60fc2d87a9483cfc1e60ca04381dc07079920b (patch) | |
tree | 0e7ae02b16149f9d535e313bfce923c3f95c4d9a /src/os_unix.c | |
parent | 43a6d4bd4434ef62572c98264aaaf4d01b71c4ac (diff) | |
download | sqlite-de60fc2d87a9483cfc1e60ca04381dc07079920b.tar.gz sqlite-de60fc2d87a9483cfc1e60ca04381dc07079920b.zip |
Add a file-control that will discover the name of the bottom-level VFS and
all the shims in between.
FossilOrigin-Name: cdbfb553af02d10767a905489d9dfc57fc6be54e
Diffstat (limited to 'src/os_unix.c')
-rw-r--r-- | src/os_unix.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/os_unix.c b/src/os_unix.c index ecd5bf244..3cb28b058 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -206,6 +206,7 @@ struct UnixUnusedFd { typedef struct unixFile unixFile; struct unixFile { sqlite3_io_methods const *pMethod; /* Always the first entry */ + sqlite3_vfs *pVfs; /* The VFS that created this unixFile */ unixInodeInfo *pInode; /* Info about locks on this inode */ int h; /* The file descriptor */ unsigned char eFileLock; /* The type of lock held on this fd */ @@ -3533,6 +3534,10 @@ static int unixFileControl(sqlite3_file *id, int op, void *pArg){ } return SQLITE_OK; } + case SQLITE_FCNTL_VFSNAME: { + *(char**)pArg = sqlite3_mprintf("%s", pFile->pVfs->zName); + return SQLITE_OK; + } #ifndef NDEBUG /* The pager calls this method to signal that it has done ** a rollback and that the database is therefore unchanged and @@ -4560,6 +4565,7 @@ static int fillInUnixFile( OSTRACE(("OPEN %-3d %s\n", h, zFilename)); pNew->h = h; + pNew->pVfs = pVfs; pNew->zPath = zFilename; if( memcmp(pVfs->zName,"unix-excl",10)==0 ){ pNew->ctrlFlags = UNIXFILE_EXCL; |