1 /* test 12 */ 2 3 /* Copyright (C) 1987 by Martin Leisner. All rights reserved. */ 4 /* Used by permission. */ 5 6 #include <sys/types.h> 7 #include <sys/wait.h> 8 #include <stdlib.h> 9 #include <unistd.h> 10 #include <stdio.h> 11 12 #define NUM_TIMES 1000 13 int max_error = 2; 14 #include "common.h" 15 16 17 18 int main(void); 19 main()20int main() 21 { 22 register int i; 23 int k; 24 25 start(12); 26 27 for (i = 0; i < NUM_TIMES; i++) switch (fork()) { 28 case 0: exit(1); break; 29 case -1: 30 printf("fork broke\n"); 31 exit(1); 32 default: wait(&k); break; 33 } 34 35 quit(); 36 return(-1); /* impossible */ 37 } 38 39