Guardian C Library Calls Reference Manual

Reference to Library Calls
Guardian TNS C Library Calls Reference Manual128833 3-67
fsetpos
Example
In this example, the fseek function sets the file-position indicator to the beginning of the
file:
#include <stdioh>
FILE *fp;
int status;
long pos;
fp = fopen("$a.b.c", "r+");
/* ... */
pos = 0;
status = fseek(fp, pos, SEEK_SET);
fsetpos
The fsetpos function sets the file-position indicator for the file pointed to by stream to
the value pointed to by pos. This value was obtained from an earlier call to the fgetpos
function on the same file.
stream
points to the file whose file indicator is to be reset.
pos
points to the variable that holds the stored value of the file indicator.
Return Value
is zero if successful and clears the end-of-file indicator. Otherwise, a nonzero value
is returned and errno is set to a positive value.
#include <stdioh>
int fsetpos(FILE *stream, const fpos_t *pos);