#include <u.h>
#include <libc.h>
#include <bio.h>
#define STDIN 0
void
main()
{
Biobuf *bstdin;
bstdin = Bfdopen(STDIN, OREAD);
print("Enter a character:\n");
print("`Bgetc(bstdin) != Beof` is %d\n", Bgetc(bstdin) != Beof);
exits(0);
}
$ 9c verify.c; 9l verify.o -o verify
$ ./verify
Enter a character:
f
`Bgetc(bstdin) != Beof` is 1
$ ./verify
Enter a character:
`Bgetc(bstdin) != Beof` is 0