Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!auspex!guy From: guy@auspex.auspex.com (Guy Harris) Newsgroups: comp.unix.questions Subject: Re: TIOCSTI vs SunOS 4.x Message-ID: <6688@auspex.auspex.com> Date: 16 Mar 91 20:10:42 GMT References: <1991Mar15.100417.13664@thunder.mcrcim.mcgill.edu> Organization: Auspex Systems, Santa Clara Lines: 43 >I find that using TIOCSTI to push back the literal-next character is >broken. On real Berkeley, doing this does what one would expect: the >next character typed is literal-nexted. On SunOS 3.5, it works the >same way. But under releases 4.0.3, 4.1, and 4.1.1, at least, doing >this causes the pushed-back literal-next to quote itself somehow, >rather than quoting the next character typed. Well, SunOS 4.x's tty drivers (yes, "drivers"; in 4.x, TIOCSTI is implemented by the device driver, not by "ldterm") implement TIOCSTI by sending the character in question upstream as if it had arrived as input, which makes it unlikely that it would be broken in the fashion you describe. However, just to make sure, I tested it, with the following program: #include main() { struct termios termios; if (ioctl(1, TCGETS, &termios) < 0) { perror("TCGETS"); return 2; } if (ioctl(1, TIOCSTI, &termios.c_cc[VLNEXT]) < 0) { perror("TIOCSTI VLNEXT"); return 2; } if (ioctl(1, TIOCSTI, &termios.c_cc[VERASE]) < 0) { perror("TIOCSTI VERASE"); return 2; } return 0; } and, as I'd expected, after running that program in cooked mode under the C shell, a DEL appeared as input (DEL being my erase character). Under what circumstances did you get the behavior you describe?