Google
 

Trailing-Edge - PDP-10 Archives - SRI_NIC_PERM_FS_1_19910112 - kcc-6/lib/test/tnread.c
There are 5 other files named tnread.c in the archive. Click here to see a list.
/*
 *	test ioctl's FIONREAD function
 */

#include "stdio.h"
#include "ioctl.h"

main()
{
    int i;
    long count;

    puts("countdown, start typing!");
    puts("count		# unread chars");
    puts("-----		--------------");
    for (i = 10; i >= 0; i--) {
	ioctl(fileno(stdin), FIONREAD, &count);
	printf("%4d               %5d\n", i, count);
	sleep(1);
    }
}