Re: /proc/PID/fd/0 design "bug"

Krzysztof G. Baranowski (kgb@manjak.knm.org.pl)
Wed, 24 Dec 1997 14:01:45 +0100 (MET)


While testing the million monkey theory, Michael O'Reilly said:
>> See, this is the point. I want to simulate keyboard entry. How would I do
>> this?
>There's an ioctl() around to stuff the keystrokes into the tty
>buffer. (damned if I can remember the name of it. UTSL).

#include <sys/ioctl.h>

int main(void)
{
ioctl(1, TIOCSTI, "l");
ioctl(1, TIOCSTI, "s");
ioctl(1, TIOCSTI, "\n");
ioctl(1, TIOCSTI,"i");
ioctl(1, TIOCSTI,"d");
ioctl(1, TIOCSTI,"\n");
return(0);
}

Happy holidays,
Kris

-- 
Krzysztof G. Baranowski - President of the Harmless Manyacs' Club
"Ex sysadmin, ex kernel hacker, luser again: How to copy a file ?"
http://www.knm.org.pl/                 <prezes@manjak.knm.org.pl>