ENOSYS
Linux / POSIXERRORNotableSyscallsHIGH confidence

Function Not Implemented

What this means

The requested system call is not implemented on this kernel version or architecture. This occurs when code compiled for a newer kernel runs on an older one, or when an optional kernel feature was not included at build time.

Why it happens
  1. 1Using a modern syscall like io_uring, statx, or close_range on a kernel older than required.
  2. 2Running a binary built for one architecture on another without proper compatibility.
  3. 3An optional kernel feature (e.g. landlock, seccomp-bpf) was not compiled in.
  4. 4Running inside a sandbox that blocks certain syscalls via seccomp.
How to reproduce

Calling io_uring_setup on a kernel older than 5.1.

trigger — this will error
trigger — this will error
int fd = io_uring_setup(32, &params);
if (fd == -1 && errno == ENOSYS) {
  // io_uring not available on this kernel
  // Fall back to epoll/select
}

expected output

io_uring_setup() returned -1, errno = ENOSYS (Function not implemented)

Fix

Add a runtime capability check before using newer syscalls

WHEN When supporting older kernels alongside newer ones

Add a runtime capability check before using newer syscalls
// Check kernel version or probe the syscall:
if (io_uring_setup(0, NULL) == -1 && errno == ENOSYS) {
  use_epoll_fallback();
} else {
  use_io_uring();
}

Why this works

Probing the syscall at startup allows graceful degradation to older APIs when running on older kernels.

Version notes
Linux 5.1+

io_uring is available (IORING_SETUP_CQSIZE and more).

Linux 5.13+

close_range() syscall is available.

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