3 * 64-bit versions of fseeko/ftello() for systems which do not have them
19 * On BSD/OS and NetBSD (and perhaps others), off_t and fpos_t are the
20 * same. Standards say off_t is an arithmetic type, but not necessarily
21 * integral, while fpos_t might be neither.
23 * This is thread-safe on BSD/OS using flockfile/funlockfile.
27 fseeko(FILE *stream
, off_t offset
, int whence
)
36 if (fgetpos(stream
, &floc
) != 0)
39 if (fsetpos(stream
, &floc
) != 0)
45 if (fsetpos(stream
, &offset
) != 0)
51 if (fstat(fileno(stream
), &filestat
) != 0)
53 floc
= filestat
.st_size
;
54 if (fsetpos(stream
, &floc
) != 0)