… | |
… | |
1134 | C<EVBACKEND_POLL>. |
1134 | C<EVBACKEND_POLL>. |
1135 | |
1135 | |
1136 | =head3 The special problem of SIGPIPE |
1136 | =head3 The special problem of SIGPIPE |
1137 | |
1137 | |
1138 | While not really specific to libev, it is easy to forget about SIGPIPE: |
1138 | While not really specific to libev, it is easy to forget about SIGPIPE: |
1139 | when reading from a pipe whose other end has been closed, your program |
1139 | when writing to a pipe whose other end has been closed, your program gets |
1140 | gets send a SIGPIPE, which, by default, aborts your program. For most |
1140 | send a SIGPIPE, which, by default, aborts your program. For most programs |
1141 | programs this is sensible behaviour, for daemons, this is usually |
1141 | this is sensible behaviour, for daemons, this is usually undesirable. |
1142 | undesirable. |
|
|
1143 | |
1142 | |
1144 | So when you encounter spurious, unexplained daemon exits, make sure you |
1143 | So when you encounter spurious, unexplained daemon exits, make sure you |
1145 | ignore SIGPIPE (and maybe make sure you log the exit status of your daemon |
1144 | ignore SIGPIPE (and maybe make sure you log the exit status of your daemon |
1146 | somewhere, as that would have given you a big clue). |
1145 | somewhere, as that would have given you a big clue). |
1147 | |
1146 | |
… | |
… | |
1569 | handler, you can override it easily by installing your own handler for |
1568 | handler, you can override it easily by installing your own handler for |
1570 | C<SIGCHLD> after initialising the default loop, and making sure the |
1569 | C<SIGCHLD> after initialising the default loop, and making sure the |
1571 | default loop never gets destroyed. You are encouraged, however, to use an |
1570 | default loop never gets destroyed. You are encouraged, however, to use an |
1572 | event-based approach to child reaping and thus use libev's support for |
1571 | event-based approach to child reaping and thus use libev's support for |
1573 | that, so other libev users can use C<ev_child> watchers freely. |
1572 | that, so other libev users can use C<ev_child> watchers freely. |
|
|
1573 | |
|
|
1574 | =head3 Stopping the Child Watcher |
|
|
1575 | |
|
|
1576 | Currently, the child watcher never gets stopped, even when the |
|
|
1577 | child terminates, so normally one needs to stop the watcher in the |
|
|
1578 | callback. Future versions of libev might stop the watcher automatically |
|
|
1579 | when a child exit is detected. |
1574 | |
1580 | |
1575 | =head3 Watcher-Specific Functions and Data Members |
1581 | =head3 Watcher-Specific Functions and Data Members |
1576 | |
1582 | |
1577 | =over 4 |
1583 | =over 4 |
1578 | |
1584 | |