Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!husc6!cmcl2!rutgers!gatech!amdcad!rpw3 From: rpw3@amdcad.AMD.COM (Rob Warnock) Newsgroups: comp.bugs.4bsd Subject: Re: read() from tty has fencepost error Message-ID: <17345@amdcad.AMD.COM> Date: Wed, 1-Jul-87 19:07:50 EDT Article-I.D.: amdcad.17345 Posted: Wed Jul 1 19:07:50 1987 Date-Received: Fri, 3-Jul-87 01:50:35 EDT References: <648@haddock.UUCP> <6040@brl-smoke.ARPA> <13048@topaz.rutgers.edu> Reply-To: rpw3@amdcad.UUCP (Rob Warnock) Organization: [Consultant] San Mateo, CA Lines: 25 My understanding has always been that was a "push" which did not store data in the stream. By "push" I simply mean "return from the read with whatever you've got so far. (Under this interpretation, usually means "store an then 'push'".) The function of arises because if you "push" at the beginning of a line (before data is typed), the "read()" will return zero. But if you "push" after N characters have been typed, you get N characters. Therefore, by the "Principle Of [my own] Least Astonishment": abcde should return 5 characters, and the next call to "read()" should block. In this case, System-V does it *right*! Rob Warnock Systems Architecture Consultant UUCP: {amdcad,fortune,sun,attmail}!redwood!rpw3 ATTmail: !rpw3 DDD: (415)572-2607 USPS: 627 26th Ave, San Mateo, CA 94403