… | |
… | |
1085 | To support fork in your programs, you either have to call |
1085 | To support fork in your programs, you either have to call |
1086 | C<ev_default_fork ()> or C<ev_loop_fork ()> after a fork in the child, |
1086 | C<ev_default_fork ()> or C<ev_loop_fork ()> after a fork in the child, |
1087 | enable C<EVFLAG_FORKCHECK>, or resort to C<EVBACKEND_SELECT> or |
1087 | enable C<EVFLAG_FORKCHECK>, or resort to C<EVBACKEND_SELECT> or |
1088 | C<EVBACKEND_POLL>. |
1088 | C<EVBACKEND_POLL>. |
1089 | |
1089 | |
|
|
1090 | =head3 The special problem of SIGPIPE |
|
|
1091 | |
|
|
1092 | While not really specific to libev, it is easy to forget about SIGPIPE: |
|
|
1093 | when reading from a pipe whose other end has been closed, your program |
|
|
1094 | gets send a SIGPIPE, which, by default, aborts your program. For most |
|
|
1095 | programs this is sensible behaviour, for daemons, this is usually |
|
|
1096 | undesirable. |
|
|
1097 | |
|
|
1098 | So when you encounter spurious, unexplained daemon exits, make sure you |
|
|
1099 | ignore SIGPIPE (and maybe make sure you log the exit status of your daemon |
|
|
1100 | somewhere, 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 | |
… | |
… | |
1599 | reader). Inotify will be used to give hints only and should not change the |
1611 | reader). Inotify will be used to give hints only and should not change the |
1600 | semantics of C<ev_stat> watchers, which means that libev sometimes needs |
1612 | semantics of C<ev_stat> watchers, which means that libev sometimes needs |
1601 | to fall back to regular polling again even with inotify, but changes are |
1613 | to fall back to regular polling again even with inotify, but changes are |
1602 | usually detected immediately, and if the file exists there will be no |
1614 | usually detected immediately, and if the file exists there will be no |
1603 | polling. |
1615 | polling. |
|
|
1616 | |
|
|
1617 | =head3 ABI Issues (Largefile Support) |
|
|
1618 | |
|
|
1619 | Libev by default (unless the user overrides this) uses the default |
|
|
1620 | compilation environment, which means that on systems with optionally |
|
|
1621 | disabled large file support, you get the 32 bit version of the stat |
|
|
1622 | structure. When using the library from programs that change the ABI to |
|
|
1623 | use 64 bit file offsets the programs will fail. In that case you have to |
|
|
1624 | compile libev with the same flags to get binary compatibility. This is |
|
|
1625 | obviously the case with any flags that change the ABI, but the problem is |
|
|
1626 | most noticably with ev_stat and largefile support. |
1604 | |
1627 | |
1605 | =head3 Inotify |
1628 | =head3 Inotify |
1606 | |
1629 | |
1607 | When C<inotify (7)> support has been compiled into libev (generally only |
1630 | When C<inotify (7)> support has been compiled into libev (generally only |
1608 | available on Linux) and present at runtime, it will be used to speed up |
1631 | available on Linux) and present at runtime, it will be used to speed up |