---
name: "gfs_pio_seek"
section: "3"
platform: "linux"
package: "libgfarm-dev"
version: "2.7.20+dfsg-1.2+b1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/gfs_pio_seek"
---

# gfs\_pio\_seek(3)

reposition a stream

## NAME

gfs\_pio\_seek - reposition a stream

## SYNOPSIS

```
#include <gfarm/gfarm.h>
```

**gfarm\_error\_t gfs\_pio\_seek(GFS\_File** *gf***, gfarm\_off\_t** *offset***, int** *whence***, gfarm\_off\_t \*** *result***);**

## DESCRIPTION

The **gfs\_pio\_seek()** function sets the file position indicator for the file *gf*. The new position, measured in bytes, is obtained by adding *offset* bytes to the position specified by *whence*. If *whence* is set to GFARM\_SEEK\_SET, GFARM\_SEEK\_CUR, or GFARM\_SEEK\_END, the offset is relative to the start of the file, the current position indicator, or end-of-file, respectively. When *result* is not NULL, the new position returns to the address pointed by *result*.

## RETURN VALUES

**GFARM\_ERR\_NO\_ERROR**

The function terminated successfully.

**GFARM\_ERR\_NO\_MEMORY**

Insufficient memory was available.

**GFARM\_ERR\_INVALID\_ARGUMENT**

Specified whence or offset is invalid.

Other

An error except the above occurred. The reason is shown by **gfarm\_error\_string**(3).

## SEE ALSO

[**gfs\_pio\_create**(3)](/gfs_pio_create/3.md), [**gfs\_pio\_open**(3)](/gfs_pio_open/3.md)
