int t_printf(const char *s, ...);
int t_vmfill(void **, size_t *, int);
+int t_memfill(void);
void t_fdfill(void);
int main(void)
{
- if (t_vmfill(0,0,0) < 0)
- t_error("vmfill failed: %s\n", strerror(errno));
+ if (t_memfill() < 0)
+ t_error("memfill failed\n");
errno = 0;
if (malloc(50000))
pthread_t td;
int r, arg;
- r = t_vmfill(0, 0, 0);
- if (r <= 0) {
- t_error("fatal: vmfill has failed\n");
- return 1;
- }
+ if (t_memfill() < 0)
+ t_error("memfill failed\n");
r = pthread_create(&td, 0, start, &arg);
if (r == 0)
t_error("pthread_create succeeded\n");
// commit 543787039098c121917cb5f3e129d84b61afa61b 2013-10-04
// setenv should not crash on oom
#include <stdlib.h>
+#include <sys/resource.h>
#include <string.h>
#include <errno.h>
#include "test.h"
{
char buf[10000];
- if (t_vmfill(0,0,0) < 0)
- t_error("vmfill failed: %s\n", strerror(errno));
+ if (t_memfill() < 0)
+ t_error("memfill failed\n");
memset(buf, 'x', sizeof buf);
buf[sizeof buf - 1] = 0;