… | |
… | |
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 | |