shithub: brokentoys

ref: 5a0e28438fe4c0f8cc55430c388c2016cc185cbf
dir: /bgetceofindeed.c/

View raw version
#include <u.h>
#include <libc.h>
#include <bio.h>

void
main()
{
	Biobuf *bin;
	char c;

	bin = Bfdopen(0, OREAD);
	if(bin == nil)
		sysfatal("Bfdopen: %r");
	while((c = Bgetc(bin)) != Beof)
		;
	USED(c);
	c = Bgetc(bin);
	if(c == Beof)
		print("eof indeed\n");
	else
		print("no eof after eof\n");
	exits(0);
}