diff options
author | millert <millert@openbsd.org> | 1998-10-06 18:09:50 +0000 |
---|---|---|
committer | millert <millert@openbsd.org> | 1998-10-06 18:09:50 +0000 |
commit | 56b08df7fad12b3ed3f96b8c35d5387832355c3d (patch) | |
tree | d62cd388dd036f6586900aae4066de0e0305750c /usr.sbin/kvm_mkdb/kvm_mkdb.c | |
parent | Fix makefile problems - Don't use SSLeay style include link farm to (diff) | |
download | wireguard-openbsd-56b08df7fad12b3ed3f96b8c35d5387832355c3d.tar.xz wireguard-openbsd-56b08df7fad12b3ed3f96b8c35d5387832355c3d.zip |
crank RLIMIT_DATA, seems to be necessary for some people
Diffstat (limited to 'usr.sbin/kvm_mkdb/kvm_mkdb.c')
-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': |