Date: Thu, 31 Aug 2000 07:47:13 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: Jason Green cc: lauras AT softhome DOT net, djgpp-workers AT delorie DOT com Subject: Re: Symify fixes In-Reply-To: <3b5rqskv9adg5lcc3p4nhg2doib859r3n8@4ax.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Thu, 31 Aug 2000, Jason Green wrote: > I did actually think about this. fseek() and fread() are not listed > (in the POSIX P.G.) as setting errno. The DJGPP library always sets errno each time a system call (i.e., a function of Int 21h via __dpmi_int) is made. > To know that these functions > will set errno requires inside knowledge of libc, so I played it safe. > > > > if errno != 0? > > It's not sufficient to simply test errno to see if an error occured, > because it only has meaningful value if tested after a system call > that has returned some failure indication. The portable way to check for errno is to set it to zero before the call to a function, then see if it is still zero after the function returns. > > But I agree that a more specific error message is a good idea. > > I don't see how it is possible to give more specific error messages, I meant to say that adding strerror will result in more specific error messages. Saying "read error: Bad file descriptor" is more informative than just "read error", IMHO.