11 char *name
[] = {"t10a", "t10b", "t10c", "t10d", "t10e", "t10f", "t10g",
12 "t10h", "t10i", "t10j"};
14 #define PROGBUF_LONGS 3000
15 long prog
[PROGBUF_LONGS
];
25 void cr_file(char *name
, int size
);
34 system("cp ../t10a .");
37 /* Create files t10b ... t10h */
42 execl("t10a", "t10a", (char *) 0);
47 execl("t10b", "t10b", (char *) 0);
52 execl("t10c", "t10c", (char *) 0);
57 execl("t10d", "t10d", (char *) 0);
62 for (i
= 0; i
< 60; i
++) {
67 for (i
= 0; i
< 4; i
++) wait(&n
);
70 return(-1); /* impossible */
78 if ((pid
= fork()) != 0) {
79 wait(&n
); /* wait for some child (any one) */
81 /* a successful exec or a successful detection of a broken executable
84 if(execl(name
[n
], name
[n
], (char *) 0) < 0 && errno
== ENOEXEC
)
87 printf("Child execl didn't take. file=%s errno=%d\n", name
[n
], errno
);
90 printf("Worse yet, EXIT didn't exit\n");
99 printf("Can't open t10a\n");
102 psize
= read(fd
, (char *) prog
, PROGBUF_LONGS
* 4);
103 cr_file("t10b", 1600);
104 cr_file("t10c", 1400);
105 cr_file("t10d", 2300);
106 cr_file("t10e", 3100);
107 cr_file("t10f", 2400);
108 cr_file("t10g", 1700);
109 cr_file("t10h", 1500);
110 cr_file("t10i", 4000);
111 cr_file("t10j", 2250);
115 void cr_file(name
, size
)
123 fd
= creat(name
, 0755);
124 write(fd
, (char *) prog
, psize
);