Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!gatech!akgua!lcuxlm!whuxl!houxm!ihnp4!cuae2!heiby From: heiby@cuae2.UUCP (Ron Heiby) Newsgroups: net.sources.games Subject: Re: Larn compiling ERROR Message-ID: <2306@cuae2.UUCP> Date: Thu, 21-Aug-86 12:22:28 EDT Article-I.D.: cuae2.2306 Posted: Thu Aug 21 12:22:28 1986 Date-Received: Fri, 22-Aug-86 21:07:31 EDT References: <636@hropus.UUCP> Reply-To: heiby@cuae2.UUCP (-Ron Heiby) Organization: AT&T - /app/eng, Lisle, IL Lines: 52 Here are the changes I made to my SVR2.1 system to tok.c to get things to appear to work. I've included just a few lines near the two ioctls that use FIONREAD. I've played very little, so don't know if my changes have fixed all cases. Also, the problem with the initializers in signal.c is because the definition of signame[] includes signame[NSIG], which is 20 on SVR2 machines, but there are more than 20 initializers. The approach I took was to change the definition to "static char *signame[] = ..." to allow the compiler to figure out how much space to allocate. ------ from tok.c ------ #ifndef SYSV do /* if keyboard input buffer is too big, flush some of it */ { ioctl(0,FIONREAD,&ic); if (ic>flushno) read(0,&cc,1); } while (ic>flushno); #endif if (read(0,&cc,1) != 1) return(lastok = -1); if (cc == 'Y'-64) /* control Y -- shell escape */ { .................. /* * flushall() Function to flush all type-ahead in the input buffer */ flushall() { char cc; int ic; for (;;) /* if keyboard input buffer is too big, flush some of it */ { #ifdef SYSV ioctl(0,TCFLSH,0); return; #else ioctl(0,FIONREAD,&ic); if (ic<=0) return; while (ic>0) { read(0,&cc,1); --ic; } /* gobble up the byte */ #endif } } -- Ron Heiby {NAC|ihnp4}!cuae2!heiby Moderator: mod.newprod & mod.os.unix AT&T-IS, /app/eng, Lisle, IL (312) 810-6109 "'Cause there's lots of things in this world that need to BE turned around."