/*
*/

#define BSIZ 512
#define STDIN 0
#define STDOUT 1

#define ERROR 5
#define OK 0
#define NONZERO 1

void putch(unsigned char ch)
{
    write(STDOUT, &ch, 1);
}

void pr(char *s)
{
    while (*s) {
	putch(*s);
	++s;
    }
}


main()
{
    unsigned char buf[BSIZ];
    int i;

    if (read(STDIN, buf, BSIZ) != BSIZ) {
	pr("read failed\n");
	exit(ERROR);
    }
    for (i = 1; i < BSIZ; i++) {
	if (buf[i] != buf[0]) {
	    pr("not erased\n");
	    exit(ERROR);
	}
    }
    if (buf[0] != 0) {
	pr("may be erased, but not zero\n");
	exit(NONZERO);
    }
    exit(0);
}

/* Local Variables: */
/* compile-command:"cc -static -o check check.c" */
/* End: */
