delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2000/08/31/00:48:27

Date: Thu, 31 Aug 2000 07:47:13 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Jason Green <mail AT jgreen4 DOT fsnet DOT co DOT uk>
cc: lauras AT softhome DOT net, djgpp-workers AT delorie DOT com
Subject: Re: Symify fixes
In-Reply-To: <3b5rqskv9adg5lcc3p4nhg2doib859r3n8@4ax.com>
Message-ID: <Pine.SUN.3.91.1000831074644.20860E-100000@is>
MIME-Version: 1.0
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

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.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019