mirror of https://github.com/mkerrisk/man-pages
Rework Q1/A1, describing what happens when adding the same
file descriptor twice to an epoll set, and when adding duplicate file descriptors to the same epoll set.
This commit is contained in:
parent
f2e101d0ca
commit
2b22933411
16
man7/epoll.7
16
man7/epoll.7
|
@ -239,9 +239,19 @@ What happens if you add the same file descriptor to an epoll set twice?
|
|||
.B A1
|
||||
You will probably get
|
||||
.BR EEXIST .
|
||||
However, it is possible that two
|
||||
threads may add the same file descriptor twice.
|
||||
This is a harmless condition.
|
||||
However, it is possible to add a duplicate
|
||||
.RB ( dup (2),
|
||||
.BR dup2 (2),
|
||||
.BR fcntl (2)
|
||||
.BR F_DUPFD ,
|
||||
.BR fork (2))
|
||||
descriptor to the same
|
||||
.B epoll
|
||||
set.
|
||||
This can be a useful technique for filtering events,
|
||||
if the duplicate file descriptors are registered with different
|
||||
.I events
|
||||
masks.
|
||||
.TP
|
||||
.B Q2
|
||||
Can two
|
||||
|
|
Loading…
Reference in New Issue