projects
/
libc-test
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
86f39dd
)
fix memfill to use up libc reserved memory (glibc usually has some)
author
Szabolcs Nagy
<nsz@port70.net>
Tue, 19 Aug 2014 17:58:05 +0000
(19:58 +0200)
committer
Szabolcs Nagy
<nsz@port70.net>
Tue, 19 Aug 2014 17:58:05 +0000
(19:58 +0200)
src/common/memfill.c
patch
|
blob
|
history
diff --git
a/src/common/memfill.c
b/src/common/memfill.c
index
2b8f999
..
ee47e1a
100644
(file)
--- a/
src/common/memfill.c
+++ b/
src/common/memfill.c
@@
-6,11
+6,16
@@
int t_memfill()
{
int r = 0;
+ /* alloc mmap space with PROT_NONE */
if (t_vmfill(0,0,0) < 0) {
t_error("vmfill failed: %s\n", strerror(errno));
r = -1;
}
+ /* limit brk space */
if (t_setrlim(RLIMIT_DATA, 0) < 0)
r = -1;
+ if (!r)
+ /* use up libc reserves if any */
+ while (malloc(1));
return r;
}