17 err(EXIT_FAILURE
, "Could not open current directory");
22 for (i
=0; i
<1000; i
++) {
25 err(EXIT_FAILURE
, "Could not open current directory");
29 if (sbrk(0) - memused
> oktouse
) {
30 warnx("Used %d extra bytes for %d telldir calls",
31 (sbrk(0)-memused
), i
);
32 oktouse
= sbrk(0) - memused
;
36 errx(EXIT_FAILURE
, "Failure: leaked %d bytes", oktouse
);
39 printf("OK: used %d bytes\n", sbrk(0)-memused
);