X-Git-Url: https://git.llucax.com/software/libev.git/blobdiff_plain/5466167e0504f6fd929074dda89e770d4abfd3c3..c56a8061de2b5b4b9760ed49d4600bf40991b797:/ev.html diff --git a/ev.html b/ev.html index 308d179..21f24d5 100644 --- a/ev.html +++ b/ev.html @@ -6,7 +6,7 @@ - +
@@ -29,7 +29,10 @@ev_io
- is this file descriptor readable or writable?ev_io
- is this file descriptor readable or writable?
+
+ev_timer
- relative and optionally repeating timeoutsev_periodic
- to cron or not to cron?ev_signal
- signal me when a signal gets signalled!You can find out the major and minor version numbers of the library +
You can find out the major and minor ABI version numbers of the library
you linked against by calling the functions ev_version_major
and
ev_version_minor
. If you want, you can compare against the global
symbols EV_VERSION_MAJOR
and EV_VERSION_MINOR
, which specify the
version of the library your program was compiled against.
These version numbers refer to the ABI version of the library, not the +release version.
Usually, it's a good idea to terminate if the major versions mismatch, -as this indicates an incompatible change. Minor versions are usually +as this indicates an incompatible change. Minor versions are usually compatible to older versions, so a larger minor version alone is usually not a problem.
Example: Make sure we haven't accidentally been linked against the wrong @@ -941,6 +946,30 @@ play around with an Xlib connection), then you have to seperately re-test whether a file descriptor is really ready with a known-to-be good interface such as poll (fortunately in our Xlib example, Xlib already does this on its own, so its quite safe to use).
+ + +Some backends (e.g kqueue, epoll) need to be told about closing a file
+descriptor (either by calling close
explicitly or by any other means,
+such as dup
). 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.
To avoid having to explicitly tell libev about such cases, libev follows
+the following policy: Each time ev_io_set
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 have to call ev_io_set
(or ev_io_init
) when you change the
+descriptor even if the file descriptor number itself did not change.
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.
+ + + +