Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!topaz.rutgers.edu!ron From: ron@topaz.rutgers.edu (Ron Natalie) Newsgroups: comp.bugs.4bsd Subject: Re: read() from tty has fencepost error Message-ID: <13048@topaz.rutgers.edu> Date: Tue, 30-Jun-87 15:45:14 EDT Article-I.D.: topaz.13048 Posted: Tue Jun 30 15:45:14 1987 Date-Received: Wed, 1-Jul-87 05:49:09 EDT References: <648@haddock.UUCP> <6040@brl-smoke.ARPA> Organization: Rutgers Univ., New Brunswick, N.J. Lines: 40 Excuse me System V breath, if you look on your own beloved operating system you will see that EOT works the opposite way that it does on system V, that is, the following code main() { int count; char buf[10]; do { count = read(0, buf, 5); printf("\ncount = %d\n", count); } while(count); } Does the following on Berkeley UNIX (SUN 3.2): % a.out a count = 2 abcde count = 5 count = 0 % note that it doesn't read the keyboard between the last two printfs. on both a 3B20 running Sys VR2v3 and a 3B2 running Sys VR3 % a.out a count = 2 abcde count = 5 ...at this point it waits for you to type more input... I guess System V is wrong for once :-) -Ron