diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2016-07-15 14:46:08 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2016-07-15 14:57:40 +0300 |
commit | 44ca2b760b393e993b2a42fc489fa170910ad810 (patch) | |
tree | 12aa7390b19bed8aba2535cedb04376c45f820a5 /NEWS | |
parent | 5580c3248794803a8e45dd58b45933a32637954d (diff) | |
download | gdbm-44ca2b760b393e993b2a42fc489fa170910ad810.tar.gz gdbm-44ca2b760b393e993b2a42fc489fa170910ad810.tar.bz2 |
gdbm_open adjusts requested block size to accomodate integer number of directory offsets.
* src/gdbm.h.in (GDBM_BSEXACT): New flag.
* src/gdbmopen.c (compute_directory_size): New function.
(gdbm_open): When creating new database, adjust the requested
block size so that the block holds integer number of directory
indices. Disable this behavior if GDBM_BSEXACT flag is set
(this reverts to old behavior). Always unset GDBM_BSEXACT if
using block size returned by stat(2). This makes sure gdbm_open
succeeds on file systems reporting block sizes not divisible by
512.
* src/gdbmconst.h (GDBM_MIN_BLOCK_SIZE): New constant.
* src/gdbmimp.c (gdbm_import_from_file): Use GDBM_MIN_BLOCK_SIZE
instead of the hardcoded value.
* NEWS: Document GDBM_BSEXACT.
* doc/gdbm.texi: Likewise.
Diffstat (limited to 'NEWS')
-rw-r--r-- | NEWS | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -1,4 +1,4 @@ -GNU dbm NEWS -- history of user-visible changes. 2016-07-13 +GNU dbm NEWS -- history of user-visible changes. 2016-07-15 Copyright (C) 1990-2016 Free Software Foundation, Inc. See the end of file for copying conditions. @@ -23,6 +23,16 @@ Instead it sets gdbm_errno to GDBM_MALLOC_ERROR and returns NULL datum. * Per-database error codes +* New gdbm_open flag: GDBM_BSEXACT + +When creating a new database, the gdbm_open function will adjust the +requested block size so that the block can hold integer number of +directory entries. Thus, the resulting block size can be bigger than +the requested one. If the GDBM_BSEXACT flag is set, this behavior is +suppressed and gdbm_open will try to force exactly the requested block +size. If unable to do so, it will set the gdbm_errno variable to +GDBM_BLOCK_SIZE_ERROR and return NULL. + * New functions ** gdbm_last_errno |