diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1998-10-06 18:09:51 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1998-10-06 18:09:51 +0000 |
commit | 580c9975cd5d695c91c2bdbc315bc557ac661d30 (patch) | |
tree | ee340cc3a39612eaa5d9e07d97f8753e99f7add2 /usr.sbin | |
parent | 9de437a6a935e4a6bbebf1255a9b66143a4b2f96 (diff) |
crank RLIMIT_DATA, seems to be necessary for some people
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/kvm_mkdb/kvm_mkdb.c | 16 |
1 files changed, 14 insertions, 2 deletions
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 <string.h> #include <unistd.h> +#include <sys/types.h> +#include <sys/time.h> +#include <sys/resource.h> + #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': |