---
name: "SDL_GetSemaphoreValue"
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_GetSemaphoreValue"
---

# SDL\_GetSemaphoreValue(3)

Get the current value of a semaphore.

## NAME

SDL\_GetSemaphoreValue - Get the current value of a semaphore.

## HEADER FILE

Defined in SDL3/SDL\_mutex.h

## SYNOPSIS

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

**Uint32 SDL\_GetSemaphoreValue(SDL\_Semaphore \*sem);**

## FUNCTION PARAMETERS

- *sem*

  the semaphore to query.

## RETURN VALUE

( **Uint32** ) Returns the current value of the semaphore.

## AVAILABILITY

This function is available since SDL 3.2.0.
