grind: run parallel system calls forever

This commit is contained in:
Robert Morris 2019-11-06 11:18:43 -05:00
parent 028af27646
commit 16b3b63f06
3 changed files with 170 additions and 5 deletions

View file

@ -1038,11 +1038,15 @@ concreate(char *s)
close(open(file, 0));
close(open(file, 0));
close(open(file, 0));
close(open(file, 0));
close(open(file, 0));
} else {
unlink(file);
unlink(file);
unlink(file);
unlink(file);
unlink(file);
unlink(file);
}
if(pid == 0)
exit(0);
@ -1106,7 +1110,7 @@ bigdir(char *s)
name[2] = '0' + (i % 64);
name[3] = '\0';
if(link("bd", name) != 0){
printf("%s: bigdir link failed\n", s);
printf("%s: bigdir link(bd, %s) failed\n", s, name);
exit(1);
}
}
@ -1335,8 +1339,8 @@ bigfile(char *s)
enum { N = 20, SZ=600 };
int fd, i, total, cc;
unlink("bigfile");
fd = open("bigfile", O_CREATE | O_RDWR);
unlink("bigfile.dat");
fd = open("bigfile.dat", O_CREATE | O_RDWR);
if(fd < 0){
printf("%s: cannot create bigfile", s);
exit(1);
@ -1350,7 +1354,7 @@ bigfile(char *s)
}
close(fd);
fd = open("bigfile", 0);
fd = open("bigfile.dat", 0);
if(fd < 0){
printf("%s: cannot open bigfile\n", s);
exit(1);
@ -1379,7 +1383,7 @@ bigfile(char *s)
printf("%s: read bigfile wrong total\n", s);
exit(1);
}
unlink("bigfile");
unlink("bigfile.dat");
}
void