15 _VOLATILE
int glov
, gct
;
19 _PROTOTYPE(int main
, (int argc
, char *argv
[]));
20 _PROTOTYPE(void test1a
, (void));
21 _PROTOTYPE(void parent
, (void));
22 _PROTOTYPE(void child
, (int i
));
23 _PROTOTYPE(void test1b
, (void));
24 _PROTOTYPE(void parent1
, (int childpid
));
25 _PROTOTYPE(void func
, (int s
));
26 _PROTOTYPE(void child1
, (void));
27 _PROTOTYPE(void e
, (int n
));
28 _PROTOTYPE(void quit
, (void));
38 if (argc
== 2) m
= atoi(argv
[1]);
41 fflush(stdout
); /* have to flush for child's benefit */
43 system("rm -rf DIR_01; mkdir DIR_01");
46 for (i
= 0; i
< ITERATIONS
; i
++) {
47 if (m
& 00001) test1a();
48 if (m
& 00002) test1b();
52 return(-1); /* impossible */
61 for (i
= 0; i
< n
; i
++) {
64 printf("\nTest 1 fork failed\n");
96 for (i
= 0; i
< 4; i
++) {
101 printf("Test 1 fork failed\n");
110 void parent1(childpid
)
116 for (n
= 0; n
< 5000; n
++);
117 while (kill(childpid
, SIGNUM
) < 0) /* null statement */
123 int s
; /* for ANSI */
139 system("rm -rf DIR*");
145 printf("%d errors\n", errct
);