Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!rochester!rit!cci632!tvf From: tvf@cci632.UUCP (Tom Frauenhofer) Newsgroups: comp.os.minix Subject: Re: /usr/minix/amoeba/examples/client3.c Message-ID: <27232@cci632.UUCP> Date: 20 Mar 89 13:47:51 GMT References: <11077@louie.udel.EDU> Reply-To: tvf@ccird7.UUCP (Tom Frauenhofer) Organization: CCI, Communications Systems Division, Rochester, NY Lines: 19 In article <11077@louie.udel.EDU> jnall%FSU.BITNET@cunyvm.cuny.edu (John Nall 904-644-5241) writes: >Therefore, I thought it was amusing that one of my students (a foreign >student, actually, with a real language gap) who is just learning C >pointed out to me that Andy's sample remote file client program, >client3.c, does not work because the main routine has a read statement >which is of the form "if ((n=read(fd,buf,bytes) < 0))" and, as stated >on page 15 of K&R, this always sets n to 0 or 1, rather than the number >of bytes read. The code is correct. If there is an error with the read, it returns -1. Check page 160, K&R, section 8.2 (Low Level I/O - Read and Write), the second paragraph (the one that begins "Each call returns..." - the paragraph after the sample code). Thomas V. Frauenhofer ...!rutgers!rochester!cci632!ccird7!tvf *or* ...!rochester!cci632!ccird7!frau!tvf *or* ...!rochester!rit!anna!ma!tvf1477 BLOOM: You can't shoot the actors! They're human beings! BIALYSTOCK: Oh Yeah? You ever eat with one?