Allow specification of cache-size to pwd_mkdb

PR:		5193
Reviewed by:	phk
Submitted by:	Nick Hilliard <nick@foobar.org>
This commit is contained in:
phk 1998-04-19 07:15:34 +00:00
parent 07df2a86ef
commit 8e227a9ce6
2 changed files with 14 additions and 2 deletions

View File

@ -42,6 +42,7 @@
.Op Fl C
.Op Fl p
.Op Fl d Ar directory
.Op Fl s Ar cachesize
.Op Fl u Ar username
.Ar file
.Sh DESCRIPTION
@ -76,6 +77,14 @@ Store databases into specified destination directory instead of
Only update the record for the specified user. Utilities that
operate on a single user can use this option to avoid the
overhead of rebuilding the entire database.
.It Fl s Ar cachesize
Specify in megabytes the size of the memory cache used by the
hashing library. On systems with a large user base, a small cache
size can lead to prohibitively long database file rebuild times.
As a rough guide, the memory usage of
.Nm pwd_mkdb
in megabytes will be a little bit more than twice the figure
specified here. The default is 2 megabytes.
.El
.Pp
The two databases differ in that the secure version contains the user's

View File

@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)pwd_mkdb.c 8.5 (Berkeley) 4/20/94";
#endif
static const char rcsid[] =
"$Id: pwd_mkdb.c,v 1.23 1998/02/16 19:08:18 guido Exp $";
"$Id: pwd_mkdb.c,v 1.24 1998/02/19 08:12:11 guido Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -114,7 +114,7 @@ main(argc, argv)
strcpy(prefix, _PATH_PWD);
makeold = 0;
username = NULL;
while ((ch = getopt(argc, argv, "Cd:pu:v")) != -1)
while ((ch = getopt(argc, argv, "Cd:ps:u:v")) != -1)
switch(ch) {
case 'C': /* verify only */
Cflag = 1;
@ -125,6 +125,9 @@ main(argc, argv)
case 'p': /* create V7 "file.orig" */
makeold = 1;
break;
case 's': /* change default cachesize */
openinfo.cachesize = atoi(optarg) * 1024 * 1024;
break;
case 'u': /* only update this record */
username = optarg;
break;