ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libev/ev.pod
(Generate patch)

Comparing libev/ev.pod (file contents):
Revision 1.135 by root, Sat Mar 8 10:38:40 2008 UTC vs.
Revision 1.138 by root, Mon Mar 31 01:14:12 2008 UTC

1085To support fork in your programs, you either have to call 1085To support fork in your programs, you either have to call
1086C<ev_default_fork ()> or C<ev_loop_fork ()> after a fork in the child, 1086C<ev_default_fork ()> or C<ev_loop_fork ()> after a fork in the child,
1087enable C<EVFLAG_FORKCHECK>, or resort to C<EVBACKEND_SELECT> or 1087enable C<EVFLAG_FORKCHECK>, or resort to C<EVBACKEND_SELECT> or
1088C<EVBACKEND_POLL>. 1088C<EVBACKEND_POLL>.
1089 1089
1090=head3 The special problem of SIGPIPE
1091
1092While not really specific to libev, it is easy to forget about SIGPIPE:
1093when reading from a pipe whose other end has been closed, your program
1094gets send a SIGPIPE, which, by default, aborts your program. For most
1095programs this is sensible behaviour, for daemons, this is usually
1096undesirable.
1097
1098So when you encounter spurious, unexplained daemon exits, make sure you
1099ignore SIGPIPE (and maybe make sure you log the exit status of your daemon
1100somewhere, as that would have given you a big clue).
1101
1090 1102
1091=head3 Watcher-Specific Functions 1103=head3 Watcher-Specific Functions
1092 1104
1093=over 4 1105=over 4
1094 1106
1599reader). Inotify will be used to give hints only and should not change the 1611reader). Inotify will be used to give hints only and should not change the
1600semantics of C<ev_stat> watchers, which means that libev sometimes needs 1612semantics of C<ev_stat> watchers, which means that libev sometimes needs
1601to fall back to regular polling again even with inotify, but changes are 1613to fall back to regular polling again even with inotify, but changes are
1602usually detected immediately, and if the file exists there will be no 1614usually detected immediately, and if the file exists there will be no
1603polling. 1615polling.
1616
1617=head3 ABI Issues (Largefile Support)
1618
1619Libev by default (unless the user overrides this) uses the default
1620compilation environment, which means that on systems with optionally
1621disabled large file support, you get the 32 bit version of the stat
1622structure. When using the library from programs that change the ABI to
1623use 64 bit file offsets the programs will fail. In that case you have to
1624compile libev with the same flags to get binary compatibility. This is
1625obviously the case with any flags that change the ABI, but the problem is
1626most noticably with ev_stat and largefile support.
1604 1627
1605=head3 Inotify 1628=head3 Inotify
1606 1629
1607When C<inotify (7)> support has been compiled into libev (generally only 1630When C<inotify (7)> support has been compiled into libev (generally only
1608available on Linux) and present at runtime, it will be used to speed up 1631available on Linux) and present at runtime, it will be used to speed up
2509 io.start (fd, ev::READ); 2532 io.start (fd, ev::READ);
2510 } 2533 }
2511 }; 2534 };
2512 2535
2513 2536
2537=head1 OTHER LANGUAGE BINDINGS
2538
2539Libev does not offer other language bindings itself, but bindings for a
2540numbe rof languages exist in the form of third-party packages. If you know
2541any interesting language binding in addition to the ones listed here, drop
2542me a note.
2543
2544=over 4
2545
2546=item Perl
2547
2548The EV module implements the full libev API and is actually used to test
2549libev. EV is developed together with libev. Apart from the EV core module,
2550there are additional modules that implement libev-compatible interfaces
2551to C<libadns> (C<EV::ADNS>), C<Net::SNMP> (C<Net::SNMP::EV>) and the
2552C<libglib> event core (C<Glib::EV> and C<EV::Glib>).
2553
2554It can be found and installed via CPAN, its homepage is found at
2555L<http://software.schmorp.de/pkg/EV>.
2556
2557=item Ruby
2558
2559Tony Arcieri has written a ruby extension that offers access to a subset
2560of the libev API and adds filehandle abstractions, asynchronous DNS and
2561more on top of it. It can be found via gem servers. Its homepage is at
2562L<http://rev.rubyforge.org/>.
2563
2564=item D
2565
2566Leandro Lucarella has written a D language binding (F<ev.d>) for libev, to
2567be found at L<http://git.llucax.com.ar/?p=software/ev.d.git;a=summary>.
2568
2569=back
2570
2571
2514=head1 MACRO MAGIC 2572=head1 MACRO MAGIC
2515 2573
2516Libev can be compiled with a variety of options, the most fundamantal 2574Libev can be compiled with a variety of options, the most fundamantal
2517of which is C<EV_MULTIPLICITY>. This option determines whether (most) 2575of which is C<EV_MULTIPLICITY>. This option determines whether (most)
2518functions and callbacks have an initial C<struct ev_loop *> argument. 2576functions and callbacks have an initial C<struct ev_loop *> argument.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines