1 /* $Id: fseeko.c 3680 2000-07-29 22:54:52Z rra $
3 ** Replacement for a missing fseeko.
5 ** fseeko is a version of fseek that takes an off_t instead of a long. For
6 ** large file support (and because it's a more logical interface), INN uses
7 ** fseeko unconditionally; if fseeko isn't provided by a platform but
8 ** fpos_t is compatible with off_t (as in BSDI), define it in terms of
9 ** fsetpos. Otherwise, just call fseek (which won't work for files over
20 fseeko(FILE *stream, off_t pos, int whence)
27 return fsetpos(stream, &fpos);
30 if (fseek(stream, 0, SEEK_END) < 0)
37 if (fgetpos(stream, &fpos) < 0)
40 return fsetpos(stream, &fpos);
48 #else /* !HAVE_LARGE_FPOS_T */
51 fseeko(FILE *stream, off_t pos, int whence)
53 return fseek(stream, (long) pos, whence);
56 #endif /* !HAVE_LARGE_FPOS_T */