This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
fseek() vs. fseeko()
- From: Sebastian Huber <sebastian dot huber at embedded-brains dot de>
- To: newlib at sourceware dot org
- Date: Tue, 19 Jun 2012 14:43:24 +0200
- Subject: fseek() vs. fseeko()
Hello,
the fseeko() is implemented as
int
_DEFUN(fseeko, (fp, offset, whence),
register FILE *fp _AND
_off_t offset _AND
int whence)
{
/* for now we simply cast since off_t should be long */
return _fseek_r (_REENT, fp, (long)offset, whence);
}
thus even if sizeof(off_t) > sizeof(long) we can only use the range of long in
fseeko(). Is this intentional? Open group says:
http://pubs.opengroup.org/onlinepubs/009696699/functions/fseek.html
"The fseeko() function shall be equivalent to the fseek() function except that
the offset argument is of type off_t."
Does the demanded equivalence really intend to degenerated fseeko() to
fseek(fp, (long) offset, whence)?
--
Sebastian Huber, embedded brains GmbH
Address : Obere Lagerstr. 30, D-82178 Puchheim, Germany
Phone : +49 89 18 90 80 79-6
Fax : +49 89 18 90 80 79-9
E-Mail : sebastian.huber@embedded-brains.de
PGP : Public key available on request.
Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.