---
name: "SDL_WaitProcess"
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_WaitProcess"
---

# SDL\_WaitProcess(3)

Wait for a process to finish.

## NAME

SDL\_WaitProcess - Wait for a process to finish.

## HEADER FILE

Defined in SDL3/SDL\_process.h

## SYNOPSIS

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

**bool SDL\_WaitProcess(SDL\_Process \*process, bool block, int \*exitcode);**

## DESCRIPTION

This can be called multiple times to get the status of a process.

The exit code will be the exit code of the process if it terminates normally, a negative signal if it terminated due to a signal, or -255 otherwise. It will not be changed if the process is still running.

If you create a process with standard output piped to the application ( **pipe\_stdio** being true) then you should read all of the process output before calling  **SDL\_WaitProcess** (). If you don't do this the process might be blocked indefinitely waiting for output to be read and

**SDL\_WaitProcess** () will never return true;

## FUNCTION PARAMETERS

- *process*

  The process to wait for.

- *block*

  If true, block until the process finishes; otherwise, report on the process' status.

- *exitcode*

  a pointer filled in with the process exit code if the process has exited, may be NULL.

## RETURN VALUE

Returns true if the process exited, false otherwise.

## THREAD SAFETY

This function is not thread safe.

## AVAILABILITY

This function is available since SDL 3.2.0.

## SEE ALSO

**•**(3), [**SDL\_CreateProcess**(3)](/SDL_CreateProcess/3.md), **•**(3), [**SDL\_CreateProcessWithProperties**(3)](/SDL_CreateProcessWithProperties/3.md), **•**(3), [**SDL\_KillProcess**(3)](/SDL_KillProcess/3.md), **•**(3), [**SDL\_DestroyProcess**(3)](/SDL_DestroyProcess/3.md)
