Scanning stdin with no pause

David Herron, NPR Lover david at ukma.UUCP
Thu Dec 27 11:11:56 AEST 1984


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 -----/  ^^^^^^^^^^^



More information about the Comp.unix.wizards mailing list