opening tty devices with getty attached

opening tty devices with getty attached

Post by Sean Sheridan Coleman X56 » Wed, 30 Jan 1991 15:50:26



I want to first thank Guy Harris for all of his help he has
given me concerning these tty devices.

I need just a little bit more info ( I hope) to figure all
of this out.

The manual states that open will block when opening a device
that is a communication device with no carrier. I confirmed
that this works. It also states that when O_NDELAY is set,
the open will not block.

I also confirmed this. QUESTION: Does the open suppose to succeed?
My open did with no carrier and O_NDELAY.

Now for the confusion. With login ( ie getty engaged) turned on`
in /etc/ttytab, the open will block with O_NDELAY set. Reading
through the man pages for the zs devices, I got the idea it was
suppose to, but I want some confirmation because the man pages
are not clear about this point. If it is suppose to hang, has
getty done something to make this happen?

Thanks

Sean Coleman

 
 
 

opening tty devices with getty attached

Post by Y. Rock L » Wed, 06 Feb 1991 23:38:33



Quote:

>Now for the confusion. With login ( ie getty engaged) turned on`
>in /etc/ttytab, the open will block with O_NDELAY set. Reading
>through the man pages for the zs devices, I got the idea it was
>suppose to, but I want some confirmation because the man pages
>are not clear about this point. If it is suppose to hang, has
>getty done something to make this happen?

Yes, it is supposed to hang because the standard line discipline
used by the character tty driver doesn't support O_NDELAY.
On the other hand, O_NDELAY is supported by the streamhead in SVR4.

Y. Rock Lee, att!cblph!rock


 
 
 

1. getty attaches tty to future shell?

I recently tried to write a screen saver for a terminal which would be
run by init and would exec getty when a user presses return.
Originally, getty would run fine, but login wouldn't, immediatedly
respawning the screensaver.  Another version put its output on the
wrong tty. We checked the source for getty_ps and figured out how to
open std[in|out|err] on the right tty.  This got us a shell, but there
was no job control due to "tty: invalid argument (null)."  Yet running
as a shell a little program that logged the ttyname() of 0, 1, and 2
showed the correct tty. PIDs shouldn't be a problem since everthing is
exec'ed.  

I've now put the screensaver code into getty, and got the same missing
tty error the first time I ran it on each tty.  Since then there's
been no problems.  

Why didn't it work as a standalone program, what does getty do besides
open stdin, and why didn't it only work the first time I ran it as a
part of getty?

Many thanks,
+Jonas Klein

2. oversized packet

3. Questions about attach (9E), open (2) and deferred attach

4. AMD386-40: Any Problems?

5. dip can't open tty device

6. Generating Bootdisk with USB-Floppy?

7. DIP tty open (/dev/modem, RW):Device or resource busy???

8. how to increase icon's color in olvwm?

9. Help needed: remote restore: cannot open /dev/tty: Device not configured

10. Help with /dev/console: no such device, and "cannot open tty"

11. open(2) with NO_CTTY flag for USB ACM TTY devices

12. tty-less processes with tty's open

13. free tty devices over network, network tty config