11 char *name
[] = {"t10a", "t10b", "t10c", "t10d", "t10e", "t10f", "t10g",
12 "t10h", "t10i", "t10j"};
17 _PROTOTYPE(int main
, (void));
18 _PROTOTYPE(void spawn
, (int n
));
19 _PROTOTYPE(void mkfiles
, (void));
20 _PROTOTYPE(void cr_file
, (char *name
, int size
));
21 _PROTOTYPE(void rmfiles
, (void));
22 _PROTOTYPE(void quit
, (void));
29 fflush(stdout
); /* have to flush for child's benefit */
31 system("rm -rf DIR_10; mkdir DIR_10; cp t10a DIR_10");
36 /* Create files t10b ... t10h */
41 execl("t10a", (char *) 0);
46 execl("t10b", (char *) 0);
51 execl("t10c", (char *) 0);
56 execl("t10d", (char *) 0);
61 for (i
= 0; i
< 60; i
++) {
66 for (i
= 0; i
< 4; i
++) wait(&n
);
69 return(-1); /* impossible */
78 wait(&n
); /* wait for some child (any one) */
80 k
= execl(name
[n
], (char *) 0);
82 printf("Child execl didn't take. file=%s errno=%d\n", name
[n
], errno
);
85 printf("Worse yet, EXIT didn't exit\n");
94 printf("Can't open t10a\n");
97 psize
= read(fd
, (char *) prog
, 300 * 4);
98 cr_file("t10b", 1600);
99 cr_file("t10c", 1400);
100 cr_file("t10d", 2300);
101 cr_file("t10e", 3100);
102 cr_file("t10f", 2400);
103 cr_file("t10g", 1700);
104 cr_file("t10h", 1500);
105 cr_file("t10i", 4000);
106 cr_file("t10j", 2250);
110 void cr_file(name
, size
)
120 prog
[6] = (long) size
;
121 fd
= creat(name
, 0755);
122 write(fd
, (char *) prog
, psize
);
143 system("rm -rf DIR*");
149 printf("%d errors\n", errct
);