aboutsummaryrefslogtreecommitdiff
path: root/support/namespace.h
diff options
context:
space:
mode:
Diffstat (limited to 'support/namespace.h')
-rw-r--r--support/namespace.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/support/namespace.h b/support/namespace.h
index e1ccaa1ef0..859c2fda3f 100644
--- a/support/namespace.h
+++ b/support/namespace.h
@@ -60,6 +60,38 @@ bool support_in_uts_namespace (void);
non-zero exit status. */
void support_isolate_in_subprocess (void (*callback) (void *), void *closure);
+/* Describe the setup of a chroot environment, for
+ support_chroot_create below. */
+struct support_chroot_configuration
+{
+ /* File contents. The files are not created if the field is
+ NULL. */
+ const char *resolv_conf;
+};
+
+/* The result of the creation of a chroot. */
+struct support_chroot
+{
+ /* Path information. All these paths are relative to the parent
+ chroot. */
+
+ /* Path to the chroot directory. */
+ char *path_chroot;
+
+ /* Path to the /etc/resolv.conf file. */
+ char *path_resolv_conf;
+};
+
+/* Create a chroot environment. The returned data should be freed
+ using support_chroot_free below. The files will be deleted when
+ the process exits. This function does not enter the chroot. */
+struct support_chroot *support_chroot_create
+ (struct support_chroot_configuration);
+
+/* Deallocate the chroot information created by
+ support_chroot_create. */
+void support_chroot_free (struct support_chroot *);
+
__END_DECLS
#endif