aboutsummaryrefslogtreecommitdiff
path: root/support/namespace.h
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2017-07-05 15:38:42 +0200
committerFlorian Weimer <fweimer@redhat.com>2017-07-05 19:04:40 +0200
commitd4165eedf5b85bfda3ea6b251f69838857e44925 (patch)
tree03ec09a2be6b35bfc3b3c720f084f98074477753 /support/namespace.h
parent76637a921f5d657998aa9a06981bf8a062ffd497 (diff)
downloadglibc-d4165eedf5b85bfda3ea6b251f69838857e44925.zip
glibc-d4165eedf5b85bfda3ea6b251f69838857e44925.tar.gz
glibc-d4165eedf5b85bfda3ea6b251f69838857e44925.tar.bz2
support: Add support_chroot_create and support_chroot_free
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 e1ccaa1..859c2fd 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