diff --git a/man7/epoll.7 b/man7/epoll.7 index 6b3cbe5a3..24e3a2aaf 100644 --- a/man7/epoll.7 +++ b/man7/epoll.7 @@ -247,7 +247,7 @@ set? .B A0 The key is the combination of the file descriptor number and the open file description -(also known as "open file handle", +(also known as an "open file handle", the kernel's internal representation of an open file). .TP .B Q1 @@ -267,7 +267,8 @@ descriptor to the same .B epoll set. .\" But a descriptor duplicated by fork(2) can't be added to the -.\" set, which is an ugly inconsistency. On the one hand, a child process +.\" set, because the [file *, fd] pair is already in the epoll set. +.\" That is a somewhat ugly inconsistency. On the one hand, a child process .\" cannot add the duplicate file descriptor to the epoll set. (In every .\" other case that I can think of, descriptors duplicated by fork have .\" similar semantics to descriptors duplicated by dup() and friends.) On @@ -275,11 +276,10 @@ set. .\" descriptor means that even if the parent closes its descriptor, then .\" epoll_wait() in the parent will continue to receive notifications for .\" that descriptor because of the duplicated descriptor in the child. -.\" -.\" The choice of [file *, fd] as the key for epoll sets really does seem -.\" unfortunate. Keying on [pid, fd] would probably have given saner -.\" semantics. Obviously it can't be changed now though. .\" +.\" See http://thread.gmane.org/gmane.linux.kernel/596462/ +.\" "epoll design problems with common fork/exec patterns" +.\" .\" mtk, Feb 2008 This can be a useful technique for filtering events, if the duplicate file descriptors are registered with different @@ -354,12 +354,13 @@ a new file descriptor referring to the same open file description is created. An open file description continues to exist until all file descriptors referring to it have been closed. -The -.B epoll -interface automatically removes a file descriptor from an +A file descriptor is removed from an .B epoll set only after all the file descriptors referring to the underlying -open file description have been closed. +open file description have been closed +(or after if the descriptor is explicitly removed using +.BR epoll_ctl () +.BR EPOLL_CTL_DEL ). This means that even after a file descriptor that is part of an .B epoll set has been closed,