aboutsummaryrefslogtreecommitdiff
path: root/src/gdbmdefs.h
diff options
context:
space:
mode:
authorJason Downs <downsj@downsj.com>2008-12-01 00:57:13 +0000
committerJason Downs <downsj@downsj.com>2008-12-01 00:57:13 +0000
commit6732749a44326b5cbfc69d446c07367b0b3a3fc2 (patch)
tree9907e5dcd612cac7c542e540dd67e9619c31e9ce /src/gdbmdefs.h
parent30d03809f242c0e3d2f95d75cf27a69f49648563 (diff)
downloadgdbm-6732749a44326b5cbfc69d446c07367b0b3a3fc2.tar.gz
gdbm-6732749a44326b5cbfc69d446c07367b0b3a3fc2.tar.bz2
Finish up lock.c, adding error checking to see if a lock failed because it's
already locked. Also added gdbm_locked() to the API. * src/lock.c: Check errno to see if a lock failed because it's already locked. Add external gdbm_locked() routine to return the status of locking. Move lock type to the dbf. * src/gdbmdefs.h: Move lock type to the dbf. * src/gdbm.proto: Add gdbm_export(), gdbm_import(), and gdbm_locked().
Diffstat (limited to 'src/gdbmdefs.h')
-rw-r--r--src/gdbmdefs.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gdbmdefs.h b/src/gdbmdefs.h
index f760b14..f1f3ee3 100644
--- a/src/gdbmdefs.h
+++ b/src/gdbmdefs.h
@@ -161,6 +161,10 @@ typedef struct {
/* Whether or not we're allowing mmap() use. */
unsigned allow_mmap :1;
+ /* Type of file locking in use. */
+ enum { LOCKING_NONE = 0, LOCKING_FLOCK, LOCKING_LOCKF,
+ LOCKING_FCNTL } lock_type;
+
/* The fatal error handling routine. */
void (*fatal_err) (const char *);

Return to:

Send suggestions and report system problems to the System administrator.