aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog13
-rw-r--r--NEWS51
-rw-r--r--db/Makefile28
-rw-r--r--db/btree/bt_close.c182
-rw-r--r--db/btree/bt_conv.c221
-rw-r--r--db/btree/bt_debug.c329
-rw-r--r--db/btree/bt_delete.c657
-rw-r--r--db/btree/bt_get.c105
-rw-r--r--db/btree/bt_open.c444
-rw-r--r--db/btree/bt_overflow.c228
-rw-r--r--db/btree/bt_page.c98
-rw-r--r--db/btree/bt_put.c320
-rw-r--r--db/btree/bt_search.c213
-rw-r--r--db/btree/bt_seq.c460
-rw-r--r--db/btree/bt_split.c827
-rw-r--r--db/btree/bt_utils.c260
-rw-r--r--db/btree/btree.h383
-rw-r--r--db/btree/extern.h70
-rw-r--r--db/compat.h49
-rw-r--r--db/db.h236
-rw-r--r--db/db/db.c99
-rw-r--r--db/hash/extern.h65
-rw-r--r--db/hash/hash.c994
-rw-r--r--db/hash/hash.h293
-rw-r--r--db/hash/hash_bigkey.c667
-rw-r--r--db/hash/hash_buf.c355
-rw-r--r--db/hash/hash_func.c212
-rw-r--r--db/hash/hash_log2.c54
-rw-r--r--db/hash/hash_page.c944
-rw-r--r--db/hash/ndbm.c202
-rw-r--r--db/hash/page.h92
-rw-r--r--db/mpool.h99
-rw-r--r--db/mpool/mpool.c463
-rw-r--r--db/ndbm.h77
-rw-r--r--db/recno/extern.h54
-rw-r--r--db/recno/rec_close.c182
-rw-r--r--db/recno/rec_delete.c197
-rw-r--r--db/recno/rec_get.c311
-rw-r--r--db/recno/rec_open.c241
-rw-r--r--db/recno/rec_put.c280
-rw-r--r--db/recno/rec_search.c126
-rw-r--r--db/recno/rec_seq.c131
-rw-r--r--db/recno/rec_utils.c122
-rw-r--r--db/recno/recno.h39
-rw-r--r--hurd/hurd/signal.h49
-rw-r--r--hurd/hurd/sigpreempt.h90
-rw-r--r--hurd/preempt-sig.c83
-rw-r--r--sysdeps/mach/hurd/jmp-unwind.c18
-rw-r--r--sysdeps/unix/sysv/linux/sys/param.h40
49 files changed, 11649 insertions, 104 deletions
diff --git a/ChangeLog b/ChangeLog
index 5edb92e6ac..53f44887a9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
Tue Jan 2 00:50:10 1996 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+ * hurd/hurd/signal.h (struct hurd_sigstate): New member `preempters'.
+ (hurd_preempt_signals, hurd_unpreempt_signals): Decls removed.
+ * hurd/hurd/sigpreempt.h: New file.
+ * hurd/preempt-sig.c: Rewritten with new interface.
+ * sysdeps/mach/hurd/jmp-unwind.c (_longjmp_unwind): Remove local signal
+ preempters being unwound past.
+
+ * db: New directory, 4.4 BSD db package incorporated from BSD db-1.85
+ release.
+
+ * sysdeps/unix/sysv/linux/sys/param.h: Several new macros for BSD
+ compatibility.
+
* misc/queue.h: New file, incorporated from 4.4BSD.
* misc/Makefile (headers): Add queue.h.
diff --git a/NEWS b/NEWS
index a20648f6a9..c5b0d45c49 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,6 @@
-GNU C Library NEWS -- history of user-visible changes. 26 July 1995
+GNU C Library NEWS -- history of user-visible changes. 2 January 1996
-Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
+Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
See the end for copying conditions.
Please send GNU C library bug reports to bug-glibc@prep.ai.mit.edu.
@@ -32,6 +32,11 @@ Version 1.10
new header file <link.h> gives access to the internals of the run-time
dynamic linker, `ld.so'.
+* The C library now provides the run-time support code for profiling
+ executables compiled with `-pg'. Programs can control the profiling code
+ through the interface in <sys/gmon.h>. The profiling code was adapted
+ from 4.4 BSD-Lite.
+
* The new functions `strtoq' and `strtouq' parse integer values from
strings, like `strtol' and `strtoul', but they return `long long int' and
`unsigned long long int' values, respectively (64-bit quantities).
@@ -48,7 +53,7 @@ Version 1.10
* The new header <langinfo.h> defines an interface for accessing
various locale-dependent data (using the locale chosen with `setlocale').
-* You can now use positional parameter specifications in format strings
+* You can now use positional parameter specifications in format strings
for the `printf' and `scanf' families of functions. For example,
`printf ("Number %2$d, Mr %1$s\n", "Jones", 6);'' prints
``Number 6, Mr Jones''. This is mainly useful when providing different
@@ -75,7 +80,7 @@ Version 1.10
* The new header file <fts.h> and suite of functions simplify programs that
operate on directory trees. This code comes from 4.4 BSD.
-* The resolver code has been updated from the BIND-4.9.3-BETA26 release.
+* The resolver code has been updated from the BIND 4.9.3 release.
* The new function `malloc_find_object_address' finds the starting address
of a malloc'd block, given any address within the block. This can be
@@ -123,13 +128,45 @@ Version 1.10
* Ulrich Drepper has contributed new, highly-optimized versions of several
string functions for the i486/Pentium family of processors.
-* Ulrich Drepper has updated the Linux-specific code, based largely
+* Ulrich Drepper has updated the Linux-specific code, based largely
on work done in Hongjiu Lu's version of GNU libc for Linux.
The GNU library now supports Linux versions 1.3.29 and later,
using the ELF object file format (i[345]86-*-linux).
* Ulrich Drepper has contributed a new set of message catalog functions to
support multiple languages, for use with his new package GNU gettext.
+
+* New header file <values.h> gives SVID-compatible names for <limits.h>
+ constants.
+
+* Various new macros, declarations, and small header files for compatibility
+ with 4.4 BSD.
+
+* New function `group_member' is a convenient way to check if a process has
+ a given effective group ID.
+
+* When using GCC 2.7 and later, the socket functions are now declared in a
+ special way so that passing an argument of type `struct sockaddr_in *',
+ `struct sockaddr_ns *', or `struct sockaddr_un *' instead of the generic
+ `struct sockaddr *' type, does not generate a type-clash warning.
+
+* New function `error' declared in header file <error.h> is a convenient
+ function for printing error messages and optionally exitting; this is the
+ canonical function used in GNU programs. The new functions `err', `warn',
+ and friends in header file <err.h> are the canonical 4.4 BSD interface for
+ doing the same thing.
+
+* The <glob.h> interface has several new flags from 4.4 BSD that extend the
+ POSIX.2 `glob' function to do ~ and {...} expansion.
+
+* New function `unsetenv' complements `setenv' for compatibility with 4.4 BSD.
+
+* New function `getsid' returns session ID number on systems that support it.
+
+* The 4.4 BSD `db' library has been incorporated into the GNU C library.
+ New header files <db.h> and <mpool.h> provide a rich set of functions for
+ several types of simple databases stored in memory and in files, and
+ <ndbm.h> is an old `ndbm'-compatbile interface using the `db' functions.
Version 1.09
@@ -362,7 +399,7 @@ Version 1.04
compiler, so the C library should now work with C++ code.
* The header file <bstring.h> is gone. <string.h> now declares bcopy,
- bcmp, bzero, and ffs.
+ bcmp, bzero, and ffs.
* Mike Haertel (of GNU e?grep and malloc fame) has written a new sorting
function which uses the `merge sort' algorithm, and is said to be
@@ -388,7 +425,7 @@ Version 1.04
----------------------------------------------------------------------
Copyright information:
-Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
+Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
Permission is granted to anyone to make or distribute verbatim copies
of this document as received, in any medium, provided that the
diff --git a/db/Makefile b/db/Makefile
new file mode 100644
index 0000000000..c7a385a486
--- /dev/null
+++ b/db/Makefile
@@ -0,0 +1,28 @@
+# Makefile for 4.4BSD db code in GNU C library.
+# This code is taken verbatim from the BSD db 1.85 package. Only this
+# Makefile and compat.h were written for GNU libc, and the header files
+# moved up to this directory.
+
+subdir = db
+
+dbdirs = btree db hash mpool recno
+vpath %.c $(dbdirs)
+
+routines := bt_close bt_conv bt_debug bt_delete bt_get bt_open bt_overflow \
+ bt_page bt_put bt_search bt_seq bt_split bt_utils \
+ db \
+ hash hash_bigkey hash_buf hash_func hash_log2 hash_page \
+ ndbm \
+ mpool \
+ rec_close rec_delete rec_get rec_open rec_put rec_search \
+ rec_seq rec_utils
+
+headers := db.h mpool.h ndbm.h
+distribute := compat.h \
+ btree/btree.h btree/extern.h \
+ hash/extern.h hash/hash.h hash/page.h \
+ recno/extern.h recno/recno.h
+
+include ../Rules
+
+CPPFLAGS += -D__DBINTERFACE_PRIVATE
diff --git a/db/btree/bt_close.c b/db/btree/bt_close.c
new file mode 100644
index 0000000000..27f9ab660f
--- /dev/null
+++ b/db/btree/bt_close.c
@@ -0,0 +1,182 @@
+/*-
+ * Copyright (c) 1990, 1993, 1994
+ * The Regents of the University of California. All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Mike Olson.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static char sccsid[] = "@(#)bt_close.c 8.7 (Berkeley) 8/17/94";
+#endif /* LIBC_SCCS and not lint */
+
+#include <sys/param.h>
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <db.h>
+#include "btree.h"
+
+static int bt_meta __P((BTREE *));
+
+/*
+ * BT_CLOSE -- Close a btree.
+ *
+ * Parameters:
+ * dbp: pointer to access method
+ *
+ * Returns:
+ * RET_ERROR, RET_SUCCESS
+ */
+int
+__bt_close(dbp)
+ DB *dbp;
+{
+ BTREE *t;
+ int fd;
+
+ t = dbp->internal;
+
+ /* Toss any page pinned across calls. */
+ if (t->bt_pinned != NULL) {
+ mpool_put(t->bt_mp, t->bt_pinned, 0);
+ t->bt_pinned = NULL;
+ }
+
+ /* Sync the tree. */
+ if (__bt_sync(dbp, 0) == RET_ERROR)
+ return (RET_ERROR);
+
+ /* Close the memory pool. */
+ if (mpool_close(t->bt_mp) == RET_ERROR)
+ return (RET_ERROR);
+
+ /* Free random memory. */
+ if (t->bt_cursor.key.data != NULL) {
+ free(t->bt_cursor.key.data);
+ t->bt_cursor.key.size = 0;
+ t->bt_cursor.key.data = NULL;
+ }
+ if (t->bt_rkey.data) {
+ free(t->bt_rkey.data);
+ t->bt_rkey.size = 0;
+ t->bt_rkey.data = NULL;
+ }
+ if (t->bt_rdata.data) {
+ free(t->bt_rdata.data);
+ t->bt_rdata.size = 0;
+ t->bt_rdata.data = NULL;
+ }
+
+ fd = t->bt_fd;
+ free(t);
+ free(dbp);
+ return (close(fd) ? RET_ERROR : RET_SUCCESS);
+}
+
+/*
+ * BT_SYNC -- sync the btree to disk.
+ *
+ * Parameters:
+ * dbp: pointer to access method
+ *
+ * Returns:
+ * RET_SUCCESS, RET_ERROR.
+ */
+int
+__bt_sync(dbp, flags)
+ const DB *dbp;
+ u_int flags;
+{
+ BTREE *t;
+ int status;
+
+ t = dbp->internal;
+
+ /* Toss any page pinned across calls. */
+ if (t->bt_pinned != NULL) {
+ mpool_put(t->bt_mp, t->bt_pinned, 0);
+ t->bt_pinned = NULL;
+ }
+
+ /* Sync doesn't currently take any flags. */
+ if (flags != 0) {
+ errno = EINVAL;
+ return (RET_ERROR);
+ }
+
+ if (F_ISSET(t, B_INMEM | B_RDONLY) || !F_ISSET(t, B_MODIFIED))
+ return (RET_SUCCESS);
+
+ if (F_ISSET(t, B_METADIRTY) && bt_meta(t) == RET_ERROR)
+ return (RET_ERROR);
+
+ if ((status = mpool_sync(t->bt_mp)) == RET_SUCCESS)
+ F_CLR(t, B_MODIFIED);
+
+ return (status);
+}
+
+/*
+ * BT_META -- write the tree meta data to disk.
+ *
+ * Parameters:
+ * t: tree
+ *
+ * Returns:
+ * RET_ERROR, RET_SUCCESS
+ */
+static int
+bt_meta(t)
+ BTREE *t;
+{
+ BTMETA m;
+ void *p;
+
+ if ((p = mpool_get(t->bt_mp, P_META, 0)) == NULL)
+ return (RET_ERROR);
+
+ /* Fill in metadata. */
+ m.magic = BTREEMAGIC;
+ m.version = BTREEVERSION;
+ m.psize = t->bt_psize;
+ m.free = t->bt_free;
+ m.nrecs = t->bt_nrecs;
+ m.flags = F_ISSET(t, SAVEMETA);
+
+ memmove(p, &m, sizeof(BTMETA));
+ mpool_put(t->bt_mp, p, MPOOL_DIRTY);
+ return (RET_SUCCESS);
+}
diff --git a/db/btree/bt_conv.c b/db/btree/bt_conv.c
new file mode 100644
index 0000000000..1cb208b14d
--- /dev/null
+++ b/db/btree/bt_conv.c
@@ -0,0 +1,221 @@
+/*-
+ * Copyright (c) 1990, 1993, 1994
+ * The Regents of the University of California. All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Mike Olson.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static char sccsid[] = "@(#)bt_conv.c 8.5 (Berkeley) 8/17/94";
+#endif /* LIBC_SCCS and not lint */