History log of /freebsd-10.0-release/lib/libc/db/hash/hash.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 259065 07-Dec-2013 gjb

- Copy stable/10 (r259064) to releng/10.0 as part of the
10.0-RELEASE cycle.
- Update __FreeBSD_version [1]
- Set branch name to -RC1

[1] 10.0-CURRENT __FreeBSD_version value ended at '55', so
start releng/10.0 at '100' so the branch is started with
a value ending in zero.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


# 254222 11-Aug-2013 jilles

db/hash: Use O_CLOEXEC instead of separate fcntl() call.

In particular, a hash db is used by getpwnam() and getpwuid().

MFC after: 1 week


# 206178 05-Apr-2010 avg

libc/db/hash: cap auto-tuned block size with a value that actually works

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


# 196525 24-Aug-2009 delphij

Consider flag == 0 as the same of flag == R_NEXT. This change will restore
a historical behavior that has been changed by revision 190491, and has seen
to break exim.


# 190496 28-Mar-2009 delphij

Plug memory leaks and a potential NULL dereference.

Obtained from: OpenBSD


# 190495 28-Mar-2009 delphij

Simplify the logic when determining whether to zero out a db file to after
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


# 190491 28-Mar-2009 delphij

Fix a crash when iterating over a hash and removing its elements.

Obtained from: OpenBSD


# 190489 28-Mar-2009 delphij

Diff reduce against OpenBSD, no functional change.


# 190486 28-Mar-2009 delphij

Use pread(2) and pwrite(2) instead of lseek(2) + read(2) / write(2).

Obtained from: NetBSD via OpenBSD


# 190484 28-Mar-2009 delphij

Several signed/unsigned warning fixes.


# 189291 02-Mar-2009 delphij

Diff reduction against OpenBSD: ANSI'fy prototypes.

(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)


# 169979 25-May-2007 delphij

The usage of "info" in init_hash() is read-only, so constify
the internal interface instead of casting away the constant
constraint upon calling.


# 165903 08-Jan-2007 imp

Per Regents of the University of Calfornia letter, remove advertising
clause.

# If I've done so improperly on a file, please let me know.


# 135024 10-Sep-2004 kuriyama

Fix format strings to unbreak with -DDEBUG option.


# 92905 21-Mar-2002 obrien

Remove __P() usage.


# 92889 21-Mar-2002 obrien

Remove 'register' keyword.


# 71579 24-Jan-2001 deischen

Remove _THREAD_SAFE and make libc thread-safe by default by
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


# 56698 27-Jan-2000 jasone

Simplify sytem call renaming. Instead of _foo() <-- _libc_foo <-- foo(),
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


# 55837 12-Jan-2000 jasone

Add three-tier symbol naming in support of POSIX thread cancellation
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().


# 17141 12-Jul-1996 jkh

General -Wall warning cleanup, part I.
Submitted-By: Kent Vander Velden <graphix@iastate.edu>


# 14287 27-Feb-1996 pst

Fix conflicts and merge into mainline


# 14244 25-Feb-1996 pst

move stat behind open to cover corner case


# 14213 23-Feb-1996 pst

If a .db file is 0 length, initialize it as if it did not exist.
Reviewed by: wollman


# 13545 21-Jan-1996 julian

Reviewed by: julian and (hsu?)
Submitted by: John Birrel(L?)

changes for threadsafe operations


# 1574 27-May-1994 rgrimes

This commit was generated by cvs2svn to compensate for changes in r1573,
which included commits to RCS files with non-trunk default branches.


# 1573 27-May-1994 rgrimes

BSD 4.4 Lite Lib Sources