ENAVAIL
Linux / POSIXERRORCriticalIPCHIGH confidence

No XENIX Semaphores Available

Production Risk

Not seen in modern Linux; XENIX compatibility only.

What this means

ENAVAIL (errno 119) is a XENIX compatibility error returned when no XENIX semaphores are available. Not used in modern Linux.

Why it happens
  1. 1XENIX semaphore pool exhausted (historical)
How to reproduce

XENIX semaphore allocation failure (historical).

trigger — this will error
trigger — this will error
// errno = ENAVAIL from XENIX semaphore code

expected output

No XENIX semaphores available (ENAVAIL)

Fix

Use POSIX semaphores instead

WHEN If maintaining XENIX code

Use POSIX semaphores instead
// Use POSIX semaphores on modern Linux
#include <semaphore.h>
sem_t sem;
sem_init(&sem, 0, 1);

Why this works

POSIX semaphores are fully supported and not subject to XENIX limitations.

Sources
Official documentation ↗

Linux Programmer Manual errno(3)

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All Linux / POSIX errors