Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Feb 1995 22:08:50 -0500 (EST)
From:      Jeff Aitken <jaitken@vt.edu>
To:        hackers@FreeBSD.org
Subject:   pty's
Message-ID:  <199502030308.WAA19000@jaitken.async.vt.edu>

next in thread | raw e-mail | index | archive | help
Pardon me if this is not the best forum for this, but I'm positive
several people who reads this list knows this stuff.  Now if only they
have the time (and inclination) to help me :)

I'm trying to do some network programming involving pseudo-terminals.
In the simplest sense, this program works much like rlogind in that it
is invoked by inetd when a connection comes on some port, sets up a
pseudo-tty and perhaps performs some other initialization-type functions,
then exec's another program.  The requirement for pty's comes in to play
because that "other program" uses curses.  In any case, I'm having
difficulty getting it to work (due to my thorough misunderstanding of 
pty's no doubt ;) and am looking for some help.  I've snatched most of
the code from rlogind, but still can't seem to get it work work.  

What happens is that the program initializes alright, but after it has
execl()'d the other one, none of the curses calls seem to work (ie, no
display on the screen) and the call to wgetstr() hangs indefinitely.

I've tested the curses program from the command line and it works just
fine, so it must be my network code (ie, the analog to rlogind).  I've
got Stevens' book, but most of his code is specific to rlogin(d), and
I'm hoping to find a sort of "generic" example.

My only other option is to create a client/server pair where the server
is running on the same machine as the client, and the two speak in a
simple, plain-text language.  This allows me to leave all the UI code in
the client, and not worry about messy network details (ie, pty's).  What
I lose from this is the ability to make this accessible over the
network; everyone must log in to a particular machine to run the
program.  This isn't necessarily bad in this case, but I'd like to do it
the other way if at all possible.
-- 
Jeff Aitken
jaitken@vt.edu



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199502030308.WAA19000>