OLD | NEW |
1 /* | 1 /* |
2 ** This utility program looks at an SQLite database and determines whether | 2 ** This utility program looks at an SQLite database and determines whether |
3 ** or not it is locked, the kind of lock, and who is holding this lock. | 3 ** or not it is locked, the kind of lock, and who is holding this lock. |
4 ** | 4 ** |
5 ** This only works on unix when the posix advisory locking method is used | 5 ** This only works on unix when the posix advisory locking method is used |
6 ** (which is the default on unix) and when the PENDING_BYTE is in its | 6 ** (which is the default on unix) and when the PENDING_BYTE is in its |
7 ** usual place. | 7 ** usual place. |
8 */ | 8 */ |
9 #include <sys/types.h> | 9 #include <sys/types.h> |
10 #include <sys/stat.h> | 10 #include <sys/stat.h> |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 nLock += isLocked(hShm, F_RDLCK, SHM_WRITE, 1, "WAL-WRITE"); | 125 nLock += isLocked(hShm, F_RDLCK, SHM_WRITE, 1, "WAL-WRITE"); |
126 for(i=0; i<SHM_READ_SIZE; i++){ | 126 for(i=0; i<SHM_READ_SIZE; i++){ |
127 nLock += isLocked(hShm, F_WRLCK, SHM_READ_FIRST+i, 1, "WAL-READ"); | 127 nLock += isLocked(hShm, F_WRLCK, SHM_READ_FIRST+i, 1, "WAL-READ"); |
128 } | 128 } |
129 } | 129 } |
130 if( nLock==0 ){ | 130 if( nLock==0 ){ |
131 printf("file is not locked\n"); | 131 printf("file is not locked\n"); |
132 } | 132 } |
133 return 0; | 133 return 0; |
134 } | 134 } |
OLD | NEW |