ref: 9a7852993c538212d5e14aa34c49ba7d990aca76
dir: /bgetceofindeed.c/
#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); }