Xref: utzoo comp.unix.questions:6966 comp.unix.wizards:8387 Path: utzoo!attcan!uunet!convex!rdavis@convex.UUCP From: rdavis@convex.UUCP (Ray Davis) Newsgroups: comp.unix.questions,comp.unix.wizards Subject: Re: KSH portability Summary: Changes to make ksh work Convex UNIX 6.1 Keywords: ksh, convex Message-ID: <337@convex.UUCP> Date: 9 May 88 19:31:00 GMT References: <295@cmtl01.UUCP> <12142@tut.cis.ohio-state.edu> <631@vsi.UUCP> <4063@mtgzz.UUCP> Sender: rdavis@convex.UUCP Reply-To: rdavis@convex.UUCP (Ray Davis) Organization: Convex Computer Corporation, Richardson, Tx. Lines: 24 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