---
name: "sem"
section: "4freebsd"
platform: "linux"
package: "freebsd-manpages"
version: "12.2-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/sem/4freebsd"
---

# sem(4freebsd)

POSIX semaphores

## NAME

**sem** – POSIX semaphores

## SYNOPSIS

To compile this driver into the kernel, place the following line in your kernel configuration file:

**options P1003\_1B\_SEMAPHORES**

Alternatively, to load the driver as a module at boot time, place the following line in [loader.conf(5)](/loader.conf/5.md):

```
sem_load="YES"
```

To load the driver as a module at run-time, run the following command as root:

kldload sem

## DESCRIPTION

The **sem** facility provides system calls used by the standard C library (*libc*) to implement POSIX semaphores. This facility offers support for such functions as **sem\_init**() and **sem\_wait**(). It is available both as a kernel option for static inclusion and as a dynamic kernel module.

## SEE ALSO

[sem\_destroy(3)](/sem_destroy/3.md), [sem\_getvalue(3)](/sem_getvalue/3.md), [sem\_init(3)](/sem_init/3.md), [sem\_open(3)](/sem_open/3.md), [sem\_post(3)](/sem_post/3.md), [sem\_wait(3)](/sem_wait/3.md), [config(8)](/config/8.md), [kldload(8)](/kldload/8.md), [kldunload(8)](/kldunload/8.md)

## HISTORY

The **sem** facility appeared in FreeBSD 5.0.
