From 64717ec7307b53e3f129e815bcc8c545aaf9cb20 Mon Sep 17 00:00:00 2001 From: millert Date: Fri, 28 Feb 1997 00:47:44 +0000 Subject: [PATCH] Set data size resource limit to its max value so fsck will work on large disks (and ccd's). --- sbin/fsck/fsck.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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 #include #include +#include #include #include @@ -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'; -- 2.20.1