This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]