aboutsummaryrefslogtreecommitdiff
path: root/src/proto.h
diff options
context:
space:
mode:
authorJason Downs <downsj@downsj.com>2008-11-30 07:29:12 +0000
committerJason Downs <downsj@downsj.com>2008-11-30 07:29:12 +0000
commit75e98477a3854da8e582493f4888b3dca8d257d4 (patch)
treec18accfef04030f856b9d8841c90bbcefef6a2d6 /src/proto.h
parent5a88187f15f70c5d7914469b3e39e58259f59c01 (diff)
downloadgdbm-75e98477a3854da8e582493f4888b3dca8d257d4.tar.gz
gdbm-75e98477a3854da8e582493f4888b3dca8d257d4.tar.bz2
Implement a new basic locking mechanism for GDBM. Add _gdbm_lock_file() and
_gdbm_unlock_file(), which will try to use flock(), lockf(), and fcntl() to lock the file. From ChangeLog: * configure.ac: Add test for lockf. * src/lock.c: New file, adds _gdbm_unlock_file() and _gdbm_lock_file() routines. These attempt to use flock(), lockf(), and fcntl() locking. * src/proto.h: Add new prototypes. * src/systems.h: Remove file locking macros. * src/gdbmopen.c: Rewrite locking code, use _gdbm_lock_file(). * src/gdbmclose.c, src/gdbmreorg.c: Use _gdbm_unlock_file().
Diffstat (limited to 'src/proto.h')
-rw-r--r--src/proto.h19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/proto.h b/src/proto.h
index 6232312..90b28ed 100644
--- a/src/proto.h
+++ b/src/proto.h
@@ -43,12 +43,16 @@ void _gdbm_fatal (gdbm_file_info *, const char *);
int _gdbm_init_cache (gdbm_file_info *, int);
/* From mmap.c */
-int _gdbm_mapped_init (gdbm_file_info *dbf);
-void _gdbm_mapped_unmap (gdbm_file_info *dbf);
-ssize_t _gdbm_mapped_read(gdbm_file_info *dbf, void *buffer, size_t len);
-ssize_t _gdbm_mapped_write(gdbm_file_info *dbf, void *buffer, size_t len);
-off_t _gdbm_mapped_lseek(gdbm_file_info *dbf, off_t offset, int whence);
-int _gdbm_mapped_sync(gdbm_file_info *dbf);
+int _gdbm_mapped_init (gdbm_file_info *);
+void _gdbm_mapped_unmap (gdbm_file_info *);
+ssize_t _gdbm_mapped_read (gdbm_file_info *, void *, size_t);
+ssize_t _gdbm_mapped_write (gdbm_file_info *, void *, size_t);
+off_t _gdbm_mapped_lseek (gdbm_file_info *, off_t, int);
+int _gdbm_mapped_sync (gdbm_file_info *);
+
+/* From lock.c */
+void _gdbm_unlock_file (gdbm_file_info *);
+int _gdbm_lock_file (gdbm_file_info *);
/* The user callable routines.... */
void gdbm_close (gdbm_file_info *);
@@ -63,3 +67,6 @@ int gdbm_exists (gdbm_file_info *, datum);
void gdbm_sync (gdbm_file_info *);
int gdbm_setopt (gdbm_file_info *, int, int *, int);
int gdbm_fdesc (gdbm_file_info *);
+int gdbm_export (gdbm_file_info *, const char *, int, int);
+int gdbm_import (gdbm_file_info *, const char *, int);
+

Return to:

Send suggestions and report system problems to the System administrator.