For Programmers: Free Programming Magazines  


Home > Archive > Unix Programming > December 2004 > Problem with pseudo terminals









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Problem with pseudo terminals
brankok@dkts.co.yu

2004-12-28, 4:00 pm

Hello all!

I would be most grateful for your help.

I am developing an application that has to communicate with another
program using pseudo terminals. My application opens the
pseudo-terminal master.Then it creates a child, the child establishes a
new session, opens the corresponding pseudo-terminal slave, and then
calls exec replacing the calling program with another program. The
problem rises when data starts arriving from another program to my
application: In spite of the fact that a pseudo terminal works in
canonical mode, the system does not return one line at a time. In
contrast, the read returns the variable number of bytes (parts of one
line). If I try to open a new terminal window and, from that window,
write some text to the slave pseudo terminal device associated to the
program that sends lines in parts to my application, the text appears
in my application as it was expected (the whole lines).

I would really appreciate it very much if anyone could provide me with
some additional information or give me some advice I could follow.
Kindest regards,
Branko

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com