blob: 3a881335e43e3ceff1563cba870b6e56a1e4caf6 [file] [log] [blame]
nethercotece471262004-08-25 13:43:44 +00001#include <stdio.h>
2#include <unistd.h>
3
4#define MAX 3000
5
6// At one time, this was causing a seg fault within Valgrind -- it was when
7// extending the brk segment onto a new page. Fixed in vg_syscalls.c 1.129.
8
9int main () {
10 char* ptr;
11 int i;
12
13 for (i=0; i<MAX; i++) {
14 ptr = sbrk(1);
15
16 if (ptr == (void*)-1) {
17 printf ("sbrk() failed!\n");
18 return 0;
19 }
20
21 *ptr = 0;
22 }
23
24 return 0;
25}