test sigsetjmp with savesigs=0
[libc-test] / src / common / memfill.c
index 2b8f999..c53bfea 100644 (file)
@@ -1,3 +1,4 @@
+#include <stdlib.h>
 #include <string.h>
 #include <errno.h>
 #include <sys/resource.h>
@@ -6,11 +7,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;
 }