From 310517791a7a80ae2963de88f33f4afe24a26655 Mon Sep 17 00:00:00 2001 From: millert Date: Sat, 22 Feb 1997 06:46:23 +0000 Subject: [PATCH] Use rlimit to set datasize to max. --- sbin/fsirand/fsirand.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/sbin/fsirand/fsirand.c b/sbin/fsirand/fsirand.c index c300a5066ee..0049a1de411 100644 --- a/sbin/fsirand/fsirand.c +++ b/sbin/fsirand/fsirand.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fsirand.c,v 1.7 1997/02/11 06:59:25 millert Exp $ */ +/* $OpenBSD: fsirand.c,v 1.8 1997/02/22 06:46:23 millert Exp $ */ /* * Copyright (c) 1997 Todd C. Miller @@ -31,13 +31,14 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: fsirand.c,v 1.7 1997/02/11 06:59:25 millert Exp $"; +static char rcsid[] = "$OpenBSD: fsirand.c,v 1.8 1997/02/22 06:46:23 millert Exp $"; #endif /* not lint */ #include #include #include #include +#include #include #include @@ -65,6 +66,7 @@ main(argc, argv) char *argv[]; { int n, ex = 0; + struct rlimit rl; while ((n = getopt(argc, argv, "bfp")) != -1) { switch (n) { @@ -84,6 +86,13 @@ main(argc, argv) if (argc - optind < 1) usage(1); + /* Increase our max data size */ + if (getrlimit(RLIMIT_DATA, &rl) < 0) + warn("getrlimit"); + rl.rlim_cur = rl.rlim_max; + if (setrlimit(RLIMIT_DATA, &rl) < 0) + warn("setrlimit"); + for (n = optind; n < argc; n++) { if (argc - optind != 1) (void)puts(argv[n]); -- 2.20.1