3 * 64-bit versions of fseeko/ftello() for systems which do not have them
8 #if !defined(HAVE_FSEEKO) || !defined(HAVE_FTELLO)
10 #include <sys/types.h>
21 * On BSD/OS and NetBSD (and perhaps others), off_t and fpos_t are the
22 * same. Standards say off_t is an arithmetic type, but not necessarily
23 * integral, while fpos_t might be neither.
25 * This is thread-safe on BSD/OS using flockfile/funlockfile.
30 fseeko(FILE *stream
, off_t offset
, int whence
)
39 if (fgetpos(stream
, &floc
) != 0)
42 if (fsetpos(stream
, &floc
) != 0)
48 if (fsetpos(stream
, &offset
) != 0)
54 if (fstat(fileno(stream
), &filestat
) != 0)
56 floc
= filestat
.st_size
;
57 if (fsetpos(stream
, &floc
) != 0)
80 if (fgetpos(stream
, &floc
) != 0)