1834043 Members
2666 Online
110063 Solutions
New Discussion

Re: Pseudo tty problems

 
Scott Nelson_1
Occasional Contributor

Pseudo tty problems

I am trying to port our application from linux/SCO to an HP-UX 10.20 system, and it makes use of pseudo terminals.

I can't get the slave to open when using /dev/ptmx, and when using /dev/ptyXX, when the slave closes, the master does not notice it and hangs.

On this particular system that I am using to port my app (which is the customer's system) is running HP-UX 10.20.

When I telnet into the system, it is using BSD style pseudo ttys (/dev/ttyp9, for example).

I've attached the relevant code.

...help!...
2 REPLIES 2
Charles Slivkoff
Respected Contributor

Re: Pseudo tty problems

/dev/ptmx is associated with the STREAMS pts(7) driver. Check the man-pages pts(7) and ptm(7) for details.
Scott Nelson_1
Occasional Contributor

Re: Pseudo tty problems

I am familiar with the STREAMS pty system. The device /dev/ptmx is there but doesn't seem to work: When I try to open the slave the program blocks. So I switched to using BSD style ptys (which, by the terminal names I get, it seems telnetd is also using).

BSD style ptys almost work. If, after the slave is closed, I do a read, the master simply hangs, instead of returning 0 (EOF).

Obviously, since I can telnet into the system and don't seem to have any telnetds being stuck, there must be some method of being notified that the slave was closed.

So, I guess my real question is: How is the master side notified that the slave side has been closed?