summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1997-02-28 00:47:45 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1997-02-28 00:47:45 +0000
commit3ddd240ed417057d8aa453f1d17481c8c0edaa48 (patch)
treec5e83b1ed7791f16e4098fe0d27664b9ce601f4f
parent99a780cbfde566a8336727b1468ed7928f0c4a46 (diff)
Set data size resource limit to its max value so fsck will work
on large disks (and ccd's).
-rw-r--r--sbin/fsck/fsck.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/sbin/fsck/fsck.c b/sbin/fsck/fsck.c
index 1a2a0c9fa20..bd2505a31a4 100644
--- a/sbin/fsck/fsck.c
+++ b/sbin/fsck/fsck.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fsck.c,v 1.5 1996/12/23 07:44:59 downsj Exp $ */
+/* $OpenBSD: fsck.c,v 1.6 1997/02/28 00:47:44 millert Exp $ */
/* $NetBSD: fsck.c,v 1.7 1996/10/03 20:06:30 christos Exp $ */
/*
@@ -44,6 +44,7 @@ static char rcsid[] = "$NetBSD: fsck.c,v 1.7 1996/10/03 20:06:30 christos Exp $"
#include <sys/param.h>
#include <sys/mount.h>
#include <sys/queue.h>
+#include <sys/resource.h>
#include <sys/wait.h>
#include <err.h>
@@ -97,6 +98,15 @@ main(argc, argv)
int i, rval = 0;
char *vfstype = NULL;
char globopt[3];
+ struct rlimit rl;
+
+ /* Increase our data size to the max */
+ if (getrlimit(RLIMIT_DATA, &rl) == 0) {
+ rl.rlim_cur = rl.rlim_max;
+ if (setrlimit(RLIMIT_DATA, &rl) < 0)
+ warn("Can't get resource limit to max data size");
+ } else
+ warn("Can't get resource limit for data size");
globopt[0] = '-';
globopt[2] = '\0';