delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/10/24/15:50:18

From: Alain Magloire <alainm AT rcsm DOT ece DOT mcgill DOT ca>
Message-Id: <199910241901.PAA27802@mccoy2.ECE.McGill.CA>
Subject: Re: Bug in fsetpos()?
To: eliz AT is DOT elta DOT co DOT il (Eli Zaretskii)
Date: Sun, 24 Oct 1999 15:01:23 -0400 (EDT)
Cc: djgpp-workers AT delorie DOT com
In-Reply-To: <Pine.SUN.3.91.991024093430.29385N-100000@is> from "Eli Zaretskii" at Oct 24, 99 09:34:41 am
X-Mailer: ELM [version 2.4 PL25]
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

Bonjour M. Eli Zaretskii

> 
> On Thu, 21 Oct 1999, Alain Magloire wrote:
> 
> > > Linux says:
> > > 
> > > RETURN VALUES
> > >        The rewind function returns no value.  Upon successful
> > >        completion, fgetpos, fseek, fsetpos return 0, and ftell returns
> > >        the current offset.  Otherwise, -1 is returned and the global
> > >        variable errno is set to indicate the error.
> > 
> > I would consider this to be a "bug" in the Linux man pages.
> 
> Sorry, I must be missing something here.  What bug do you see in this
> description?

"Bug" is a big word, rater nit-picking.

I'm just advocating for use of "!= 0" instead of "-1" in the docs.
As I say the stds only require a return value of "0" for sucess and
different then "0" otherwise.  Since most implementation I've seen do
fsetpos() { return fseek(); }
This is a moot point.  It's just that by reading the Linux man, you would
be tempted to test for error by doing
(fsetpos() == -1)   instead of (fsetpos() != 0)

If you are doing lot of porting, little things like that
can make you loose lot of hair.
But then again, I've never seen such case yet.

-- 
au revoir, alain
----
Aussi haut que l'on soit assis, on est toujours assis que sur son cul !!!

- Raw text -


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