summaryrefslogtreecommitdiffstats
path: root/usr.bin/cap_mkdb
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2005-02-19 23:59:49 +0000
committerru <ru@FreeBSD.org>2005-02-19 23:59:49 +0000
commit5e18103b15cd4c0c99aad059da75384e2c53665c (patch)
tree9dbc4167b478629cfecfc39ed94a8ab4c55fe238 /usr.bin/cap_mkdb
parent3a53fc798b91fe68583460ed8c7f152aa306d47a (diff)
downloadFreeBSD-src-5e18103b15cd4c0c99aad059da75384e2c53665c.zip
FreeBSD-src-5e18103b15cd4c0c99aad059da75384e2c53665c.tar.gz
Fixate the hash bucket size to 4K. We were using the default,
which is stat.st_blksize (i.e., PAGE_SIZE). This change causes the .db files that were cross-compiled on another platform to be identical to the natively built ones. Tested on: alpha->amd64 build
Diffstat (limited to 'usr.bin/cap_mkdb')
-rw-r--r--usr.bin/cap_mkdb/cap_mkdb.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/usr.bin/cap_mkdb/cap_mkdb.c b/usr.bin/cap_mkdb/cap_mkdb.c
index 4b8bf20..2cb0bed 100644
--- a/usr.bin/cap_mkdb/cap_mkdb.c
+++ b/usr.bin/cap_mkdb/cap_mkdb.c
@@ -39,7 +39,7 @@ static const char copyright[] =
#if 0
#ifndef lint
-static char sccsid[] = "@(#)cap_mkdb.c 8.1 (Berkeley) 6/6/93";
+static char sccsid[] = "@(#)cap_mkdb.c 8.2 (Berkeley) 4/27/95";
#endif
#endif
@@ -65,6 +65,15 @@ DB *capdbp;
int verbose;
char *capdb, *capname, buf[8 * 1024];
+HASHINFO openinfo = {
+ 4096, /* bsize */
+ 0, /* ffactor */
+ 0, /* nelem */
+ 0, /* cachesize */
+ NULL, /* hash() */
+ 0 /* lorder */
+};
+
/*
* Mkcapdb creates a capability hash database for quick retrieval of capability
* records. The database contains 2 types of entries: records and references
@@ -104,8 +113,8 @@ main(int argc, char *argv[])
(void)snprintf(buf, sizeof(buf), "%s.db", capname ? capname : *argv);
if ((capname = strdup(buf)) == NULL)
errx(1, "strdup failed");
- if ((capdbp = dbopen(capname,
- O_CREAT | O_TRUNC | O_RDWR, DEFFILEMODE, DB_HASH, NULL)) == NULL)
+ if ((capdbp = dbopen(capname, O_CREAT | O_TRUNC | O_RDWR,
+ DEFFILEMODE, DB_HASH, &openinfo)) == NULL)
err(1, "%s", buf);
if (atexit(dounlink))
OpenPOWER on IntegriCloud