---
name: "rfio_lseek"
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_lseek"
---

# rfio\_lseek(3)

positions/repositions a file

## NAME

rfio\_lseek - positions/repositions a file

## SYNOPSIS

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

**off\_t rfio\_lseek (int** *s***, off\_t** *offset***, int** *how***);**\

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

**off64\_t rfio\_lseek64 (int** *s***, off64\_t** *offset***, int** *how***);**\

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

**off64\_t rfio\_lseek64 (int** *s***, off64\_t** *offset***, int** *how***);**

## DESCRIPTION

**rfio\_lseek** positions/repositions to *offset* the file associated with the descriptor *s* generated by a previous **rfio\_open**. *how* 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\_lseek64** performs the same function on large files using off64\_t rather than off\_t.

## RETURN VALUE

**This routine returns -1 if the operation failed or the actual offset from the** beginning of file. In case of failure,  **serrno** is set appropriately.

## ERRORS

- **EBADF**

  *s* is not a valid descriptor.

- **EINVAL**

  incorrect value for *how*.

- **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\_open(3)](/rfio_open/3.md)**

## AUTHOR

**LCG Grid Deployment** Team
