---
name: "SDL_WriteAsyncIO"
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_WriteAsyncIO"
---

# SDL\_WriteAsyncIO(3)

Start an async write.

## NAME

SDL\_WriteAsyncIO - Start an async write.

## HEADER FILE

Defined in SDL3/SDL\_asyncio.h

## SYNOPSIS

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

**bool SDL\_WriteAsyncIO(SDL\_AsyncIO \*asyncio, void \*ptr, Uint64 offset, Uint64 size, SDL\_AsyncIOQueue \*queue, void \*userdata);**

## DESCRIPTION

This function writes **size** bytes from **offset** position in the data source to the area pointed at by **ptr** .

This function returns as quickly as possible; it does not wait for the write to complete. On a successful return, this work will continue in the background. If the work begins, even failure is asynchronous: a failing return value from this function only means the work couldn't start at all. **ptr** must remain available until the work is done, and may be accessed by the system at any time until then. Do not allocate it on the stack, as this might take longer than the life of the calling function to complete!

An  **SDL\_AsyncIOQueue**\
  must be specified. The newly-created task will be added to it when it completes its work.

## FUNCTION PARAMETERS

- *asyncio*

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

- *ptr*

  a pointer to a buffer to write data from.

- *offset*

  the position to start writing to the data source.

- *size*

  the number of bytes to write to the data source.

- *queue*

  a queue to add the new  **SDL\_AsyncIO**\
    to.

- *userdata*

  an app-defined pointer that will be provided with the task results.

## RETURN VALUE

Returns true on success or false on failure; call

**SDL\_GetError** () for more information.

## THREAD SAFETY

It is safe to call this function from any thread.

## AVAILABILITY

This function is available since SDL 3.2.0.

## SEE ALSO

**•**(3), [**SDL\_ReadAsyncIO**(3)](/SDL_ReadAsyncIO/3.md), **•**(3), [**SDL\_CreateAsyncIOQueue**(3)](/SDL_CreateAsyncIOQueue/3.md)
