Home

EPOLLCTLDEL

EPOLL_CTL_DEL is a control operation used with the epoll_ctl system call on Linux to remove a file descriptor from an epoll instance. It is one of the three operations defined for epoll_ctl, alongside EPOLL_CTL_ADD and EPOLL_CTL_MOD. The operation targets a previously registered file descriptor and stops the kernel from monitoring events on that fd via the specified epoll instance.

The epoll_ctl function has the signature epoll_ctl(int epfd, int op, int fd, struct epoll_event *event). For EPOLL_CTL_DEL,

Behavior and return values: If the specified fd is currently registered with the epoll instance, it is

Common considerations: It is good practice to remove fds from epoll before closing them to avoid stray

See also: epoll, EPOLL_CTL_ADD, EPOLL_CTL_MOD, epoll_wait.

the
op
parameter
is
EPOLL_CTL_DEL,
the
fd
parameter
is
the
file
descriptor
to
remove,
and
the
event
parameter
is
typically
ignored
and
may
be
NULL.
The
epoll
instance
referenced
by
epfd
must
have
been
created
beforehand
with
epoll_create,
epoll_create1,
or
a
compatible
API.
removed
and
a
successful
return
occurs.
If
the
fd
is
not
registered,
EPOLL_CTL_DEL
may
fail
with
ENOENT.
Other
errors
can
include
EINVAL
for
invalid
arguments
or
EBADF
for
a
bad
epoll
file
descriptor.
After
a
successful
EPOLL_CTL_DEL,
the
file
descriptor
will
no
longer
generate
events
on
that
epoll
instance.
events.
If
you
need
to
monitor
an
fd
again,
you
must
add
it
back
with
EPOLL_CTL_ADD.
EPOLL_CTL_DEL
does
not
affect
other
fds
or
the
epoll
instance
itself.