---
name: "rfio_fseek"
section: "3"
platform: "linux"
package: "libdpm-dev"
version: "1.10.0-2+b3"
release: "Debian 10 (Buster)"
platforms: ["linux"]
url: "https://new.carta.tech/rfio_fseek"
---

# rfio\_fseek(3)

positions/repositions a file

## NAME

rfio\_fseek - positions/repositions a file

## SYNOPSIS

**#include \<sys/types.h\>**\
 **#include "rfio\_api.h"**

**int rfio\_fseek (FILE \****fp***, long** *offset***, int** *whence***);**

Under Linux, for large files:\
 **#define \_LARGEFILE64\_SOURCE**\
 **#include \<sys/types.h\>**\
 **#include "rfio\_api.h"**

**int rfio\_fseeko64 (FILE \****fp***, off64\_t** *offset***, int** *whence***);**\

For large files, under other systems:\
 **#include \<sys/types.h\>**\
 **#include "rfio\_api.h"**

**int rfio\_fseeko64 (FILE \****fp***, off64\_t** *offset***, int** *whence***);**

## DESCRIPTION

**rfio\_fseek** positions/repositions to *offset* the file associated with the descriptor *fp* generated by a previous **rfio\_fopen**. *whence* indicates how to interpret the *offset* value:

- **SEEK\_SET**

  The offset is set from beginning of file.

- **SEEK\_CUR**

  The offset is added to current position.

- **SEEK\_END**

  The offset is added to current file size.

**rfio\_fseeko64** can be used with large files and allows to use a 64 bit offset rather than a long.

## RETURN VALUE

This routine returns 0 if the operation was successful or -1 if the operation failed. In the latter case, **serrno** is set appropriately.

## ERRORS

- **EBADF**

  *fp* is not a valid descriptor.

- **EINVAL**

  incorrect value for *whence*.

- **SENOSHOST**

  Host unknown.

- **SENOSSERV**

  Service unknown.

- **SETIMEDOUT**

  Timed out.

- **SEBADVERSION**

  Version ID mismatch.

- **SEINTERNAL**

  Internal error.

- **SECONNDROP**

  Connection closed by remote end.

- **SECOMERR**

  Communication error.

## SEE ALSO

**[rfio\_fopen(3)](/rfio_fopen/3.md)**

## AUTHOR

**LCG Grid Deployment** Team
