.\" Copyright (c) 1990 The Regents of the University of California.
.\" This code is derived from software contributed to Berkeley by
.\" %sccs.include.redist.man%
.\" @(#)fseek.3 6.7 (Berkeley) %G%
fgetpos, fseek, fsetpos, ftell, rewind \- reposition a stream
fseek(FILE *stream, long offset, int whence);
fgetpos(FILE *stream, fpos_t *pos);
fsetpos(FILE *stream, fpos_t *pos);
sets the position of the next input or output
The new position is at the signed distance
bytes from a specified point in the file depending on the
is set to SEEK_SET, SEEK_CUR, or SEEK_END, the offset is from the
beginning, the current position, or the end of the file, respectively.
returns the current value of the offset relative to the beginning
of the file associated with the named
is equivalent to ``fseek(stream, 0L, SEEK_SET)'', except the error
indicator for the stream is cleared as well (see
are alternate interfaces equivalent to
(with whence set to SEEK_SET), setting and storing the current value of
the file offset into or from the object referenced by
On some (non-UNIX) systems an ``fpos_t'' object may be a complex object
and these routines may be the only way to portably reposition a text stream.
Upon successful completion,
Otherwise, \-1 is returned and the global variable errno is set to
is not a seekable stream.
was not SEEK_SET, SEEK_END, or SEEK_CUR.
for any of the errors specified for the routines
conform to ANSI X3.159-1989 (``ANSI C'').