[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: elf: openpty () usage question



On Tue, May 29, 2001 at 08:31:27AM -0700, elf@florence.buici.com wrote:
> Hmm.  Well then my code must be awfully mungified.  When I write to
> the slave device (/dev/pts/?), the master reads the data.  When I
> write the master device...the master reads the data.  Oddly, this
> appears to be the same behavior exhibited by the rtty program I found
> on the net.
> 
> Do you a sample you're willing to share?

Normally it's a different process that reads the master and slave FDs so the
parent has to close the slave after forking the child and the child closes the
master. That's what all my code has ever done anyway - I'm not sure how useful
having a PTY as communication inside a single process actually is :-)

Plenty of examples in my two packages dnprogs and latd (in unstable or from
linux-decnet.sourceforge.net/download.html). The easiest to follow is
dnetd/task_server.c in dnprogs, ignore the code that replaces openpty for broken
RedHat 5 systems.

patrick



Reply to: