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

This is a discussion on termios/ioctl: What is the function to force a keystroke into a tty? - Unix ; 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?...

+ Reply to Thread
Results 1 to 6 of 6

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

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

    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?


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

    In article ,
    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 ***

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

    In article ,
    Barry Margolin wrote:
    >In article ,
    > 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.


  4. Re: termios/ioctl: What is the function to force a keystroke intoa tty?

    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

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

    Spoon 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

  6. Re: termios/ioctl: What is the function to force a keystroke intoa tty?

    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)

+ Reply to Thread