Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 31 Aug 1999 18:29:58 -0700 (PDT)
From:      Jaye Mathisen <mrcpu@internetcds.com>
To:        hackers@freebsd.org
Subject:   Minor patches to pwd_mkdb
Message-ID:  <Pine.BSF.4.10.9908311826340.358-100000@schizo.cdsnet.net>

next in thread | raw e-mail | index | archive | help


Got tired of the dinky cachesize for pwd_mkdb, especially since vipw
doesn't take advantage of the -u or -s options.

So here a couple patches that make the cachesize tweakable from make.conf.

Dramatically helps on those 10-15k line password files.

I would appreciate it if somebody would at least consider committing
this...



*** Makefile.orig	Tue Aug 31 18:01:58 1999
--- Makefile	Tue Aug 31 18:22:05 1999
***************
*** 3,8 ****
  PROG=	pwd_mkdb
  SRCS=	pw_scan.c pwd_mkdb.c
  MAN8=	pwd_mkdb.8
! CFLAGS+= -DPASSWD_IGNORE_COMMENTS
  
  .include <bsd.prog.mk>
--- 3,23 ----
  PROG=	pwd_mkdb
  SRCS=	pw_scan.c pwd_mkdb.c
  MAN8=	pwd_mkdb.8
! PWD_MKDB_DEFAULT_CACHESIZE=2
! CFLAGS+= -DPASSWD_IGNORE_COMMENTS 
! 
! #
! # The cache size defaults to 2MB.  If you have a large passwd file
! # increasing the size of the cache will help.
! # There is a command line option to set this, however, it is not
! # set by vipw. 
! #
! 
! .if defined(PWD_MKDB_CACHESIZE)
! CFLAGS+= -DPWD_MKDB_DEFAULT_CACHESIZE=${PWD_MKDB_CACHESIZE}
! .else
! CFLAGS+= -DPWD_MKDB_DEFAULT_CACHESIZE=${PWD_MKDB_DEFAULT_CACHESIZE}
! .endif
! 
  
  .include <bsd.prog.mk>
*** pwd_mkdb.c.orig	Tue Aug 31 18:10:47 1999
--- pwd_mkdb.c	Tue Aug 31 18:12:04 1999
***************
*** 71,77 ****
  	4096,		/* bsize */
  	32,		/* ffactor */
  	256,		/* nelem */
! 	2048 * 1024,	/* cachesize */
  	NULL,		/* hash() */
  	0		/* lorder */
  };
--- 71,77 ----
  	4096,		/* bsize */
  	32,		/* ffactor */
  	256,		/* nelem */
! 	PWD_MKDB_DEFAULT_CACHESIZE * 1024 * 1024,	/* cachesize */
  	NULL,		/* hash() */
  	0		/* lorder */
  };



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.10.9908311826340.358-100000>