termios/ioctl: What is the function to force a keystroke into a tty?

  • Follow


There is an ioctl function to push a keystroke into a tty's input buffer.
I've used this in the past, but can't remember it now.  It starts with
"TIO".  Can someone jog my memory?

0
Reply gazelle2 (1306) 11/23/2007 10:02:01 AM

In article <fi68ep$vft$1@news.xmission.com>,
 gazelle@xmission.xmission.com (Kenny McCormack) wrote:

> There is an ioctl function to push a keystroke into a tty's input buffer.
> I've used this in the past, but can't remember it now.  It starts with
> "TIO".  Can someone jog my memory?

That hint isn't very useful, since ALL the tty ioctls start with TIOC 
(it stands for Terminal I/O Control).  They should all be documented in 
tty(4), in which I found this:

     TIOCSTI char *cp
                 Simulate typed input.  Pretend as if the terminal 
                 received the character pointed to by cp.

-- 
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
0
Reply barmar (5626) 11/23/2007 9:02:47 PM


In article <barmar-FCE2A0.16024723112007@comcast.dca.giganews.com>,
Barry Margolin  <barmar@alum.mit.edu> wrote:
>In article <fi68ep$vft$1@news.xmission.com>,
> gazelle@xmission.xmission.com (Kenny McCormack) wrote:
>
>> There is an ioctl function to push a keystroke into a tty's input buffer.
>> I've used this in the past, but can't remember it now.  It starts with
>> "TIO".  Can someone jog my memory?
>
>That hint isn't very useful, since ALL the tty ioctls start with TIOC 
>(it stands for Terminal I/O Control).  They should all be documented in 
>tty(4), in which I found this:
>
>     TIOCSTI char *cp
>                 Simulate typed input.  Pretend as if the terminal 
>                 received the character pointed to by cp.

Thanks for the tip.  The problem is that, on Linux, "man 4 tty" (the
first thing I tried, BTW), only documents TIOCNOTTY.  The rest are left
as exercises for the reader...

I _think_ that, the last time I needed to parse this out, I ended up
reading the man page on a Solaris system, where it *is* documented.

Anyway, thanks again.  This helps.

0
Reply gazelle2 (1306) 11/23/2007 9:54:32 PM

Kenny McCormack wrote:

> The problem is that, on Linux, "man 4 tty" (the first thing I tried,
> BTW), only documents TIOCNOTTY.  The rest are left as exercises for
> the reader...

The ever so cynical Kenny McCormack. Tired of clc yet? :-)

man tty_ioctl
http://linux.die.net/man/4/tty_ioctl
0
Reply Spoon 11/24/2007 8:13:58 AM

Spoon <root@localhost> writes:
>Kenny McCormack wrote:
>
>> The problem is that, on Linux, "man 4 tty" (the first thing I tried,
>> BTW), only documents TIOCNOTTY.  The rest are left as exercises for
>> the reader...
>
>The ever so cynical Kenny McCormack. Tired of clc yet? :-)
>
>man tty_ioctl
>http://linux.die.net/man/4/tty_ioctl

So, someone should then add 'tty_ioctl(4)' to the SEE ALSO
section of tty(4).

scott
0
Reply scott 11/26/2007 9:03:14 PM

Scott Lurndal wrote:

> Spoon wrote:
> 
>> Kenny McCormack wrote:
>> 
>>> The problem is that, on Linux, "man 4 tty" (the first thing I tried,
>>> BTW), only documents TIOCNOTTY.  The rest are left as exercises for
>>> the reader...
>> 
>> The ever so cynical Kenny McCormack. Tired of clc yet? :-)
>> 
>> man tty_ioctl
>> http://linux.die.net/man/4/tty_ioctl
> 
> So, someone should then add 'tty_ioctl(4)' to the SEE ALSO
> section of tty(4).

I've sent the trivial patch to Michael Kerrisk (the current man
page maintainer, as far as I could tell).

--- tty.4.orig  2007-11-16 07:15:52.000000000 +0100
+++ tty.4       2007-11-27 13:58:39.000000000 +0100
@@ -68,4 +68,5 @@
  .BR termios (3),
  .BR console (4),
  .BR ttyS (4),
+.BR tty_ioctl (4),
  .BR mingetty (8)
0
Reply Spoon 11/27/2007 1:11:05 PM

5 Replies
37 Views

(page loaded in 0.112 seconds)

Similiar Articles:




7/27/2012 11:50:50 PM


Reply: