KSH portability

Ray Davis rdavis at convex.UUCP
Tue May 10 05:31:00 AEST 1988


I just finished tracking down why people couldn't get ksh to work
correctly under Convex UNIX 6.1.  There were two symptoms.  First,
history was garbaged up.  History entries looked like single
characters.  Second, command line editing didn't work at all.

Convex UNIX is mostly BSD 4.2 with some 4.3 stuff, SUN NFS stuff,
and our own support for huge memory, disk and process models.

The first problem came about because Convex supports 256 file
descriptors.  ksh thinks _NFILE is going to be an unsigned char.
I explicitly defined it to be 20 as a test, and this fixed the
history file problem.

The second problem happened because ksh has it's own _filbuf()
function instead of using the one in the stdio library.  Well, in
support of 256 file descriptors, Convex decided to allocate stdio
buffers dynamically *when they are actually used*.  The Convex
_filbuf checks file->_base to see if it is null, and if so calls
another function to get a buffer.  After adding these two lines to
the ksh _filbuf, command line editing works like a champ.

Ray Davis
Convex Computer Corp, Richardson TX
{uunet, allegra, ihnp4, sun, uiucdcs}!convex!rdavis, 214/952-0521



More information about the Comp.unix.questions mailing list