Pyramid 90X C program dumps core

Chris Torek chris at umcp-cs.UUCP
Fri Sep 27 08:15:53 AEST 1985


``gtty'' should not be done on a ``short buf[3]'', ONLY on a ``struct
sgttyb''.  Why?  Because it is not the same on all machines.  In
particular, on a Pyramid 90x an sgttyb structure is about three
times bigger than on V7/4.2.

How about making the routine read:

	#include <sgtty.h>
	    .
	    .
	    .
	istty(fd)
	int fd;
	{
		register int r;
		struct sgttyb sg;
		char *getenv();		/* not ``char getenv();'' */

		sg.sg_flags = 0;	/* this is how BS1 was defined
					   in the original; but BS1 is
					   something else in sgtty.h. */
		r = 0;
		if (gtty(fd, &sg) >= 0)
			++r;
	#ifdef CLEAR
		zflg = (sg.sg_flags & 0) == 0;	/* this is always true */
					/* was & BS1 */
	#endif
		if (pipef
	#ifdef V7
			  || getenv("FOO") == 0
	#endif
						)
			++r;
		return (r);
	}
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 4251)
UUCP:	seismo!umcp-cs!chris
CSNet:	chris at umcp-cs		ARPA:	chris at maryland



More information about the Net.bugs.v7 mailing list