sem_close(2)

sem_close2

Close a named semaphore

Usage

#include <semaphore.h>

int

sem_close(sem_t *sem);

Overview

The system resources associated with the named semaphore referenced by sem are deallocated and the descriptor is invalidated.

If successful, sem_close() will return 0. Otherwise, -1 is returned and errno is set.

Errors

sem_close() succeeds unless:

[EINVAL]

sem is not a valid semaphore descriptor.

Releases

161 releases since Mac OS X 10.0; the text changed 3 times.

  1. 10.0–10.1.5
  2. 10.2–10.4.11
  3. 10.5–10.9.5
  4. 10.10–26.5

History

sem_close() is specified in the POSIX Realtime Extension (1003.1b-1993/1003.1i-1995).

From xnu 12377.121.6 in macOS 26.5. Parsed by carta from the page's mdoc source.