aboutsummaryrefslogtreecommitdiff
path: root/src/gdbm.h.in
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2011-11-11 10:37:37 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2011-11-11 10:37:37 +0000
commit99d79193981246f988f10cde380f339f1aca7a70 (patch)
tree0ea660bb3ee85550ae0427f6e33ec07094355a0d /src/gdbm.h.in
parent902a2e4bb5aa53241898ae34dcf7aafb29df7b7e (diff)
downloadgdbm-99d79193981246f988f10cde380f339f1aca7a70.tar.gz
gdbm-99d79193981246f988f10cde380f339f1aca7a70.tar.bz2
Support close-on-exec flag for gdbm_open call.
* src/gdbm.h.in (GDBM_CLOEXEC): New flag. * src/systems.h [O_CLOEXEC]: Provide a placeholder definition. * src/gdbmopen.c (gdbm_open): Honor the GDBM_CLOEXEC flag. * compat/dbmopen.c (ndbm_open_dir_file0): Mask out open mode before comparing with GDBM_READER. Support GDBM_CLOEXEC. (dbm_open): Translate O_CLOEXEC to GDBM_CLOEXEC. * doc/gdbm.texinfo: Document GDBM_CLOEXEC. * NEWS: Update.
Diffstat (limited to 'src/gdbm.h.in')
-rw-r--r--src/gdbm.h.in17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/gdbm.h.in b/src/gdbm.h.in
index 2420774..21168de 100644
--- a/src/gdbm.h.in
+++ b/src/gdbm.h.in
@@ -42,11 +42,12 @@ extern "C" {
# define GDBM_NEWDB 3 /* A writer. Always create a new db. */
# define GDBM_OPENMASK 7 /* Mask for the above. */
-# define GDBM_FAST 0x10 /* Write fast! => No fsyncs. OBSOLETE. */
-# define GDBM_SYNC 0x20 /* Sync operations to the disk. */
-# define GDBM_NOLOCK 0x40 /* Don't do file locking operations. */
-# define GDBM_NOMMAP 0x80 /* Don't use mmap(). */
-
+# define GDBM_FAST 0x010 /* Write fast! => No fsyncs. OBSOLETE. */
+# define GDBM_SYNC 0x020 /* Sync operations to the disk. */
+# define GDBM_NOLOCK 0x040 /* Don't do file locking operations. */
+# define GDBM_NOMMAP 0x080 /* Don't use mmap(). */
+# define GDBM_CLOEXEC 0x100 /* Close the underlying fd on exec(3) */
+
/* Parameters to gdbm_store for simple insertion or replacement in the
case that the key is already in the database. */
# define GDBM_INSERT 0 /* Never replace old data with new. */
@@ -54,7 +55,7 @@ extern "C" {
/* Parameters to gdbm_setopt, specifing the type of operation to perform. */
# define GDBM_SETCACHESIZE 1 /* Set the cache size. */
-# define GDBM_FASTMODE 2 /* Toggle fast mode. OBSOLETE. */
+# define GDBM_FASTMODE 2 /* Toggle fast mode. OBSOLETE. */
# define GDBM_SETSYNCMODE 3 /* Turn on or off sync operations. */
# define GDBM_SETCENTFREE 4 /* Keep all free blocks in the header. */
# define GDBM_SETCOALESCEBLKS 5 /* Attempt to coalesce free blocks. */
@@ -64,8 +65,8 @@ extern "C" {
/* Compatibility defines: */
# define GDBM_CACHESIZE GDBM_SETCACHESIZE
# define GDBM_SYNCMODE GDBM_SETSYNCMODE
-# define GDBM_CENTFREE GDBM_SETCENTFREE
-# define GDBM_COALESCEBLKS GDBM_SETCOALESCEBLKS
+# define GDBM_CENTFREE GDBM_SETCENTFREE
+# define GDBM_COALESCEBLKS GDBM_SETCOALESCEBLKS
# define GDBM_GETFLAGS 8 /* Get gdbm_open flags */
# define GDBM_GETMMAP 9 /* Get mmap status */

Return to:

Send suggestions and report system problems to the System administrator.