summaryrefslogtreecommitdiff
path: root/src/regress/lib/libc/malloc/malloc_ulimit1
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
commit6f82d0e8f9756938f04071892206a5af85e676f0 (patch)
tree821921a1dd0a5a3cece91121e121cc63c4b68128 /src/regress/lib/libc/malloc/malloc_ulimit1
parent9204e59073bcf27e1487ec4ac46e981902ddd904 (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_ulimit1')
-rw-r--r--src/regress/lib/libc/malloc/malloc_ulimit1/Makefile5
-rw-r--r--src/regress/lib/libc/malloc/malloc_ulimit1/malloc_ulimit1.c44
2 files changed, 0 insertions, 49 deletions
diff --git a/src/regress/lib/libc/malloc/malloc_ulimit1/Makefile b/src/regress/lib/libc/malloc/malloc_ulimit1/Makefile
deleted file mode 100644
index 46ced27a98..0000000000
--- a/src/regress/lib/libc/malloc/malloc_ulimit1/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
1# $OpenBSD: Makefile,v 1.1 2006/04/18 19:03:30 otto Exp $
2
3PROG= malloc_ulimit1
4
5.include <bsd.regress.mk>
diff --git a/src/regress/lib/libc/malloc/malloc_ulimit1/malloc_ulimit1.c b/src/regress/lib/libc/malloc/malloc_ulimit1/malloc_ulimit1.c
deleted file mode 100644
index 99e805e8e1..0000000000
--- a/src/regress/lib/libc/malloc/malloc_ulimit1/malloc_ulimit1.c
+++ /dev/null
@@ -1,44 +0,0 @@
1/* $OpenBSD: malloc_ulimit1.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/*
13 * This code tries to trigger the case present in -current as of April
14 * 2006) where the allocation of the region itself succeeds, but the
15 * page dir entry pages fails.
16 * This in turn trips a "hole in directories" error.
17 * Having a large (512M) ulimit -m helps a lot in triggering the
18 * problem. Note that you may need to run this test multiple times to
19 * see the error.
20*/
21
22#define STARTI 1300
23#define FACTOR 1024
24
25main()
26{
27 struct rlimit lim;
28 size_t sz;
29 int i;
30 void *p;
31
32 if (getrlimit(RLIMIT_DATA, &lim) == -1)
33 err(1, "getrlimit");
34
35 sz = lim.rlim_cur / FACTOR;
36
37 for (i = STARTI; i >= 0; i--) {
38 size_t len = (sz-i) * FACTOR;
39 p = malloc(len);
40 free(p);
41 free(malloc(4096));
42 }
43 return (0);
44}