Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site umcp-cs.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!umcp-cs!chris From: chris@umcp-cs.UUCP (Chris Torek) Newsgroups: net.bugs.4bsd,net.bugs.v7 Subject: Re: Pyramid 90X C program dumps core Message-ID: <1689@umcp-cs.UUCP> Date: Thu, 26-Sep-85 18:15:53 EDT Article-I.D.: umcp-cs.1689 Posted: Thu Sep 26 18:15:53 1985 Date-Received: Sat, 28-Sep-85 08:18:48 EDT References: <11859@rochester.UUCP> Organization: U of Maryland, Computer Science Dept., College Park, MD Lines: 40 Xref: watmath net.bugs.4bsd:1773 net.bugs.v7:212 ``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. . . 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@umcp-cs ARPA: chris@maryland