summaryrefslogtreecommitdiffstats
path: root/lib/libc/db/hash
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 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-051-2/+3
| | | | | | | | | | 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.
* db: Use O_CLOEXEC instead of separate fcntl() call.jilles2013-08-131-3/+1
|
* 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
* 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
* 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.
* Add some casts to silence compiler warning about signedness.delphij2009-03-281-1/+1
|
* Minor changes from Berkeley DB 1.86 and further improvements from OpenBSD.delphij2009-03-282-67/+44
| | | | | | | | | | 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
* 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-281-4/+15
| | | | | | | | | 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-284-10/+12
|
* When allocating memory, zero out them if we don't intend to overwrite themdelphij2009-03-281-9/+6
| | | | | | | | | | | | 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).
* 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-042-10/+8
| | | | commit does not affect MD5 of object file.
* Diff reduction against OpenBSD: ANSI'fy prototypes.delphij2009-03-025-213/+101
| | | | | | | | (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)
* 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.
* Per Regents of the University of Calfornia letter, remove advertisingimp2007-01-0910-40/+0
| | | | | | clause. # If I've done so improperly on a file, please let me know.
* Fix format strings to unbreak with -DDEBUG option.kuriyama2004-09-101-1/+1
|
* Eliminate 61 warnings emitted at WARNS=2 (leaving 53 to go).nectar2003-02-162-4/+5
| | | | | | | Only warnings that could be fixed without changing the generated object code and without restructuring the source code have been handled. Reviewed by: /sbin/md5
* libc_r wasn't so tied to libc for 22 months.ru2002-11-181-1/+1
|
* Fix the style of the SCM ID's.obrien2002-03-221-0/+1
| | | | I believe have made all of libc .h's as consistent as possible.
* Fix the style of the SCM ID's.obrien2002-03-221-0/+2
| | | | I believe have made all of libc .c's as consistent as possible.
* Remove multi-line __P() usage.obrien2002-03-222-3/+3
|
* Remove __P() usage.obrien2002-03-217-53/+54
|
* Remove 'register' keyword.obrien2002-03-216-72/+78
|
* Add new, from scratch implementation of hsearch() et al that actually works.ru2001-05-152-110/+1
| | | | | Obtained from: NetBSD MFC after: 1 month
* Fix typo: compatability -> compatibility.asmodai2001-02-061-1/+2
| | | | | | Compatability is not an existing english word. Add $FreeBSD$.
* Remove _THREAD_SAFE and make libc thread-safe by default bydeischen2001-01-243-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | adding (weak definitions to) stubs for some of the pthread functions. If the threads library is linked in, the real pthread functions will pulled in. Use the following convention for system calls wrapped by the threads library: __sys_foo - actual system call _foo - weak definition to __sys_foo foo - weak definition to __sys_foo Change all libc uses of system calls wrapped by the threads library from foo to _foo. In order to define the prototypes for _foo(), we introduce namespace.h and un-namespace.h (suggested by bde). All files that need to reference these system calls, should include namespace.h before any standard includes, then include un-namespace.h after the standard includes and before any local includes. <db.h> is an exception and shouldn't be included in between namespace.h and un-namespace.h namespace.h will define foo to _foo, and un-namespace.h will undefine foo. Try to eliminate some of the recursive calls to MT-safe functions in libc/stdio in preparation for adding a mutex to FILE. We have recursive mutexes, but would like to avoid using them if possible. Remove uneeded includes of <errno.h> from a few files. Add $FreeBSD$ to a few files in order to pass commitprep. Approved by: -arch
* cleanup the tsearch import.alfred2000-07-062-53/+4
| | | | | | | | | | | | remove (comment out) functions defined or depricated elsewhere: bsearch, lfind, lsearch, insque, remque change hcreate to take a size_t rather than uint (essentially the same) since hcreate/hdestroy are now in <search.h>, remove private search.h in lib/libc/db/hash/ add $FreeBSD tags to hsearch.c
* Simplify sytem call renaming. Instead of _foo() <-- _libc_foo <-- foo(),jasone2000-01-272-14/+12
| | | | | | | | | | | | | | | | | just use _foo() <-- foo(). In the case of a libpthread that doesn't do call conversion (such as linuxthreads and our upcoming libpthread), this is adequate. In the case of libc_r, we still need three names, which are now _thread_sys_foo() <-- _foo() <-- foo(). Convert all internal libc usage of: aio_suspend(), close(), fsync(), msync(), nanosleep(), open(), fcntl(), read(), and write() to _foo() instead of foo(). Remove all internal libc usage of: creat(), pause(), sleep(), system(), tcdrain(), wait(), and waitpid(). Make thread cancellation fully POSIX-compliant. Suggested by: deischen
* Add three-tier symbol naming in support of POSIX thread cancellationjasone2000-01-122-12/+18
| | | | | | points. For library functions, the pattern is __sleep() <-- _libc_sleep() <-- sleep(). The arrows represent weak aliases. For system calls, the pattern is _read() <-- _libc_read() <-- read().
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Changed all paths to be relative to src/lib instead of src/lib/libcjb1997-05-031-2/+3
| | | | | | | | | | so that all these makefiles can be used to build libc_r too. Added .if ${LIB} == "c" tests to restrict man page builds to libc to avoid needlessly building them with libc_r too. Split libc Makefile into Makefile and Makefile.inc to allow the libc_r Makefile to include Makefile.inc too.
* Reviewed by: Bruce Evans <bde@freebsd.org>danny1997-02-151-0/+6
| | | | | Guard against possible buffer overrun in filename passed. Another candidate for 2.2.
* Back out most of the last backout. :-) Guido removed the 1.1.1.1->1.1.1.2peter1996-10-191-10/+18
| | | | | | changes from the vendor branch as well, backing the db-1.82 changes. This file should now be the same as it was in rev 1.1.1.2.
* Backout bzero patch.guido1996-10-181-21/+11
| | | | | | Somehow, I also managed to get quite some other changes in this file at the same time. All I did was checkout the file and made a single change. If someone has an explanation how these PURIFFY defines got in...
* When freeing buffers in the db routines, also zeroize themguido1996-10-171-1/+3
| | | | | | This should solve the bug where a coredumping ftpd reveals encrypted passwords. Obtained from: OpenBSD
* Bring in fixes to db 1.85 from NetBSD. These fixes have been documented aspst1996-07-212-16/+37
| | | | | being sent back to Bostic by the NetBSD crew. Obtained from: NetBSD-current
OpenPOWER on IntegriCloud