# run this file as a shell script
sed 's/^X//' >existfs
<<'!Funky!Stuff!'
echo "Usage: existfs name"
/etc
/dumpfs
$1 |
head -14 |
tail -11
cc
-o bin
/write_4096 write_4096.c
cc
-o bin
/write_8192 write_8192.c
cc
-o bin
/rewrite_8192 rewrite_8192.c
cc
-o bin
/read_8192 read_8192.c
cp bin
/write_4096 bin
/write_8192 bin
/rewrite_8192 bin
/read_8192
$1/fststs
sed 's/^X//' >newtsts
<<'!Funky!Stuff!'
echo "Usage: newtsts special disk-type"
echo "8K/1K file system on $1 type $2"
cc
-o bin
/write_4096 write_4096.c
cc
-o bin
/write_8192 write_8192.c
cc
-o bin
/rewrite_8192 rewrite_8192.c
cc
-o bin
/read_8192 read_8192.c
bin
/write_4096
/mnt
/fststs
/tst2
bin
/write_4096
/mnt
/fststs
/tst2
bin
/write_4096
/mnt
/fststs
/tst2
bin
/write_8192
/mnt
/fststs
/tst2
bin
/write_8192
/mnt
/fststs
/tst2
bin
/write_8192
/mnt
/fststs
/tst2
bin
/rewrite_8192
/mnt
/fststs
/tst2
bin
/rewrite_8192
/mnt
/fststs
/tst2
bin
/rewrite_8192
/mnt
/fststs
/tst2
bin
/read_8192
/mnt
/fststs
/tst2
bin
/read_8192
/mnt
/fststs
/tst2
bin
/read_8192
/mnt
/fststs
/tst2
echo "4K/1K file system on $1 type $2"
bin
/write_4096
/mnt
/fststs
/tst2
bin
/write_4096
/mnt
/fststs
/tst2
bin
/write_4096
/mnt
/fststs
/tst2
bin
/write_8192
/mnt
/fststs
/tst2
bin
/write_8192
/mnt
/fststs
/tst2
bin
/write_8192
/mnt
/fststs
/tst2
bin
/rewrite_8192
/mnt
/fststs
/tst2
bin
/rewrite_8192
/mnt
/fststs
/tst2
bin
/rewrite_8192
/mnt
/fststs
/tst2
bin
/read_8192
/mnt
/fststs
/tst2
bin
/read_8192
/mnt
/fststs
/tst2
bin
/read_8192
/mnt
/fststs
/tst2
sed 's/^X//' >read_8192.c
<<'!Funky!Stuff!'
printf("Usage: read_8192 file\n");
for (i
= 0; i
< 1024; i
++)
sed 's/^X//' >readchk.c
<<'!Funky!Stuff!'
int buf
[BUFSIZ
/ sizeof
(int
)];
printf("Usage: readchk file\n");
j
= creat
(argv
[1], 0666);
for (i
= 0; i
< 2048; i
++) {
for (k
= 0; k
< BUFSIZ
/ sizeof
(int
); k
++)
if (write(j
, buf
, BUFSIZ
) != BUFSIZ
) {
for (i
= 0; i
< 2048; i
++) {
if (read(j
, buf
, BUFSIZ
) != BUFSIZ
) {
for (k
= 0; k
< BUFSIZ
/ sizeof
(int
); k
++)
printf("bad data at %d\n",
tell
(j
) - BUFSIZ
+ 4 * k
);
sed 's/^X//' >rewrite_8192.c
<<'!Funky!Stuff!'
printf("Usage: rewrite_8192 file\n");
for (i
= 0; i
< 1024; i
++)
sed 's/^X//' >write_4096.c
<<'!Funky!Stuff!'
printf("Usage: write_4096 file\n");
j
= creat
(argv
[1], 0666);
for (i
= 0; i
< 2048; i
++)
sed 's/^X//' >write_8192.c
<<'!Funky!Stuff!'
printf("Usage: write_8192 file\n");
j
= creat
(argv
[1], 0666);
for (i
= 0; i
< 1024; i
++)