Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 Nov 1998 11:27:10 -0500 (EST)
From:      Thomas David Rivers <rivers@dignus.com>
To:        freebsd-hackers@freefall.cdrom.com
Subject:   A stdio question...  does fpos_t really need to be 'long long'?
Message-ID:  <199811091627.LAA23614@lakes.dignus.com>

next in thread | raw e-mail | index | archive | help

Ok - here's a question for the stdio internal gurus...

  ftell() is defined to return a 'long' (32 bits).

  fpos_t is defined as a 'long long' (64 bits).

  fgetpos() accepts an fpos_t as it's second argument, and is
  implemented as:

	{
	  int retval;
	  retval = (*pos = ftell(fp)) == (fpos_t) -1;
	  return (retval);
	}

  Now - given this - how will fgetpos() ever succeed on a file
 position greater than 2**32 - since ftell() can't return anything
 larger than that...

  Moreover - what if you do an fsetpos() on something larger than
 2**32 and then do an fgetpos() to see if it actually worked...

  If this is the case... then why is fpos_t a 'long long'?  If, in fact,
 it can never be set that large?

  I must be missing something here...

	- Dave Rivers -




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199811091627.LAA23614>