diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1997-02-22 06:46:24 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1997-02-22 06:46:24 +0000 |
commit | 5c0338ffa5572976d895f1744e85003a3cde4dd1 (patch) | |
tree | 2e3e2298371b2bb8a8732c78d5101befe8b4d7fe | |
parent | acb890cb039e32b29f68f3fcfacfc211f4c55059 (diff) |
Use rlimit to set datasize to max.
-rw-r--r-- | sbin/fsirand/fsirand.c | 13 |
1 files 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 <Todd.Miller@courtesan.com> @@ -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 <sys/types.h> #include <sys/disklabel.h> #include <sys/ioctl.h> #include <sys/param.h> +#include <sys/resource.h> #include <sys/time.h> #include <ufs/ffs/fs.h> @@ -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]); |