🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.bugs.4bsd
Article #1328

Porting the 4.3BSD-Tahoe `window' to a Sun

#1328
From: Greg Earle
Date: Sat, 21 Jan 1989 08:21
38 lines
2434 bytes
Recently I decided to try my hand at porting the 4.3BSD-Tahoe version of
`window' to a Sun-3, running SunOS 4.0.1+.  After a wee bit of hacking,
and the not-inconsiderable help of Guy Harris, I had a version that would
work fine, when using pty's for the screen windows.  However, when I
attempt to have it use UNIX domain socketpairs for the windows (i.e.,
specify `pty = no' in ~/.windowrc), I get very strange behavior:
The window is allocated properly, and a shell is spawned for it.  Yet,
no shell prompt shows up in the window, and keyboard input (when that window is
selected) doesn't seem to go anywhere.  Yet if I kill the spawned csh
from another place, `window' knows that the child has been killed, and I
get the expected `Process died.  Command?' prompt in the command window.
It's as if the spawned csh is orphaned out in the Twilight Zone, with its
stdin and stdout disconnected from everything.

An `sps -avl' immediately after an initial creation of a socketpair() based
window, and a pty-based window, shows:

Ty User     Status Fl Nice Virt Res %M  Time Child %C Proc# Command
p0.     *   SELECT         152  400  6   0.8        2  1770 window
         *  RSOCKT          64  344  5   1.2        5  1771 csh
p4.      *  RTTYP4          64  352  5   1.2        5  1773 -sh

Other than the `csh' instead of `-sh' (??), this looks pretty reasonable
to me.

[I'd show an `sps -avle' to see the environments of each are any different,]
[but sps' -e option has a bug that causes a Bus Error, at least on the Sun.]

[On a somewhat related note, compiling `window' with gcc causes it to botch]
[the termcap string for inverse video, at least inside the xterm I was     ]
[testing it in.								   ]

Any ideas?
-- 
	Greg Earle		earle@Sun.COM
	Sun Microsystems	poseur!earle@mahendo.JPL.NASA.GOV
	Los Angeles Consulting	earle%mahendo@elroy.JPL.NASA.GOV
...!{cit-vax,ames}!elroy!poseur!earle	...!sun!tsunami!valley!poseur!earle
Technical Details
Message-ID: <395@mahendo.Jpl.Nasa.Gov>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!ncis.llnl.gov!helios.ee.lbl.gov!nosc!ucsd!orion.cf.uci.edu!elroy!mahendo!earle

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!ncis.llnl.gov!helios.ee.lbl.gov!nosc!ucsd!orion.cf.uci.edu!elroy!mahendo!earle
From: earle@mahendo.Jpl.Nasa.Gov (Greg Earle)
Newsgroups: comp.bugs.4bsd
Subject: Porting the 4.3BSD-Tahoe `window' to a Sun
Message-ID: <395@mahendo.Jpl.Nasa.Gov>
Date: 21 Jan 89 08:21:06 GMT
Reply-To: poseur!earle@elroy.JPL.NASA.GOV
Followup-To: poster
Organization: Sun Microsystems - Western Area Professional Services
Lines: 38