Google
 

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

#include "stdio.h"
#include "sys/ioctl.h"

char c1[] = "*";

main()
{
    puts("testing the TIOCSTI ioctl on stdin.  a '*' then a newline then\na ^C will be STI'd.   Here goes...");
    ioctl(fileno(stdin), TIOCSTI, c1);
    *c1 = '\n';
    ioctl(fileno(stdin), TIOCSTI, c1);
    *c1 = 3;
    ioctl(fileno(stdin), TIOCSTI, c1);
    printf("getchar() = '\\%03o'\n", getchar());
    printf("getchar() = '\\%03o'\n", getchar());
    printf("getchar() = '\\%03o'\n", getchar());
}