Date: Mon, 27 Apr 1998 13:14:47 +0300 (IDT) From: Eli Zaretskii To: "Gerhard W. Gruber" cc: djgpp AT delorie DOT com Subject: Re: Problem with read() In-Reply-To: <35443AEB.7115C264@sis.co.at> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Mon, 27 Apr 1998, Gerhard W. Gruber wrote: > I seek to position 5 of the file and call read with read(hdl, buffer, > 4096). The result of read should be the number of bytes actually read or -1 > if an error occured. In this case it should return 5 bytes, because the > remainder of the file is 5 bytes, but I get -1. Please post the shortest complete program which exhibits this behavior. > I thought that the standard says that reading beyond the EOF is not an > error condition. Which standard did you have in mind? `read' is only standard in Posix, ANSI doesn't have it. I don't have Posix handy, so can you tell what does it say in that case?