---
name: "SDL_SeekIO"
section: "3"
platform: "linux"
package: "libsdl3-doc"
version: "3.2.10+ds-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/SDL_SeekIO"
---

# SDL\_SeekIO(3)

Seek within an SDL\_IOStream data stream.

## NAME

SDL\_SeekIO - Seek within an  **SDL\_IOStream**\
  data stream.

## HEADER FILE

Defined in SDL3/SDL\_iostream.h

## SYNOPSIS

```
#include "SDL3/SDL.h"
```

**Sint64 SDL\_SeekIO(SDL\_IOStream \*context, Sint64 offset, SDL\_IOWhence whence);**

## DESCRIPTION

This function seeks to byte **offset** , relative to **whence** . **whence** may be any of the following values:

•  **SDL\_IO\_SEEK\_SET** : seek from the beginning of data

•  **SDL\_IO\_SEEK\_CUR** : seek relative to current read point

•  **SDL\_IO\_SEEK\_END** : seek relative to the end of data

If this stream can not seek, it will return -1.

## FUNCTION PARAMETERS

- *context*

  a pointer to an  **SDL\_IOStream**\
    structure.

- *offset*

  an offset in bytes, relative to **whence** location; can be negative.

- *whence*

  any of  **SDL\_IO\_SEEK\_SET** ,  **SDL\_IO\_SEEK\_CUR** ,  **SDL\_IO\_SEEK\_END** .

## RETURN VALUE

( **Sint64** ) Returns the final offset in the data stream after the seek or -1 on failure; call  **SDL\_GetError** () for more information.

## THREAD SAFETY

This function is not thread safe.

## AVAILABILITY

This function is available since SDL 3.2.0.

## SEE ALSO

**•**(3), [**SDL\_TellIO**(3)](/SDL_TellIO/3.md)
