summaryrefslogtreecommitdiff
path: root/lib/libc/db
Commit message (Collapse)AuthorAgeFilesLines
* Remove the SYMVER build option.John Baldwin2020-04-301-4/+2
| | | | | | | | | | | | | | This option was added as a transition aide when symbol versioning was first added. It was enabled by default in 2007 and is supported even by the old GPLv2 binutils. Trying to disable it currently fails to build in libc and at this point it isn't worth fixing the build. Reported by: Michael Dexter Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D24637 Notes: svn path=/head/; revision=360511
* Remove "All rights reserved" from my files.Xin LI2018-05-101-1/+0
| | | | | | | | | See r333391 for the rationale. MFC after: 1 week Notes: svn path=/head/; revision=333449
* libc: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-251-0/+2
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using mis-identified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326193
* General further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-2046-0/+92
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326025
* Renumber copyright clause 4Warner Losh2017-02-2851-51/+51
| | | | | | | | | | | | Renumber cluase 4 to 3, per what everybody else did when BSD granted them permission to remove clause 3. My insistance on keeping the same numbering for legal reasons is too pedantic, so give up on that point. Submitted by: Jan Schaumann <jschauma@stevens.edu> Pull Request: https://github.com/freebsd/freebsd/pull/96 Notes: svn path=/head/; revision=314436
* hash(3): protect in-memory page when using cross-endianness.Pedro F. Giffuni2016-09-261-4/+9
| | | | | | | | | | 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) Notes: svn path=/head/; revision=306349
* btree(3): don't shortcut closing if the metadata is dirty.Pedro F. Giffuni2016-09-261-1/+2
| | | | | | | | | Obtained from: NetBSD (from krb5 tree) MFC after: 3 weeks Notes: svn path=/head/; revision=306332
* Fix prototype of dbm_open().Ed Schouten2016-05-312-2/+2
| | | | | | | | | | | The last argument of dbm_open() should be a mode_t according to POSIX; not an int. Reviewed by: pfg, kib Differential Revision: https://reviews.freebsd.org/D6650 Notes: svn path=/head/; revision=301066
* Let dbm's datum::dptr use the right type.Ed Schouten2016-05-301-2/+2
| | | | | | | | | | | | According to POSIX, it should use void *, not char *. Unfortunately, the dsize field also has the wrong type. It should be size_t. I'm not going to change that, as that will break the ABI. Reviewed by: pfg Differential Revision: https://reviews.freebsd.org/D6647 Notes: svn path=/head/; revision=300999
* libc: make more use of the howmany() macro when available.Pedro F. Giffuni2016-04-262-3/+2
| | | | | | | | We have a howmany() macro in the <sys/param.h> header that is convenient to re-use as it makes things easier to read. Notes: svn path=/head/; revision=298600
* libc: use our roundup2/rounddown2() macros when param.h is available.Pedro F. Giffuni2016-04-201-1/+1
| | | | | | | | rounddown2 tends to produce longer lines than the original code but still it makes the code more readable. Notes: svn path=/head/; revision=298323
* libc: do not include <sys/types.h> where <sys/param.h> was already includedAndriy Voskoboinyk2016-04-181-1/+0
| | | | | | | | | According to style(9): > normally, include <sys/types.h> OR <sys/param.h>, but not both. (<sys/param.h> already includes <sys/types.h> when LOCORE is not defined). Notes: svn path=/head/; revision=298226
* libc: replace 0 with NULL for pointers.Pedro F. Giffuni2016-04-102-3/+3
| | | | | | | | | | | | While here also cleanup some surrounding code; particularly drop some malloc() casts. Found with devel/coccinelle. Reviewed by: bde (previous version - all new bugs are mine) Notes: svn path=/head/; revision=297790
* Follow-up r295924: Only sync hash-based db files open for writing when closing.Bryan Drewery2016-04-061-1/+2
| | | | | | | | | | | | | | This fixes a major performance regression when reading db files such as the pw database during a 'pkg install'. MFC after: 1 week Tested by: bapt Reviewed by: bapt Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D5868 Notes: svn path=/head/; revision=297626
* libc: don't build compat functions if building WITHOUT_SYMVEREd Maste2016-03-151-1/+4
| | | | | | | | | | WITHOUT_SYMVER necessarily implies building a system without symver backwards compatability. Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=296915
* Allow O_CLOEXEC to be used in dbopen() flagsKurt Lidl2016-03-061-1/+5
| | | | | | | | | | | | There is also a small portability crutch, also present in NetBSD, to allow compiling on a system that doesn't define O_CLOEXEC. Approved by: rpaulo (mentor) Obtained from: NetBSD (r1.17, r1.18) Differential Revision: https://reviews.freebsd.org/D5549 Notes: svn path=/head/; revision=296423
* db(3): Fix aliasing warnings from modern GCC.Pedro F. Giffuni2016-02-241-3/+2
| | | | | | | | | While here also drop a malloc cast. Obtained from: NetBSD (CVS Rev. 1.18 - 1.20) Notes: svn path=/head/; revision=295975
* db(3): Fix aliasing warnings from modern GCC.Pedro F. Giffuni2016-02-241-6/+12
| | | | | | | Obtained from: NetBSD (CVS Rev. 1.20) Notes: svn path=/head/; revision=295973
* If we close or sync a hash-based db file, make sure to call fsync toDavid Malone2016-02-231-1/+5
| | | | | | | | | | | | make sure the changes are on disk. The people at pfSense noticed that it didn't always make it to the disk soon enough with soft updates. Differential Revision: https://reviews.freebsd.org/D5186 Reviewed by: garga, vangyzen, bapt, se MFC after: 1 week Notes: svn path=/head/; revision=295924
* Use intptr_t note ptrdiff_t when storing flags in the bottom bits ofBrooks Davis2016-01-292-6/+6
| | | | | | | | | | pointers. Obtained from: CheriBSD (e3a69027cc5a384431156d61c90d4304387a9b9d) Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=295031
* Use ANSI C prototypes. Eliminates -Wold-style-definition warnings.Craig Rodrigues2015-09-201-25/+10
| | | | Notes: svn path=/head/; revision=288042
* db/recno: Open with close-on-exec like btree and hash do.Jilles Tjoelker2015-09-131-1/+1
| | | | Notes: svn path=/head/; revision=287761
* Switch libc from using _sig{procmask,action,suspend} symbols, whichKonstantin Belousov2015-08-292-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | are aliases for the syscall stubs and are plt-interposed, to the libc-private aliases of internally interposed sigprocmask() etc. Since e.g. _sigaction is not interposed by libthr, calling signal() removes thr_sighandler() from the handler slot etc. The result was breaking signal semantic and rtld locking. The added __libc_sigprocmask and other symbols are hidden, they are not exported and cannot be called through PLT. The setjmp/longjmp functions for x86 were changed to use direct calls, and since PIC_PROLOGUE only needed for functional PLT indirection on i386, it is removed as well. The PowerPC bug of calling the syscall directly in the setjmp/longjmp implementation is kept as is. Reported by: Pete French <petefrench@ingresso.co.uk> Tested by: Michiel Boland <boland37@xs4all.nl> Reviewed by: jilles (previous version) Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=287292
* Drop some unnecessary casts.Pedro F. Giffuni2015-05-181-4/+3
| | | | | | | | Reported by: Clang static analyzer Obtained from: NetBSD Notes: svn path=/head/; revision=283068
* dbm_delete(3) correct man page to match current behaviour.Pedro F. Giffuni2015-02-201-4/+2
| | | | | | | | | | | | | | | "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 MFC after: 3 days Notes: svn path=/head/; revision=279037
* Let __bt_put() accept the R_SETCURSOR flag, as stated in the dbopen(3) manpage.Jeremie Le Hen2014-03-061-1/+2
| | | | | | | | | | While here, update the comment above with all the accepted flags. Reviewed by: silence on hackers@ MFC after: 2 weeks Notes: svn path=/head/; revision=262826
* Replace use of ${.CURDIR} by ${LIBC_SRCTOP} and define ${LIBC_SRCTOP}Marcel Moolenaar2014-03-047-13/+13
| | | | | | | | | | | | | | if not already defined. This allows building libc from outside of lib/libc using a reach-over makefile. A typical use-case is to build a standard ILP32 version and a COMPAT32 version in a single iteration by building the COMPAT32 version using a reach-over makefile. Obtained from: Juniper Networks, Inc. Notes: svn path=/head/; revision=262722
* db: Use O_CLOEXEC instead of separate fcntl() call.Jilles Tjoelker2013-08-132-8/+3
| | | | Notes: svn path=/head/; revision=254289
* db/hash: Use O_CLOEXEC instead of separate fcntl() call.Jilles Tjoelker2013-08-111-2/+1
| | | | | | | | | In particular, a hash db is used by getpwnam() and getpwuid(). MFC after: 1 week Notes: svn path=/head/; revision=254222
* Globally replace u_int*_t from (non-contributed) man pages.Ed Schouten2012-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 Notes: svn path=/head/; revision=231564
* Fix clang warnings.Ben Laurie2011-06-181-3/+4
| | | | | | | Approved by: philip (mentor) Notes: svn path=/head/; revision=223262
* The flags argument of mpool_get() is meaningful, document it.Xin LI2011-06-181-2/+9
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=223214
* Bump dates in dbopen(3) and cpuset_getaffinity(2) from r212441 andGlen Barber2010-09-121-1/+1
| | | | | | | | | | r212438, repectively. Approved by: keramida (mentor) MFC after: 1 week Notes: svn path=/head/; revision=212492
* Note O_SYNC and O_NOFOLLOW flags in dbopen(3) since r190497.Glen Barber2010-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 Notes: svn path=/head/; revision=212441
* libc/db/hash: cap auto-tuned block size with a value that actually worksAndriy Gapon2010-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 Notes: svn path=/head/; revision=206178
* hash.3: fix a factual mistake in the man pageAndriy Gapon2010-04-051-1/+1
| | | | | | | | | PR: bin/144446 Submitted by: Peter Jeremy <peterjeremy@acm.org> MFC after: 3 days Notes: svn path=/head/; revision=206177
* Consider flag == 0 as the same of flag == R_NEXT. This change will restoreXin LI2009-08-241-2/+2
| | | | | | | | a historical behavior that has been changed by revision 190491, and has seen to break exim. Notes: svn path=/head/; revision=196525
* Update SCCS IDs for Berkeley DB 1.86 merge.Xin LI2009-06-242-2/+2
| | | | Notes: svn path=/head/; revision=194804
* style: operators should appear at the line end if we have to wrap.Xin LI2009-06-241-2/+2
| | | | Notes: svn path=/head/; revision=194803
* Add some casts to silence compiler warning about signedness.Xin LI2009-03-282-3/+3
| | | | Notes: svn path=/head/; revision=190500
* Minor changes from Berkeley DB 1.86 and further improvements from OpenBSD.Xin LI2009-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 Notes: svn path=/head/; revision=190498
* Allow O_SYNC and O_NOFOLLOW flags in dbopen().Xin LI2009-03-281-2/+2
| | | | | | | Obtained from: OpenBSD Notes: svn path=/head/; revision=190497
* Plug memory leaks and a potential NULL dereference.Xin LI2009-03-281-4/+12
| | | | | | | Obtained from: OpenBSD Notes: svn path=/head/; revision=190496
* Simplify the logic when determining whether to zero out a db file to afterXin LI2009-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 Notes: svn path=/head/; revision=190495
* - If (keysize+datasize)%(bsize=14)==0, insertion of a `big key' would causeXin LI2009-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 Notes: svn path=/head/; revision=190494
* Avoid NULL deference which causes DEBUG1 to crash, not to print usefulXin LI2009-03-281-1/+1
| | | | | | | | | information. Obtained from: OpenBSD Notes: svn path=/head/; revision=190493
* - Avoid overwriting the cursor page when the cursor page becomes theXin LI2009-03-281-1/+21
| | | | | | | | | | LRU page. - Fix for sequential retrieval failure when using large key/data pairs. Obtained from: OpenBSD Notes: svn path=/head/; revision=190492
* Fix a crash when iterating over a hash and removing its elements.Xin LI2009-03-282-11/+21
| | | | | | | Obtained from: OpenBSD Notes: svn path=/head/; revision=190491
* Only squeeze a short key/value pair onto a page with other complete key/valueXin LI2009-03-281-3/+9
| | | | | | | | | pairs, not onto a page containing the end of a big pair. Obtained from: NetBSD via OpenBSD Notes: svn path=/head/; revision=190490
* Diff reduce against OpenBSD, no functional change.Xin LI2009-03-282-12/+6
| | | | Notes: svn path=/head/; revision=190489