Davide Libenzi wrote:So can I summarize what I understand: a) Adding the same file descriptor twice to an epoll set will cause an error (EEXIST). b) In a separate message to linux-man, Chris Heath says that two threads *can't* add the same fd twice to an epoll set, despite what the existing man page text says. I haven't tested that, but it sounds to me as though it is likely to be true. Can you comment please Davide? c) It is possible to add duplicated file descriptors referring to the same underlying open file description ("file *"). As you note, this can be a useful filtering technique, if the two file descriptors specify different masks. Assuming that is all correct, for man-pages-2.79, I've reworked the text for Q1/A1 as follows: Q1 What happens if you add the same file descriptor to an epoll set twice? A1 You will probably get EEXIST. However, it is pos- sible to add a duplicate (dup(2), dup2(2), fcntl(2) F_DUPFD, fork(2)) descriptor to the same epoll set. This can be a useful technique for filtering events, if the duplicate file descrip- tors are registered with different events masks. Seem okay Davide? Cheers, Michael PS I've trimmed the part of this thread about Q6/A6, since I dealt with that in another thread ("epoll and shared fd's"). -- Michael Kerrisk Maintainer of the Linux man-pages project http://www.kernel.org/doc/man-pages/ Want to report a man-pages bug? Look here: http://www.kernel.org/doc/man-pages/reporting_bugs.html --
| Peter Zijlstra | Re: Quad core CPUs loaded at only 50% when running a CPU and mmap intensive multi-... |
| Satyam Sharma | [-mm patchset] War on warnings |
| Izik Eidus | [PATCH 0/4] ksm - dynamic page sharing driver for linux |
| Renato S. Yamane | Error -71 on device descriptor read/all |
git: | |
| Martin Langhoff | Handling large files with GIT |
| Wincent Colaiuta | Rebase/cherry-picking idea |
| Linus Torvalds | People unaware of the importance of "git gc"? |
| Joe Fiorini | Undo git-rm without commit? |
| Christian Weisgerber | Re: libiconv problem |
| Peter | OpenBSD as Virtualbox guest |
| Brandon Lee | DELL PERC 5iR slow performance |
| Martin Toft | Trying to compile cwm on Linux |
| Alexey Dobriyan | [PATCH 01/53] xfrm: initialise xfrm_policy_gc_work statically |
| Arjan van de Ven | Printing the driver name as part of the netdev watchdog message |
| Dushan Tcholich | Re: ksoftirqd high cpu load on kernels 2.6.24 to 2.6.27-rc1-mm1 |
| Inaky Perez-Gonzalez | [PATCH 03/39] wimax: constants and definitions to interact with user space |
