---
name: "SDL_GetEnvironment"
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_GetEnvironment"
---

# SDL\_GetEnvironment(3)

Get the process environment.

## NAME

SDL\_GetEnvironment - Get the process environment.

## HEADER FILE

Defined in SDL3/SDL\_stdinc.h

## SYNOPSIS

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

**SDL\_Environment \* SDL\_GetEnvironment(void);**

## DESCRIPTION

This is initialized at application start and is not affected by setenv() and unsetenv() calls after that point. Use

**SDL\_SetEnvironmentVariable** () and

**SDL\_UnsetEnvironmentVariable** () if you want to modify this environment, or  **SDL\_setenv\_unsafe** () or

**SDL\_unsetenv\_unsafe** () if you want changes to persist in the C runtime environment after  **SDL\_Quit** ().

## RETURN VALUE

( **SDL\_Environment**\
  \*) Returns a pointer to the environment for the process or NULL 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\_GetEnvironmentVariable**(3)](/SDL_GetEnvironmentVariable/3.md), **•**(3), [**SDL\_GetEnvironmentVariables**(3)](/SDL_GetEnvironmentVariables/3.md), **•**(3), [**SDL\_SetEnvironmentVariable**(3)](/SDL_SetEnvironmentVariable/3.md), **•**(3), [**SDL\_UnsetEnvironmentVariable**(3)](/SDL_UnsetEnvironmentVariable/3.md)
