summaryrefslogtreecommitdiff
path: root/lib/libc/db
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2004-05-03 17:27:51 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2004-05-03 17:27:51 +0000
commit3ce312b75c1e80c476cd991ad38c1782f4893aaf (patch)
treef9107855b4792133eaf87c62d2fc0e87def1c7ea /lib/libc/db
parentc1f0251976473d54cc4d46ef0dbfd8a4e2910904 (diff)
Make ndbm match POSIX. A datum consists of a void *dptr and a size_t dsize.
Also make the open functions take a mode_t, not int. OK deraadt@
Diffstat (limited to 'lib/libc/db')
-rw-r--r--lib/libc/db/hash/ndbm.c12
-rw-r--r--lib/libc/db/man/dbm.36
-rw-r--r--lib/libc/db/man/ndbm.39
3 files changed, 15 insertions, 12 deletions
diff --git a/lib/libc/db/hash/ndbm.c b/lib/libc/db/hash/ndbm.c
index 6187996e97f..f8c5242d8f9 100644
--- a/lib/libc/db/hash/ndbm.c
+++ b/lib/libc/db/hash/ndbm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ndbm.c,v 1.17 2003/06/25 21:15:05 deraadt Exp $ */
+/* $OpenBSD: ndbm.c,v 1.18 2004/05/03 17:27:50 millert Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -36,7 +36,7 @@
#if 0
static char sccsid[] = "@(#)dbm.c 8.6 (Berkeley) 11/7/95";
#else
-static const char rcsid[] = "$OpenBSD: ndbm.c,v 1.17 2003/06/25 21:15:05 deraadt Exp $";
+static const char rcsid[] = "$OpenBSD: ndbm.c,v 1.18 2004/05/03 17:27:50 millert Exp $";
#endif
#endif /* LIBC_SCCS and not lint */
@@ -59,7 +59,7 @@ static const char rcsid[] = "$OpenBSD: ndbm.c,v 1.17 2003/06/25 21:15:05 deraadt
*/
static DBM *__cur_db;
-static DBM *_dbm_open(const char *, const char *, int, int);
+static DBM *_dbm_open(const char *, const char *, int, mode_t);
/*
* Returns:
@@ -192,7 +192,8 @@ static DBM *
_dbm_open(file, suff, flags, mode)
const char *file;
const char *suff;
- int flags, mode;
+ int flags;
+ mode_t mode;
{
HASHINFO info;
char path[MAXPATHLEN];
@@ -224,7 +225,8 @@ _dbm_open(file, suff, flags, mode)
DBM *
dbm_open(file, flags, mode)
const char *file;
- int flags, mode;
+ int flags;
+ mode_t mode;
{
return(_dbm_open(file, DBM_SUFFIX, flags, mode));
diff --git a/lib/libc/db/man/dbm.3 b/lib/libc/db/man/dbm.3
index 654f981a82c..c2df560ab5b 100644
--- a/lib/libc/db/man/dbm.3
+++ b/lib/libc/db/man/dbm.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: dbm.3,v 1.8 2003/06/17 21:56:23 millert Exp $
+.\" $OpenBSD: dbm.3,v 1.9 2004/05/03 17:27:50 millert Exp $
.\"
.\" Copyright (c) 1999 Todd C. Miller <Todd.Miller@courtesan.com>
.\"
@@ -53,8 +53,8 @@ The key and the content data are described by the
data structure:
.Bd -literal -offset indent
typedef struct {
- char *dptr;
- int dsize;
+ void *dptr;
+ size_t dsize;
} datum
.Ed
.Pp
diff --git a/lib/libc/db/man/ndbm.3 b/lib/libc/db/man/ndbm.3
index 7fa96e6032c..5eb62fb810a 100644
--- a/lib/libc/db/man/ndbm.3
+++ b/lib/libc/db/man/ndbm.3
@@ -1,5 +1,5 @@
.\" David Leonard, 1998. Placed in the public domain.
-.\" $OpenBSD: ndbm.3,v 1.13 2003/10/21 20:30:16 jmc Exp $
+.\" $OpenBSD: ndbm.3,v 1.14 2004/05/03 17:27:50 millert Exp $
.Dd May 13, 1998
.Dt NDBM 3
.Os
@@ -35,7 +35,7 @@
.Ft datum
.Fn dbm_nextkey "DBM *db"
.Ft "DBM *"
-.Fn dbm_open "const char *file" "int flags" "int mode"
+.Fn dbm_open "const char *file" "int flags" "mode_t mode"
.Ft int
.Fn dbm_pagfno "DBM *db"
.Ft int
@@ -51,8 +51,8 @@ The key and the content data are described by the
data structure:
.Bd -literal -offset indent
typedef struct {
- char *dptr;
- int dsize;
+ void *dptr;
+ size_t dsize;
} datum
.Ed
.Pp
@@ -198,4 +198,5 @@ and corresponds to those errors described in
.Sh SEE ALSO
.Xr open 2 ,
.Xr db 3 ,
+.Xr dbm 3 ,
.Xr hash 3