Home

EINTR

EINTR, short for "Interrupted system call," is an errno value used on Unix-like systems to indicate that a system call was interrupted by a signal before it could complete. It is surfaced by the C library when a blocking operation is interrupted by a signal handler.

When a process is blocked in a system call and a signal is delivered, the kernel may

Commonly observed with blocking operations such as read, write, accept, poll, select, nanosleep, and wait, EINTR

Portability and values: The numeric value of EINTR is system dependent; on many Unix-like systems it is

See also: EAGAIN, EWOULDBLOCK, SA_RESTART, errno. EINTR remains a common source of subtle bugs in event-driven

terminate
the
call
and
return
with
EINTR.
Depending
on
the
signal
action,
the
interrupted
call
may
be
automatically
restarted
(via
the
SA_RESTART
flag)
or
may
fail
with
EINTR.
The
restart
behavior
can
vary
by
system
and
by
the
specific
call
being
interrupted.
signals
that
a
signal
was
handled
mid-operation.
If
EINTR
is
returned,
portable
code
typically
retries
the
call,
taking
care
to
handle
any
partial
results
and
to
avoid
busy
looping.
The
exact
handling
depends
on
the
function
and
the
surrounding
logic.
4.
Windows
uses
a
different
error-reporting
mechanism,
so
EINTR
is
not
used
there.
In
portable
code,
programmers
often
check
for
EINTR
and
retry,
while
accounting
for
the
possibility
that
the
call
was
not
restartable
or
that
other
error
conditions
occurred.
and
I/O-heavy
programs,
making
correct
signal
handling
and
robust
retry
logic
important
in
system
programming.