ERESTART
Linux / POSIXERRORNotableProcessHIGH confidence

Interrupted System Call Should Be Restarted

Production Risk

Should never appear in user space; if it does, it is a kernel/glibc bug.

What this means

ERESTART (errno 85) is an internal Linux kernel errno that indicates a system call was interrupted and should be automatically restarted. User-space programs should never see this value; it is converted to EINTR before returning to user space.

Why it happens
  1. 1Internal kernel signal handling — syscall interrupted by a signal with SA_RESTART set
How to reproduce

Internal kernel use only; should not reach user space.

trigger — this will error
trigger — this will error
// This should never appear in user space
// If it does, it indicates a kernel or glibc bug
// Normally converted to EINTR before reaching application

expected output

Interrupted system call should be restarted (ERESTART)

Fix

Handle EINTR in your signal-aware code

WHEN For signals interrupting syscalls

Handle EINTR in your signal-aware code
// Handle the user-space equivalent: EINTR
do {
  n = read(fd, buf, sizeof(buf));
} while (n == -1 && errno == EINTR);

Why this works

ERESTART is converted to EINTR before reaching user space. Handle EINTR with restart loops.

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