brk.c 286 B

1234567891011121314
  1. #include <unistd.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include "test_helpers.h"
  5. int main(void) {
  6. void * current = sbrk(0);
  7. ERROR_IF(sbrk, current, == (void *)-1);
  8. int status = brk(current + 4096);
  9. ERROR_IF(brk, status, == -1);
  10. UNEXP_IF(brk, status, != 0);
  11. }