Home

EPOLLERR

EPOLLERR is a flag used by the Linux epoll I/O event notification facility to indicate that an error has occurred on the associated file descriptor. It is one of the event flags that epoll_wait may report for a given event and is distinct from readiness indicators like EPOLLIN or EPOLLOUT.

When EPOLLERR is reported, it signals an error condition on the descriptor’s underlying resource. This condition

Handling EPOLLERR typically involves stopping normal I/O on the descriptor, determining the cause of the error,

Notes and related concepts: EPOLLERR is reported even if no other events are requested; it can appear

is
independent
of
the
current
level
or
edge
triggering
configuration
and
may
occur
on
sockets,
pipes,
or
other
file
descriptors.
The
EPOLLERR
flag
itself
does
not
convey
the
specific
error
value;
the
exact
error
is
retrieved
from
the
underlying
operation
or,
for
sockets,
by
querying
SO_ERROR
with
getsockopt.
and
taking
appropriate
action
(such
as
closing
the
descriptor
or
reestablishing
a
connection).
In
practice,
a
common
pattern
is
to
treat
EPOLLERR
as
a
cue
to
inspect
the
pending
error
with
getsockopt(SO_ERROR)
on
sockets,
perform
any
necessary
cleanup,
and
then
remove
the
descriptor
from
the
epoll
set
if
recovery
is
not
possible.
alongside
other
events.
It
is
often
considered
together
with
EPOLLHUP
(hang
up)
to
signal
terminal
conditions
on
a
descriptor.
Understanding
EPOLLERR
is
important
for
robust
error
handling
in
event-driven
I/O
using
epoll.