summaryrefslogtreecommitdiffstats
path: root/lib/libc/db
Commit message (Collapse)AuthorAgeFilesLines
* MFC r306349:ngie2017-02-101-4/+9
| | | | | | | | | | | r306349 (by pfg): hash(3): protect in-memory page when using cross-endianness. When writing out pages in the "other endian" format, make a copy instead of trashing the in-memory one. Obtained from: NetBSD (CVS rev. 1.29)
* MFC r297790:ngie2016-12-032-3/+3
| | | | | | | | | | | r297790 (by pfg): libc: replace 0 with NULL for pointers. While here also cleanup some surrounding code; particularly drop some malloc() casts. Found with devel/coccinelle.
* MFC r306332:pfg2016-10-191-1/+2
| | | | | | btree(3): don't shortcut closing if the metadata is dirty. Obtained from: NetBSD (from krb5 tree)
* MFC r297626:bdrewery2016-04-131-1/+2
| | | | | Follow-up r295924: Only sync hash-based db files open for writing when closing.
* MFC:dwmalone2016-03-061-1/+5
| | | | | | | | | r295924: Make sure that hash-based db files fsync befor closing/syncing. r295925: We no longer need O_SYNC pwd_mkd r295465: We no longer need O_SYNC on services_mkdb r295800: We no longer need O_SYNC on cap_mkdb This should improve the performance of building db files.
* MFC r287292:kib2015-09-052-4/+6
| | | | | | | | | | Switch libc from using _sig{procmask,action,suspend} symbols, which are aliases for the syscall stubs and are plt-interposed, to the libc-private aliases of internally interposed sigprocmask() etc. MFC r287300: Use libthr interposed functions instead of syscalls, in posix_spawn()' child.
* MFC r279037:pfg2015-03-231-4/+2
| | | | | | | | | | | | | dbm_delete(3): correct man page to match current behaviour. "The dbm_store() and dbm_delete() functions shall return 0 when they succeed and a negative value when they fail." Reference: http://pubs.opengroup.org/onlinepubs/9699919799/functions/dbm_clearerr.html PR: 42422 Suggested by: delphij
* db: Use O_CLOEXEC instead of separate fcntl() call.jilles2013-08-132-8/+3
|
* db/hash: Use O_CLOEXEC instead of separate fcntl() call.jilles2013-08-111-2/+1
| | | | | | In particular, a hash db is used by getpwnam() and getpwuid(). MFC after: 1 week
* Globally replace u_int*_t from (non-contributed) man pages.ed2012-02-121-1/+1
| | | | | | | | | | | The reasoning behind this, is that if we are consistent in our documentation about the uint*_t stuff, people will be less tempted to write new code that uses the non-standard types. I am not going to bump the man page dates, as these changes can be considered style nits. The meaning of the man pages is unaffected. MFC after: 1 month
* Fix clang warnings.benl2011-06-181-3/+4
| | | | Approved by: philip (mentor)
* The flags argument of mpool_get() is meaningful, document it.delphij2011-06-181-2/+9
| | | | MFC after: 2 weeks
* Bump dates in dbopen(3) and cpuset_getaffinity(2) from r212441 andgjb2010-09-121-1/+1
| | | | | | | r212438, repectively. Approved by: keramida (mentor) MFC after: 1 week
* Note O_SYNC and O_NOFOLLOW flags in dbopen(3) since r190497.gjb2010-09-101-2/+2
| | | | | | | | PR: 150030 Submitted by: Janne Snabb snabb at epipe com Patch by: Janne Snabb Approved by: keramida (mentor) MFC after: 1 week
* libc/db/hash: cap auto-tuned block size with a value that actually worksavg2010-04-052-1/+3
| | | | | | | | | | | | | This fix mostly matters after r206129 that made it possible for st_blksize to be greater than 4K. For this reason, this change should be MFC-ed before r206129. Also, it seems that all FreeBSD uitlities that use db(3) hash databases and create new databases in files, specify their own block size value and thus do not depend on block size autotuning. PR: bin/144446 Submitted by: Peter Jeremy <peterjeremy@acm.org> MFC after: 5 days
* hash.3: fix a factual mistake in the man pageavg2010-04-051-1/+1
| | | | | | PR: bin/144446 Submitted by: Peter Jeremy <peterjeremy@acm.org> MFC after: 3 days
* Consider flag == 0 as the same of flag == R_NEXT. This change will restoredelphij2009-08-241-2/+2
| | | | | a historical behavior that has been changed by revision 190491, and has seen to break exim.
* Update SCCS IDs for Berkeley DB 1.86 merge.delphij2009-06-242-2/+2
|
* style: operators should appear at the line end if we have to wrap.delphij2009-06-241-2/+2
|
* Add some casts to silence compiler warning about signedness.delphij2009-03-282-3/+3
|
* Minor changes from Berkeley DB 1.86 and further improvements from OpenBSD.delphij2009-03-2810-115/+214
| | | | | | | | | | This does not include the new hash routines since they will cause problems when reading old hash files. Since mpool(3) has been changed, provide a compatibility shim for older binaries. Obtained from: OpenBSD
* Allow O_SYNC and O_NOFOLLOW flags in dbopen().delphij2009-03-281-2/+2
| | | | Obtained from: OpenBSD
* Plug memory leaks and a potential NULL dereference.delphij2009-03-281-4/+12
| | | | Obtained from: OpenBSD
* Simplify the logic when determining whether to zero out a db file to afterdelphij2009-03-281-15/+5
| | | | | | | | open(). The previous logic only initializes the database when O_CREAT is set, but as long as we can open and write the database, and the database is empty, we should initialize it anyway. Obtained from: OpenBSD
* - If (keysize+datasize)%(bsize=14)==0, insertion of a `big key' would causedelphij2009-03-281-6/+18
| | | | | | | | | | | | | | | an invariant (actually, an ugly hack) to fail, and all Hell would break loose. When deleting a big key, the offset of an empty page should be bsize, not bsize-1; otherwise an insertion into the empty page will cause the new key to be elongated by 1 byte. Make the packing more dense in a couple of cases. - fix NULL dereference exposed on big bsize values; Obtained from: NetBSD via OpenBSD
* Avoid NULL deference which causes DEBUG1 to crash, not to print usefuldelphij2009-03-281-1/+1
| | | | | | information. Obtained from: OpenBSD
* - Avoid overwriting the cursor page when the cursor page becomes thedelphij2009-03-281-1/+21
| | | | | | | LRU page. - Fix for sequential retrieval failure when using large key/data pairs. Obtained from: OpenBSD
* Fix a crash when iterating over a hash and removing its elements.delphij2009-03-282-11/+21
| | | | Obtained from: OpenBSD
* Only squeeze a short key/value pair onto a page with other complete key/valuedelphij2009-03-281-3/+9
| | | | | | pairs, not onto a page containing the end of a big pair. Obtained from: NetBSD via OpenBSD
* Diff reduce against OpenBSD, no functional change.delphij2009-03-282-12/+6
|
* Return meaningful errno in overflow case; print error message to stderrdelphij2009-03-281-1/+7
| | | | | | in one more case. Obtained from: NetBSD via OpenBSD
* Use pread(2) and pwrite(2) instead of lseek(2) + read(2) / write(2).delphij2009-03-282-6/+3
| | | | Obtained from: NetBSD via OpenBSD
* db/btree/bt_open.c: check return value of snprintf() and return valuedelphij2009-03-282-6/+21
| | | | | | | | | if the result is truncated. db/hash/hash_page.c: use the same way to create temporary file as bt_open.c; check snprintf() return value. Obtained from: OpenBSD
* Several signed/unsigned warning fixes.delphij2009-03-288-16/+18
|
* When allocating memory, zero out them if we don't intend to overwrite themdelphij2009-03-285-28/+11
| | | | | | | | | | | | all; before freeing memory, zero out them before we release it as free heap. This will eliminate some potential information leak issue. While there, remove the PURIFY option. There is a slight difference between the new behavior and the old -DPURIFY behavior, with the latter initializes memory with 0xff's. The difference between old and new approach does not generate observable difference. Obtained from: OpenBSD (partly).
* Save errno before calling _close(), which may clear it.delphij2009-03-231-2/+4
| | | | Obtained from: OpenBSD
* use more proper format string.delphij2009-03-232-11/+11
| | | | Obtained from: NetBSD via OpenBSD
* Our realloc(3) and reallocf(3) can handle NULL, which turns it into adelphij2009-03-054-21/+8
| | | | | | malloc(3) call, so don't test if a pointer is NULL. Obtained from: OpenBSD (in spirit)
* Explicitly specify bit width for on-disk data structure.delphij2009-03-041-17/+17
| | | | Obtained from: OpenBSD
* Style changes (including additional casts to shut up warnings). Thisdelphij2009-03-0415-36/+35
| | | | commit does not affect MD5 of object file.
* Rename variable 'index' to 'idx' to avoid name collision with index(3),delphij2009-03-037-101/+87
| | | | | | | this commit does not affect any object code. Obtained from: OpenBSD Verified with: md5(1)
* Diff reduction against OpenBSD: ANSI'fy prototypes.delphij2009-03-0228-485/+196
| | | | | | | | (This is part of a larger changeset which is intended to reduce diff only, thus some prototypes were left intact since they will be changed in the future). Verified with: md5(1)
* - Remove superfluous commentgabor2009-01-301-2/+0
| | | | | PR: docs/129400 Submitted by: Gavin Atkinson <gavin@freebsd.org>
* getopt(3) returns -1, not EOF.kevlo2008-02-182-2/+2
|
* The usage of "info" in init_hash() is read-only, so constifydelphij2007-05-251-3/+3
| | | | | the internal interface instead of casting away the constant constraint upon calling.
* Use C comments since we now preprocess these files with CPP.deischen2007-04-291-2/+4
|
* Per Regents of the University of Calfornia letter, remove advertisingimp2007-01-0951-204/+0
| | | | | | clause. # If I've done so improperly on a file, please let me know.
* o dbm_close(3) returns void not zero or anything else. Touch .Dd.maxim2006-04-161-5/+1
| | | | | | PR: docs/80070 Submitted by: Aleksej Saushev MFC after: 2 weeks
* Add each directory's symbol map file to SYM_MAPS.deischen2006-03-131-0/+2
|
* Add symbol maps and initial symbol version definitions to libc.deischen2006-03-131-0/+30
| | | | Reviewed by: davidxu
OpenPOWER on IntegriCloud