aboutsummaryrefslogtreecommitdiff
path: root/src/os_unix.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2010-04-28 17:21:33 +0000
committerdrh <drh@noemail.net>2010-04-28 17:21:33 +0000
commit9beb1584bd2e1ea3dfdf3ff08ae78e96f1c1e37d (patch)
tree9472b0afce146d58e2331cb5dc774a8185919090 /src/os_unix.c
parent833bf968e36e14588c4868f0e0710432dcf2d814 (diff)
downloadsqlite-9beb1584bd2e1ea3dfdf3ff08ae78e96f1c1e37d.tar.gz
sqlite-9beb1584bd2e1ea3dfdf3ff08ae78e96f1c1e37d.zip
Changes to the interface design for the xShmLock method of the VFS.
FossilOrigin-Name: 348409de26eafe12f5cb1236e8e167a4183d4051
Diffstat (limited to 'src/os_unix.c')
-rw-r--r--src/os_unix.c23
1 files changed, 4 insertions, 19 deletions
diff --git a/src/os_unix.c b/src/os_unix.c
index d603caa0d..7e3930a1e 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -4697,26 +4697,11 @@ static int unixShmRelease(sqlite3_shm *pSharedMem){
*/
static int unixShmLock(
sqlite3_shm *pSharedMem, /* Pointer from unixShmOpen() */
- int lockType, /* _RDLK, _WRLK, or _UNLK, possibly ORed _BLOCK */
- int ofst, /* Start of lock region */
- int nByte /* Size of lock region in bytes */
+ int desiredLock, /* The locking state desired */
+ int *pGotLock, /* The locking state actually obtained */
+ int shouldBlock /* Block for the lock if true and possible */
){
- struct unixShm *p = (struct unixShm*)pSharedMem;
- struct flock f;
- int op;
- int rc;
-
- f.l_whence = SEEK_SET;
- f.l_start = ofst;
- f.l_len = nByte;
- switch( lockType & 0x07 ){
- case SQLITE_SHM_RDLK: f.l_type = F_RDLCK; break;
- case SQLITE_SHM_WRLK: f.l_type = F_WRLCK; break;
- case SQLITE_SHM_UNLK: f.l_type = F_UNLCK; break;
- }
- op = (lockType & 0x08)!=0 ? F_SETLKW : F_SETLK;
- rc = fcntl(p->fd.h, op, &f);
- return (rc==0) ? SQLITE_OK : SQLITE_BUSY;
+ return SQLITE_OK;
}
/*