The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM


High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
CPU usage and memory usage mansoorulhaq High Level Programming 1 08-09-2007 01:55 PM
Monitor CPU usage and Memory Usage Gajanad Bihani High Level Programming 2 03-09-2005 03:35 AM
If there is anyone who is very good at AIX 5.1.. dilshik AIX 7 12-26-2003 08:40 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-07-2006
Registered User
 

Join Date: May 2006
Posts: 95
Stumble this Post!
good example for pty usage ?

i am looking for a good example to explain *why* someone should use pty's.
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 07-07-2006
Hitori's Avatar
Registered User
 

Join Date: Jun 2006
Posts: 356
Stumble this Post!
I think it is like a fifo file but for terminals
Reply With Quote
  #3 (permalink)  
Old 07-08-2006
Registered User
 

Join Date: May 2006
Posts: 95
Stumble this Post!
'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 ?
Reply With Quote
  #4 (permalink)  
Old 07-08-2006
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,444
Stumble this Post!
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.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 11:36 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0