9 #include <sys/resource.h>
21 main(int argc
, char **argv
)
24 int seed
, i
, j
, res
, errors
;
33 getrlimit(RLIMIT_STACK
, &sl
);
36 for (i
= 0; i
< NUM
; i
++) {
37 res
= pthread_create(&thr
[i
], 0, f
, 0);
39 errx(1, "pthread_create: %s", strerror(res
));
40 for (j
= 0; j
<= i
; j
++) {
41 res
= pthread_getname_np(thr
[j
], nam
, sizeof(nam
));
43 warnx("getname(%d/%d): %s\n", i
, j
,
50 malloc((random() & 7) * sl
.rlim_cur
);
53 printf("%d errors\n", errors
);
55 printf("seed was %d\n", seed
);