summaryrefslogtreecommitdiff
path: root/src/regress/lib/libc/malloc/malloc_ulimit2
diff options
context:
space:
mode:
authorcvs2svn <admin@example.com>2012-07-13 17:49:56 +0000
committercvs2svn <admin@example.com>2012-07-13 17:49:56 +0000
commitee04221ea8063435416c7e6369e6eae76843aa71 (patch)
tree821921a1dd0a5a3cece91121e121cc63c4b68128 /src/regress/lib/libc/malloc/malloc_ulimit2
parentadf6731f6e1d04718aee00cb93435143046aee9a (diff)
downloadopenbsd-eric_g2k12.tar.gz
openbsd-eric_g2k12.tar.bz2
openbsd-eric_g2k12.zip
This commit was manufactured by cvs2git to create tag 'eric_g2k12'.eric_g2k12
Diffstat (limited to 'src/regress/lib/libc/malloc/malloc_ulimit2')
-rw-r--r--src/regress/lib/libc/malloc/malloc_ulimit2/Makefile5
-rw-r--r--src/regress/lib/libc/malloc/malloc_ulimit2/malloc_ulimit2.c42
2 files changed, 0 insertions, 47 deletions
diff --git a/src/regress/lib/libc/malloc/malloc_ulimit2/Makefile b/src/regress/lib/libc/malloc/malloc_ulimit2/Makefile
deleted file mode 100644
index bc83666415..0000000000
--- a/src/regress/lib/libc/malloc/malloc_ulimit2/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
1# $OpenBSD: Makefile,v 1.1 2006/04/18 19:04:03 otto Exp $
2
3PROG= malloc_ulimit2
4
5.include <bsd.regress.mk>
diff --git a/src/regress/lib/libc/malloc/malloc_ulimit2/malloc_ulimit2.c b/src/regress/lib/libc/malloc/malloc_ulimit2/malloc_ulimit2.c
deleted file mode 100644
index ca8e8f438a..0000000000
--- a/src/regress/lib/libc/malloc/malloc_ulimit2/malloc_ulimit2.c
+++ /dev/null
@@ -1,42 +0,0 @@
1/* $OpenBSD: malloc_ulimit2.c,v 1.2 2006/05/16 05:47:13 otto Exp $ */
2
3/* Public Domain, 2006, Otto Moerbeek <otto@drijf.net> */
4
5#include <sys/types.h>
6#include <sys/time.h>
7#include <sys/resource.h>
8#include <err.h>
9#include <stdlib.h>
10#include <stdio.h>
11
12#define FACTOR 1024
13
14main()
15{
16 struct rlimit lim;
17 size_t sz;
18 int i;
19 void *p;
20
21 if (getrlimit(RLIMIT_DATA, &lim) == -1)
22 err(1, "getrlimit");
23
24 sz = lim.rlim_cur / FACTOR;
25
26 for (i = 0; ; i++) {
27 size_t len = (sz-i) * FACTOR;
28 p = malloc(len);
29 if (p != NULL) {
30 free(p);
31 break;
32 }
33 }
34 i += 10;
35 for (; i >= 0; i--) {
36 size_t len = (sz-i) * FACTOR;
37 p = malloc(len);
38 free(p);
39 free(malloc(4096));
40 }
41 return (0);
42}