* and provides a callback to be notified of their exit
* statues. The application must have only one libxl_ctx
* configured this way.
+ *
+ * libxl_sigchld_owner_libxl_always_selective_reap:
+ *
+ * The application expects to reap all of its own children
+ * synchronously, and does not use SIGCHLD. libxl is
+ * to install a SIGCHLD handler.
*/
/* libxl owns SIGCHLD all the time, and the application is
* relying on libxl's event loop for reaping its children too. */
libxl_sigchld_owner_libxl_always,
+
+ /* libxl owns SIGCHLD all the time, but it must only reap its own
+ * children. The application will reap its own children
+ * synchronously with waitpid, without the assistance of SIGCHLD. */
+ libxl_sigchld_owner_libxl_always_selective_reap,
} libxl_sigchld_owner;
typedef struct {
case libxl_sigchld_owner_mainloop:
return 0;
case libxl_sigchld_owner_libxl_always:
+ case libxl_sigchld_owner_libxl_always_selective_reap:
return 1;
}
abort();
int e = libxl__self_pipe_eatall(selfpipe);
if (e) LIBXL__EVENT_DISASTER(egc, "read sigchld pipe", e, 0);
+ if (CTX->childproc_hooks->chldowner
+ == libxl_sigchld_owner_libxl_always_selective_reap) {
+ childproc_checkall(egc);
+ return;
+ }
+
while (chldmode_ours(CTX, 0) /* in case the app changes the mode */) {
int status;
pid_t pid = checked_waitpid(egc, -1, &status);