---
name: "SDL_SemValue"
section: "3"
platform: "linux"
package: "libsdl1.2-dev"
version: "1.2.15+dfsg2-8"
release: "Debian 12 (Bookworm)"
platforms: ["linux"]
url: "https://new.carta.tech/SDL_SemValue"
---

# SDL\_SemValue(3)

Return the current value of a semaphore.

## NAME

SDL\_SemValue - Return the current value of a semaphore.

## SYNOPSIS

**#include "SDL.h"** **#include "SDL/SDL\_thread.h"**

**Uint32 SDL\_SemValue**(**SDL\_sem \*sem**);

## DESCRIPTION

**SDL\_SemValue()** returns the current semaphore value from the semaphore pointed to by **sem**.

## RETURN VALUE

Returns current value of the semaphore.

## EXAMPLES

```
  sem_value = SDL_SemValue(my_sem);
```

## SEE ALSO

**SDL\_CreateSemaphore**, **SDL\_DestroySemaphore**, **SDL\_SemWait**, **SDL\_SemTryWait**, **SDL\_SemWaitTimeout**, **SDL\_SemPost**
