A question about terminal i/o control.

A question about terminal i/o control.

Post by Ben J Fornshe » Sat, 12 Feb 1994 14:01:55



Hello, I'm trying to find a way to monitor other terminals at which I'm logged in.  Basically I would like to be able to have a program that can filter through the input/output that comes from all of my terminals, I thought perhaps this could be accomplished with the tty files since you can send output to the terminal this way, but I have had no luck with input.  Does anyone know if this is possible, and if so why not, or how to?

Thanks in advance,

Ben, the ever Curious


 
 
 

1. controlling terminal question

I see this behavior only in solaris
-----------------------------
/home/ffdfptz/t >stty &
[1]     16501
/home/ffdfptz/t >
/home/ffdfptz/t >
[1] + Stopped (SIGTTOU)        stty &
/home/ffdfptz/t >fg
stty
ispeed 88840 baud; ospeed 88824 baud; -parity cstopb hupcl loblk
rows = 43; columns = 122; ypixels = 698; xpixels = 986;
quit = <undef>; erase = ^h; swtch = <undef>;
-inpck -istrip icrnl ixoff onlcr
echo echoe echok echoctl echoke
/home/ffdfptz/t >
-----------------------------

whenever I run stty in the background I get this. On doing truss...

-------------------------------
mmap(0x00000000, 8192, PROT_READ|PROT_EXEC, MAP_PRIVATE, 4, 0) =
0xEF790000
mmap(0x00000000, 16384, PROT_READ|PROT_EXEC, MAP_PRIVATE, 4, 0) =
0xEF780000
close(4)                                        = 0
close(3)                                        = 0
munmap(0xEF790000, 8192)                        = 0
    Stopped by signal #27, SIGTTOU, in ioctl()
ioctl(0, STGET, 0x0002643C)                     Err#22 EINVAL
ioctl(0, TCGETS, 0x00026460)                    = 0
        iflag=0016400 oflag=0000005 cflag=037777773375 lflag=0005073
            cc:  003 000 010 025 004 000 000 000
                 021 023 032 031 022 017 027 026 000 000 000
ioctl(0, TCGETX, 0x0002642C)                    Err#22 EINVAL
ioctl(0, TIOCGWINSZ, 0x00026424)                = 0
---------------------------------------------

The map and unmap in the beginning is the dependency shared objects
metting memory mapped and need not be concerned.
Looks like an STGET ( an undocumented "get line options" ) ended up in
receiving SIGTTOU.

As per the man page for termio, a backgroung process can get a SIGTTOU
if it tries to modify the terminal setting.

I m a really confused. If any of you can shed some light....
Thanks
Sony

Sent via Deja.com http://www.deja.com/
Before you buy.

2. AHA-1542C problems

3. Socket/Terminal Control Question

4. Linux BBS list?

5. Controlling Terminal question

6. Does Linux support clustering & redundant filesystems?

7. transferring control of terminal to child

8. Unix snippets source

9. Finding controlling terminal

10. Starting a process without a controlling terminal

11. "unable to write terminal control database"

12. Trouble with open(2) and controlling terminal (A/UX)

13. Control terminal and double fork ...