aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxl/libxl_utils.h
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2010-04-12 17:41:05 +0100
committerKeir Fraser <keir.fraser@citrix.com>2010-04-12 17:41:05 +0100
commit25887df0dea37702586c16e1baf6681ed3ecd8de (patch)
treed2592225bcffb6d4fdc3c8abf92543a7c0b642dc /tools/libxl/libxl_utils.h
parent567326149cc6d9ba51e881604f3434f61a114f9d (diff)
downloadxen-25887df0dea37702586c16e1baf6681ed3ecd8de.tar.gz
xen-25887df0dea37702586c16e1baf6681ed3ecd8de.tar.bz2
xen-25887df0dea37702586c16e1baf6681ed3ecd8de.zip
libxl: Expose functions for helping with subprocesses.
* Expose libxl_fork in libxl_utils.h * Expose libxl_pipe in libxl_utils.h * Make libxl_exec put SIGPIPE back (so that libxl callers may have SIGPIPE ignored) xl would like to use libxl_fork (which is like fork(2) except that it logs errors) and also a similar function libxl_pipe. So put these in libxl_utils.[ch] and use them in libxl.c as appropriate, to avoid having to duplicate code between xl and libxl. Also, make sure that subprocesses spawned by libxl have SIGPIPE set back to SIG_DFL as they are entitled to expect. This means that a libxl caller which sets SIGPIPE to SIG_IGN is no longer buggy. (This is relevant for xl migration, because xl would like to be such a caller.) Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Diffstat (limited to 'tools/libxl/libxl_utils.h')
-rw-r--r--tools/libxl/libxl_utils.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/libxl/libxl_utils.h b/tools/libxl/libxl_utils.h
index 65e7e31d23..fe8b975fcd 100644
--- a/tools/libxl/libxl_utils.h
+++ b/tools/libxl/libxl_utils.h
@@ -44,5 +44,9 @@ int libxl_write_exactly(struct libxl_ctx *ctx, int fd, const void *data,
* logged using filename (which is only used for logging) and what
* (which may be 0). */
+pid_t libxl_fork(struct libxl_ctx *ctx);
+int libxl_pipe(struct libxl_ctx *ctx, int pipes[2]);
+ /* Just like fork(2), pipe(2), but log errors. */
+
#endif