xen: Infratructure for XEN_TMEM_* hypercalls
[valgrind.git] / memcheck / tests / brk2.c
blob3a881335e43e3ceff1563cba870b6e56a1e4caf6
1 #include <stdio.h>
2 #include <unistd.h>
4 #define MAX 3000
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.
9 int main () {
10 char* ptr;
11 int i;
13 for (i=0; i<MAX; i++) {
14 ptr = sbrk(1);
16 if (ptr == (void*)-1) {
17 printf ("sbrk() failed!\n");
18 return 0;
21 *ptr = 0;
24 return 0;