DataMuseum.dk

Presents historical artifacts from the history of:

Commodore CBM-900

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Commodore CBM-900

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦4fb032a1c⟧ TextFile

    Length: 691 (0x2b3)
    Types: TextFile
    Notes: UNIX file
    Names: »testal.c«

Derivation

└─⟦f27320a65⟧ Bits:30001972 Commodore 900 hard disk image with partial source code
    └─⟦2d53db1df⟧ UNIX V7 Filesystem
        └─ ⟦this⟧ »frankh/src/junk/testal.c« 

TextFile

#include	<stdio.h>

main()

{
register int	fd, fd1, i, j;
char	*string, *tmp;

	printf("\nBegin\n");
	string = "                                    ";
	tmp    = "                                    ";
	if ((fd = open("/dev/tty51", 1)) < 0)
		printf("bad write open\n");

	if ((fd1 = open("/dev/tty50", 0)) < 0)
		printf("bad read open\n");

        string = "012345678\n";

	for (i = 0; i <1000; ++i) {

		if (write(fd, string, 10) != 10)
			printf("bad write\n");
	
		if (read(fd1, tmp, 10) != 10)
			printf("bad read\n");

	printf("st: %s\n", tmp);
		for (j = 0; j < 9; ++j)
			if (tmp[j] != string[j])
				printf("read error\n");

	printf("Pass = %d\n", i);
	}
	close(fd1);
	close(fd);
}