11 char *name
[] = {"t10a", "t10b", "t10c", "t10d", "t10e", "t10f", "t10g",
12 "t10h", "t10i", "t10j"};
14 #define PROGBUF_LONGS 3000
15 long prog
[PROGBUF_LONGS
];
24 void cr_file(char *name
, int size
);
33 system("cp ../t10a .");
36 /* Create files t10b ... t10h */
41 execl("t10a", "t10a", (char *) 0);
46 execl("t10b", "t10b", (char *) 0);
51 execl("t10c", "t10c", (char *) 0);
56 execl("t10d", "t10d", (char *) 0);
61 for (i
= 0; i
< 60; i
++) {
66 for (i
= 0; i
< 4; i
++) wait(&n
);
69 return(-1); /* impossible */
77 if ((pid
= fork()) != 0) {
78 wait(&n
); /* wait for some child (any one) */
80 /* a successful exec or a successful detection of a broken executable
83 if(execl(name
[n
], name
[n
], (char *) 0) < 0 && errno
== ENOEXEC
)
86 printf("Child execl didn't take. file=%s errno=%d\n", name
[n
], errno
);
89 printf("Worse yet, EXIT didn't exit\n");
98 printf("Can't open t10a\n");
101 psize
= read(fd
, (char *) prog
, PROGBUF_LONGS
* 4);
102 cr_file("t10b", 1600);
103 cr_file("t10c", 1400);
104 cr_file("t10d", 2300);
105 cr_file("t10e", 3100);
106 cr_file("t10f", 2400);
107 cr_file("t10g", 1700);
108 cr_file("t10h", 1500);
109 cr_file("t10i", 4000);
110 cr_file("t10j", 2250);
114 void cr_file(name
, size
)
122 fd
= creat(name
, 0755);
123 write(fd
, (char *) prog
, psize
);