--- libev/ev.pod 2007/12/09 19:46:56 1.79 +++ libev/ev.pod 2007/12/12 17:55:06 1.82 @@ -119,14 +119,14 @@ =item int ev_version_minor () -You can find out the major and minor API/ABI 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 C and C. If you want, you can compare against the global symbols C and C, which specify the version of the library your program was compiled against. -These version numbers refer to the API and ABI version of the library, not -the release version. +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 @@ -913,6 +913,30 @@ such as poll (fortunately in our Xlib example, Xlib already does this on its own, so its quite safe to use). +=head3 The special problem of disappearing file descriptors + +Some backends (e.g kqueue, epoll) need to be told about closing a file +descriptor (either by calling C explicitly or by any other means, +such as C). 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 C 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 to call C (or C) 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. + + +=head3 Watcher-Specific Functions + =over 4 =item ev_io_init (ev_io *, callback, int fd, int events) @@ -975,6 +999,8 @@ but if multiple timers become ready during the same loop iteration then order of execution is undefined. +=head3 Watcher-Specific Functions and Data Members + =over 4 =item ev_timer_init (ev_timer *, callback, ev_tstamp after, ev_tstamp repeat) @@ -1089,6 +1115,8 @@ time (C) has been passed, but if multiple periodic timers become ready during the same loop iteration then order of execution is undefined. +=head3 Watcher-Specific Functions and Data Members + =over 4 =item ev_periodic_init (ev_periodic *, callback, ev_tstamp at, ev_tstamp interval, reschedule_cb) @@ -1244,6 +1272,8 @@ watcher for a signal is stopped libev will reset the signal handler to SIG_DFL (regardless of what it was set to before). +=head3 Watcher-Specific Functions and Data Members + =over 4 =item ev_signal_init (ev_signal *, callback, int signum) @@ -1265,6 +1295,8 @@ Child watchers trigger when your process receives a SIGCHLD in response to some child status changes (most typically when a child of yours dies). +=head3 Watcher-Specific Functions and Data Members + =over 4 =item ev_child_init (ev_child *, callback, int pid) @@ -1342,6 +1374,8 @@ usually detected immediately, and if the file exists there will be no polling. +=head3 Watcher-Specific Functions and Data Members + =over 4 =item ev_stat_init (ev_stat *, callback, const char *path, ev_tstamp interval) @@ -1433,6 +1467,8 @@ "pseudo-background processing", or delay processing stuff to after the event loop has handled all outstanding events. +=head3 Watcher-Specific Functions and Data Members + =over 4 =item ev_idle_init (ev_signal *, callback) @@ -1509,6 +1545,8 @@ C watcher ran (always remind yourself to coexist peacefully with others). +=head3 Watcher-Specific Functions and Data Members + =over 4 =item ev_prepare_init (ev_prepare *, callback) @@ -1719,6 +1757,8 @@ else loop_lo = loop_hi; +=head3 Watcher-Specific Functions and Data Members + =over 4 =item ev_embed_init (ev_embed *, callback, struct ev_loop *embedded_loop)