#### 36.2.4 POSIX Semaphores ¶

Function: `int` sem_init `(sem_t *sem, int pshared, unsigned int value)` ¶

  Preliminary: | MT-Safe | AS-Safe | AC-Unsafe corrupt | See POSIX Safety Concepts.

  This documentation is a stub. For additional information on this function, consult the manual page sem_init(3) See Linux (The Linux Kernel).

Function: `int` sem_destroy `(sem_t *sem)` ¶

  Preliminary: | MT-Safe | AS-Safe | AC-Safe | See POSIX Safety Concepts.

  This documentation is a stub. For additional information on this function, consult the manual page sem_destroy(3) See Linux (The Linux Kernel).

Function: `sem_t *` sem_open `(const char *name, int oflag, ...)` ¶

  Preliminary: | MT-Safe | AS-Unsafe init | AC-Unsafe init | See POSIX Safety Concepts.

  This documentation is a stub. For additional information on this function, consult the manual page sem_open(3) See Linux (The Linux Kernel).

Function: `int` sem_close `(sem_t *sem)` ¶

  Preliminary: | MT-Safe | AS-Unsafe lock | AC-Unsafe lock | See POSIX Safety Concepts.

  This documentation is a stub. For additional information on this function, consult the manual page sem_close(3) See Linux (The Linux Kernel).

Function: `int` sem_unlink `(const char *name)` ¶

  Preliminary: | MT-Safe | AS-Unsafe init | AC-Unsafe corrupt | See POSIX Safety Concepts.

  This documentation is a stub. For additional information on this function, consult the manual page sem_unlink(3) See Linux (The Linux Kernel).

Function: `int` sem_wait `(sem_t *sem)` ¶

  Preliminary: | MT-Safe | AS-Safe | AC-Unsafe corrupt | See POSIX Safety Concepts.

  This documentation is a stub. For additional information on this function, consult the manual page sem_wait(3) See Linux (The Linux Kernel).

Function: `int` sem_timedwait `(sem_t *sem, const struct timespec *abstime)` ¶

  Preliminary: | MT-Safe | AS-Safe | AC-Unsafe corrupt | See POSIX Safety Concepts.

  This documentation is a stub. For additional information on this function, consult the manual page sem_timedwait(3) See Linux (The Linux Kernel).

Function: `int` sem_clockwait `(sem_t *sem, clockid_t clockid, const struct timespec *abstime)` ¶

  Preliminary: | MT-Safe | AS-Unsafe lock | AC-Unsafe lock | See POSIX Safety Concepts.

  Behaves like `sem_timedwait` except the time abstime is measured against the clock specified by clockid rather than `CLOCK_REALTIME`. Currently, clockid must be either `CLOCK_MONOTONIC` or `CLOCK_REALTIME`.

Function: `int` sem_trywait `(sem_t *sem)` ¶

  Preliminary: | MT-Safe | AS-Safe | AC-Safe | See POSIX Safety Concepts.

  This documentation is a stub. For additional information on this function, consult the manual page sem_trywait(3) See Linux (The Linux Kernel).

Function: `int` sem_post `(sem_t *sem)` ¶

  Preliminary: | MT-Safe | AS-Safe | AC-Safe | See POSIX Safety Concepts.

  This documentation is a stub. For additional information on this function, consult the manual page sem_post(3) See Linux (The Linux Kernel).

Function: `int` sem_getvalue `(sem_t *sem, int *sval)` ¶

  Preliminary: | MT-Safe | AS-Safe | AC-Safe | See POSIX Safety Concepts.

  This documentation is a stub. For additional information on this function, consult the manual page sem_getvalue(3) See Linux (The Linux Kernel).