Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site ukma.UUCP Path: utzoo!watmath!clyde!cbosgd!hasmed!qusavx!ukma!david From: david@ukma.UUCP (David Herron, NPR Lover) Newsgroups: net.unix-wizards Subject: Re: Scanning stdin with no pause Message-ID: <432@ukma.UUCP> Date: Wed, 26-Dec-84 20:11:56 EST Article-I.D.: ukma.432 Posted: Wed Dec 26 20:11:56 1984 Date-Received: Fri, 28-Dec-84 05:59:33 EST References: <6678@brl-tgr.ARPA> Organization: Univ. of KY Mathematical Sciences Lines: 27 We had to do this a couple of years ago to get running a multi-user version of empire and some other games. (We do important work around here!!!!) We did the following: The system call fstat(2) is used to get info about a file... It is located in sys3.c in the kernel. Normally, the st_size field in the stat structure is set to the size of the file. This is always zero if the file is a tty. So, we put in a test to see if the file was a tty, and if it was, we stored the sum of the char counts of the character queues associated with that tty (simple huh). If we had the code in front of us, we could be more specific, but that's life in the big city. Hint: I think we checked the major device number -- you'll see where this gets assigned into the stat structure. I think the if(...) was a compound OR or AND so there was more than one thing we needed to check... (wws, whuxlg!wws, on vacation) --:--:--:--:--:--:--:--:--:--:--:--:--:--:--:--:--:--:--:--:--:--:--:--:- David Herron; ARPA-> "ukma!david"@ANL-MCS (Try the arpa address w/ and w/o the quotes, I have had much trouble with both.) UUCP -:--:--:--:--:--:--:--:--:- (follow one of these routes) {ucbvax,unmvax,boulder,research} ! {anlams,anl-mcs} -----\ vvvvvvvvvvv >-!ukma!david {cbosgd!hasmed,mcvax!qtlon,vax135,mddc} ! qusavx -----/ ^^^^^^^^^^^