diff options
author | phk <phk@FreeBSD.org> | 1998-04-19 07:15:34 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1998-04-19 07:15:34 +0000 |
commit | 408ddd8b1cdf8d05eaeb7416b975dbf34b59738b (patch) | |
tree | 01d4b92ddf3937b495de932aa1220d9953543380 /usr.sbin/pwd_mkdb | |
parent | 6d7eb64b154e7f047a65106576dd82344464d1c4 (diff) | |
download | FreeBSD-src-408ddd8b1cdf8d05eaeb7416b975dbf34b59738b.zip FreeBSD-src-408ddd8b1cdf8d05eaeb7416b975dbf34b59738b.tar.gz |
Allow specification of cache-size to pwd_mkdb
PR: 5193
Reviewed by: phk
Submitted by: Nick Hilliard <nick@foobar.org>
Diffstat (limited to 'usr.sbin/pwd_mkdb')
-rw-r--r-- | usr.sbin/pwd_mkdb/pwd_mkdb.8 | 9 | ||||
-rw-r--r-- | usr.sbin/pwd_mkdb/pwd_mkdb.c | 7 |
2 files changed, 14 insertions, 2 deletions
diff --git a/usr.sbin/pwd_mkdb/pwd_mkdb.8 b/usr.sbin/pwd_mkdb/pwd_mkdb.8 index d097e7a..54abc76 100644 --- a/usr.sbin/pwd_mkdb/pwd_mkdb.8 +++ b/usr.sbin/pwd_mkdb/pwd_mkdb.8 @@ -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 diff --git a/usr.sbin/pwd_mkdb/pwd_mkdb.c b/usr.sbin/pwd_mkdb/pwd_mkdb.c index d8bf7af..2a8023e 100644 --- a/usr.sbin/pwd_mkdb/pwd_mkdb.c +++ b/usr.sbin/pwd_mkdb/pwd_mkdb.c @@ -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; |