aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/namespaces.hh
diff options
context:
space:
mode:
authorTom Hubrecht <github@mail.hubrecht.ovh>2024-05-28 16:01:11 +0200
committerTom Hubrecht <github@mail.hubrecht.ovh>2024-05-29 11:41:16 +0200
commit8b6d2d39155e88250c576571a1251769b926ee83 (patch)
tree3b9c895f87c63b879be7086cdde2773a9fe28470 /src/libutil/namespaces.hh
parentf79ee66646f66e5117583bcf9a579b7f538ca8bb (diff)
util.{hh,cc}: Split out namespaces.{hh,cc}
Change-Id: I8fd3f3b50c15ede29d489066b4e8d99c2c4636a6
Diffstat (limited to 'src/libutil/namespaces.hh')
-rw-r--r--src/libutil/namespaces.hh20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/libutil/namespaces.hh b/src/libutil/namespaces.hh
index 0b7eeb66c..3a920e665 100644
--- a/src/libutil/namespaces.hh
+++ b/src/libutil/namespaces.hh
@@ -3,6 +3,26 @@
namespace nix {
+/**
+ * Save the current mount namespace. Ignored if called more than
+ * once.
+ */
+void saveMountNamespace();
+
+/**
+ * Restore the mount namespace saved by saveMountNamespace(). Ignored
+ * if saveMountNamespace() was never called.
+ */
+void restoreMountNamespace();
+
+/**
+ * Cause this thread to not share any FS attributes with the main
+ * thread, because this causes setns() in restoreMountNamespace() to
+ * fail.
+ */
+void unshareFilesystem();
+
+
#if __linux__
bool userNamespacesSupported();