SSH2 Compile Errors in upgraded RH 6.2 system

Derek Martin ddm at mclinux.com
Wed Apr 12 21:16:09 EDT 2000


On Wed, 12 Apr 2000, Mike Bilow wrote:

> My guess is that your source code does not understand UNIX98 devpts.

Speaking of which, can someone explain briefly how to make use of these?
>From what I gather, you allocate yourself a pty by opening /dev/ptmx with
a call something like this:

  fd = open("/dev/ptmx", O_RDWR);

and then you can determine the pty that was supposedly allocated to you
using ioctl, a la:

  ioctl( fd, TIOCGPTN, (char *) &pty);

(I'm going from memory, so if either that macro or the call itself is
wrong... whatever).

This apparently does indeed place the number of the next available pty
into the int variable pty (i.e. /dev/pts/8 as in one case where I tried
it).

So my question is, now what?  If I do an lsof and grep on that process, I
see my controlling tty, and I see /dev/ptmx is open, but I don't see
/dev/pts/8 listed as open.  Do I now need to explicitly open this pty and
get a seperate file descriptor?

I happened to notice that the tty-redir program (which can be used in
conjunction with ssh and pppd to achieve a hackish VPN solution) isn't
using Unix98 ptys, and I thought I would convert it as an exercise to
familiarize myself a little bit with programming with ptys.

Even better, if someone can point me to some good documents that cover
this sort of material, that'd be preferable (though I'll take the short
explanation too!)  Surprisingly (to me anyway), the O'Reilly book on Posix
programming that I have doesn't seem to cover Unix98 ptys at all.  At
least, not that I could find.

Thanks

-- 
Derek Martin
System Administrator
Mission Critical Linux
martin at MissionCriticalLinux.com 

-
Subcription/unsubscription/info requests: send e-mail with
"subscribe", "unsubscribe", or "info" on the first line of the
message body to discuss-request at blu.org (Subject line is ignored).



More information about the Discuss mailing list