diff options
author | peter <peter@FreeBSD.org> | 1997-03-11 13:01:42 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1997-03-11 13:01:42 +0000 |
commit | 2083e11126e9022e069b7be58976843f8e734a2d (patch) | |
tree | eeb84d691e1aad12a04f39e32eda5ef40e69eaaa /usr.sbin/kvm_mkdb | |
parent | b1890e6c7c0cf820abebd6d4d9cd0fbe40f99563 (diff) | |
download | FreeBSD-src-2083e11126e9022e069b7be58976843f8e734a2d.zip FreeBSD-src-2083e11126e9022e069b7be58976843f8e734a2d.tar.gz |
Merge from Lite2 (use special dbopen flags)
Diffstat (limited to 'usr.sbin/kvm_mkdb')
-rw-r--r-- | usr.sbin/kvm_mkdb/kvm_mkdb.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/usr.sbin/kvm_mkdb/kvm_mkdb.c b/usr.sbin/kvm_mkdb/kvm_mkdb.c index b535f23..7a89484 100644 --- a/usr.sbin/kvm_mkdb/kvm_mkdb.c +++ b/usr.sbin/kvm_mkdb/kvm_mkdb.c @@ -38,7 +38,7 @@ static char copyright[] = #endif /* not lint */ #ifndef lint -static char sccsid[] = "@(#)kvm_mkdb.c 8.1 (Berkeley) 6/6/93"; +static char sccsid[] = "@(#)kvm_mkdb.c 8.3 (Berkeley) 5/4/95"; #endif /* not lint */ #include <sys/param.h> @@ -52,11 +52,21 @@ static char sccsid[] = "@(#)kvm_mkdb.c 8.1 (Berkeley) 6/6/93"; #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <unistd.h> #include "extern.h" static void usage __P((void)); +HASHINFO openinfo = { + 4096, /* bsize */ + 128, /* ffactor */ + 1024, /* nelem */ + 2048 * 1024, /* cachesize */ + NULL, /* hash() */ + 0 /* lorder */ +}; + int main(argc, argv) int argc; @@ -65,7 +75,6 @@ main(argc, argv) DB *db; int ch; char *p, *nlistpath, *nlistname, dbtemp[MAXPATHLEN], dbname[MAXPATHLEN]; - HASHINFO hdefault; while ((ch = getopt(argc, argv, "")) != EOF) switch (ch) { @@ -93,14 +102,8 @@ main(argc, argv) _PATH_VARDB, nlistname); (void)umask(0); - /* don't handicap db/hash by using the defaults... */ - memset(&hdefault,0,sizeof hdefault); - hdefault.bsize = getpagesize(); - hdefault.cachesize = 50*getpagesize(); - hdefault.nelem = 1000; - db = dbopen(dbtemp, O_CREAT | O_EXLOCK | O_TRUNC | O_RDWR, - S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH, DB_HASH, &hdefault); + S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH, DB_HASH, &openinfo); if (db == NULL) err(1, "%s", dbtemp); create_knlist(nlistpath, db); |