+
+</div>
+<h3 id="The_special_problem_of_disappearing_">The special problem of disappearing file descriptors</h3>
+<div id="The_special_problem_of_disappearing_-2">
+<p>Some backends (e.g kqueue, epoll) need to be told about closing a file
+descriptor (either by calling <code>close</code> explicitly or by any other means,
+such as <code>dup</code>). The reason is that you register interest in some file
+descriptor, but when it goes away, the operating system will silently drop
+this interest. If another file descriptor with the same number then is
+registered with libev, there is no efficient way to see that this is, in
+fact, a different file descriptor.</p>
+<p>To avoid having to explicitly tell libev about such cases, libev follows
+the following policy: Each time <code>ev_io_set</code> is being called, libev
+will assume that this is potentially a new file descriptor, otherwise
+it is assumed that the file descriptor stays the same. That means that
+you <i>have</i> to call <code>ev_io_set</code> (or <code>ev_io_init</code>) when you change the
+descriptor even if the file descriptor number itself did not change.</p>
+<p>This is how one would do it normally anyway, the important point is that
+the libev application should not optimise around libev but should leave
+optimisations to libev.</p>
+
+
+
+