henesyinit from p9f47575dc5 years agoHistory
22 lines · 342 B · C
RawDownload
#include <u.h>#include <libc.h> /* * Buffer until eof, output with a single write. * If write is larger than 8K just put out the first 8K. * (Should do better, some day.) */ voidmain(void){	char buf[8192];	int i, n; 	for(n=0; n<sizeof buf; n+=i){		i = read(0, buf+n, sizeof buf-n);		if(i <= 0)			break;	}	write(1, buf, n);}