From 580c9975cd5d695c91c2bdbc315bc557ac661d30 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Tue, 6 Oct 1998 18:09:51 +0000 Subject: crank RLIMIT_DATA, seems to be necessary for some people --- usr.sbin/kvm_mkdb/kvm_mkdb.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'usr.sbin') diff --git a/usr.sbin/kvm_mkdb/kvm_mkdb.c b/usr.sbin/kvm_mkdb/kvm_mkdb.c index e745504f27b..1222e6f9b53 100644 --- a/usr.sbin/kvm_mkdb/kvm_mkdb.c +++ b/usr.sbin/kvm_mkdb/kvm_mkdb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kvm_mkdb.c,v 1.5 1998/08/23 00:57:14 millert Exp $ */ +/* $OpenBSD: kvm_mkdb.c,v 1.6 1998/10/06 18:09:50 millert Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -43,7 +43,7 @@ static char copyright[] = #if 0 static char sccsid[] = "from: @(#)kvm_mkdb.c 8.3 (Berkeley) 5/4/95"; #else -static char *rcsid = "$OpenBSD: kvm_mkdb.c,v 1.5 1998/08/23 00:57:14 millert Exp $"; +static char *rcsid = "$OpenBSD: kvm_mkdb.c,v 1.6 1998/10/06 18:09:50 millert Exp $"; #endif #endif /* not lint */ @@ -61,6 +61,10 @@ static char *rcsid = "$OpenBSD: kvm_mkdb.c,v 1.5 1998/08/23 00:57:14 millert Exp #include #include +#include +#include +#include + #include "extern.h" static void usage __P((void)); @@ -80,9 +84,17 @@ main(argc, argv) char *argv[]; { DB *db; + struct rlimit rl; int fd, ch, verbose = 0; char *nlistpath, *nlistname, dbtemp[MAXPATHLEN], dbname[MAXPATHLEN]; + /* Increase our data size to the max if we can. */ + if (getrlimit(RLIMIT_DATA, &rl) == 0) { + rl.rlim_cur = rl.rlim_max; + if (setrlimit(RLIMIT_DATA, &rl) < 0) + warn("can't set rlimit data size"); + } + while ((ch = getopt(argc, argv, "v")) != -1) switch (ch) { case 'v': -- cgit v1.2.3