3 <<fsetpos64>>---restore position of a large stream or file
12 int fsetpos64(FILE *<[fp]>, const _fpos64_t *<[pos]>);
13 int _fsetpos64_r(struct _reent *<[ptr]>, FILE *<[fp]>,
14 const _fpos64_t *<[pos]>);
18 int fsetpos64(<[fp]>, <[pos]>)
22 int _fsetpos64_r(<[ptr]>, <[fp]>, <[pos]>)
23 struct _reent *<[ptr]>;
28 Objects of type <<FILE>> can have a ``position'' that records how much
29 of the file your program has already read. Many of the <<stdio>> functions
30 depend on this position, and many change it as a side effect.
32 You can use <<fsetpos64>> to return the large file identified by <[fp]> to a
33 previous position <<*<[pos]>>> (after first recording it with <<fgetpos64>>).
35 See <<fseeko64>> for a similar facility.
38 <<fgetpos64>> returns <<0>> when successful. If <<fgetpos64>> fails, the
39 result is <<1>>. The reason for failure is indicated in <<errno>>:
40 either <<ESPIPE>> (the stream identified by <[fp]> doesn't support
41 64-bit repositioning) or <<EINVAL>> (invalid file position).
44 <<fsetpos64>> is a glibc extension.
46 Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
47 <<lseek64>>, <<read>>, <<sbrk>>, <<write>>.
52 #ifdef __LARGE64_FILES
55 _DEFUN (_fsetpos64_r
, (ptr
, iop
, pos
),
56 struct _reent
*ptr _AND
58 _CONST _fpos64_t
* pos
)
60 int x
= _fseeko64_r (ptr
, iop
, (_off64_t
)(*pos
), SEEK_SET
);
70 _DEFUN (fsetpos64
, (iop
, pos
),
72 _CONST _fpos64_t
* pos
)
74 return _fsetpos64_r (_REENT
, iop
, pos
);
77 #endif /* !_REENT_ONLY */
79 #endif /* __LARGE64_FILES */