Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site ucbvax.BERKELEY.EDU Path: utzoo!watmath!clyde!burl!ulysses!ucbvax!info-vax From: Rudy.Nedved@A.CS.CMU.EDU Newsgroups: mod.computers.vax Subject: Re: read() in VAX C 2.1 (VMS 4.2) Message-ID: <25Feb86.165334.EN0C@A.CS.CMU.EDU> Date: Tue, 25-Feb-86 16:53:00 EST Article-I.D.: A.25Feb86.165334.EN0C Posted: Tue Feb 25 16:53:00 1986 Date-Received: Sat, 1-Mar-86 23:30:31 EST References: <8602250254.AA02340@csvax.caltech.edu> Sender: usenet@ucbvax.BERKELEY.EDU Organization: The ARPA Internet Lines: 13 Approved: info-vax@sri-kl.arpa Nothing int the semantics of Unix or C disallows returning less then the buffer size. This has always been true for reading a line from a terminal or getting incoming data from a network. The only problem that I have come across with VMS C is that for some reason a read() with a buffer size > 2**16 sometimes returns 0. I hacked the code to always use a buffer less then 2**16 and the problem went away....I was porting emacs which likes to do stats on the file getting filesize X, allocs mem of size X and then does a read of size X into the memory...it loops if the read is incomplete but terminates with an error or eof if the read() returns <= 0. -Rudy