/*
count: Pipes input to output and count bytes, output on stderr.
Anders Brander <anders@brander.dk>
2001-12-12
*/

#define POOLSIZE 16*1024

#include <unistd.h>
#include <stdio.h>

int
main()
{
	int count=0;
	int poolsize;
	char pool[POOLSIZE];

	while(poolsize = read(STDIN_FILENO, pool, POOLSIZE))
		count += write(STDOUT_FILENO, pool, poolsize);
	dprintf(STDERR_FILENO, "%d\n", count);
}

