good example for pty usage ?


 
Thread Tools Search this Thread
Top Forums Programming good example for pty usage ?
# 1  
Old 07-07-2006
good example for pty usage ?

i am looking for a good example to explain *why* someone should use pty's.
# 2  
Old 07-07-2006
I think it is like a fifo file but for terminals
# 3  
Old 07-08-2006
'advanced unix programming' 2. ed, page 256ff show the programming. but i still miss the point
*why* should i do it. you are connecting to a programm stdin/out/err via a master/slave pty.
*why* should i do this ?
# 4  
Old 07-08-2006
First came real ttys. You would have a terminal and you would connect to a unix system via a serial connection of some kind. A tty driver would control how everything worked. This includes a lot more than simply passing characters back and forth. There is also a lot of human interaction functionality.

Programs would interact with the tty driver to achieve various results. For example, the passwd program turns off echo while you type in your password. An editor like vi also uses the tty driver extensively. Even if you never enter any passwords and you never edit any text files, you still use the tty driver. The tty driver knows what your backspace key is and it processes the backspace concept. Unless the program turned echo off, the tty driver sends a copy of the character you typed back to your screen. If you want any of this stuff to work, you need a tty driver. Without these tty driver features, you could arrange for continuous local echo so you can see what you type. But no blanking of passwords. No backspacing. No full screen programs like top, vi, emacs, etc.

When a session is connected via a network, most of the tty driver is now not needed. No need to set baud rate, check parity, count start bits, etc. But you still want vi to work and you want to supress echo during password entry. Make an error? Maybe a backspace concept would be nice. All of this is provided the pty driver.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

SSH w/ command in authorized_keys apparently needs pty

I'm trying to have an unattended remote PC log some data on home PC. man sshd says I should be able to put a command in authorized_keys. This is what I have on the remote machine. The key is a special key that isn't used elsewhere. In my ~/.ssh/authorized_keys file on my desktop:... (12 Replies)
Discussion started by: KenJackson
12 Replies

2. Solaris

PTY allocation request failed on channel 0

Hello Admins, Anybody faced this issue while logging through ssh on solaris: I am getting this error now. I was able to logged in before. Now I am getting this error. Any idea? (3 Replies)
Discussion started by: snchaudhari2
3 Replies

3. Programming

Race condition with PTY

I've been experimenting with pseudo-terminals and found something I don't quite understand. Writing an EOF character to the master end doesn't work quite as I expect. Once I've written any other data, the master pty seems to treat a single ^D as a seperator, i.e. writing "abcabc" would let cat do... (1 Reply)
Discussion started by: Corona688
1 Replies

4. AIX

How to monitor the IBM AIX server for I/O usage,memory usage,CPU usage,network..?

How to monitor the IBM AIX server for I/O usage, memory usage, CPU usage, network usage, storage usage? (3 Replies)
Discussion started by: laknar
3 Replies

5. UNIX for Advanced & Expert Users

Server refused to allocate pty

I know there is a thread on the subject but is not related to solaris so I am posting this question for help I have a solaris 8 machine. I can log in through the console but when trying to log in through putty/telnet after accepting username and password it gives the follwing error "Server... (2 Replies)
Discussion started by: Tirmazi
2 Replies

6. HP-UX

how can I find cpu usage memory usage swap usage and logical volume usage

how can I find cpu usage memory usage swap usage and I want to know CPU usage above X% and contiue Y times and memory usage above X % and contiue Y times my final destination is monitor process logical volume usage above X % and number of Logical voluage above can I not to... (3 Replies)
Discussion started by: alert0919
3 Replies

7. UNIX for Dummies Questions & Answers

use of tty and pty files

Hi, According to my understanding tty files that are available in /dev directory are terminals that are given to different users. please help me understand what are /pty files, like are they drivers to the devices.. also is the default tty terminal given to a user.. (2 Replies)
Discussion started by: saharookiedba
2 Replies

8. Linux

Server refused to allocate pty in linux

Hi, I am getting this error "Server refused to allocate pty" and Not able to login and I have to restart the server, this works fine for one day again 2 nd day when I am trying to login I am getting this error "Server refused to allocate pty", Can any body suggest me how to resolve this... (1 Reply)
Discussion started by: manoj.solaris
1 Replies

9. AIX

How to monitor pty

Hi all, today I could not telnet in AIX 5.2 cause I received the error "telnetd: All network ports in use". To allow users to telnet again I increased the number of ptys from default 256 to the new number 512. To avoid the same problem in the future and for a better understanding, I need... (2 Replies)
Discussion started by: l-roner
2 Replies
Login or Register to Ask a Question