aboutsummaryrefslogtreecommitdiffstats
path: root/brillo/scoped_mount_namespace.h
diff options
context:
space:
mode:
Diffstat (limited to 'brillo/scoped_mount_namespace.h')
-rw-r--r--brillo/scoped_mount_namespace.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/brillo/scoped_mount_namespace.h b/brillo/scoped_mount_namespace.h
index e8c91bf..f360221 100644
--- a/brillo/scoped_mount_namespace.h
+++ b/brillo/scoped_mount_namespace.h
@@ -8,6 +8,7 @@
#include <memory>
#include <base/macros.h>
+#include <base/files/file_path.h>
#include <base/files/scoped_file.h>
#include <brillo/brillo_export.h>
@@ -24,6 +25,11 @@ class BRILLO_EXPORT ScopedMountNamespace {
// scope.
static std::unique_ptr<ScopedMountNamespace> CreateForPid(pid_t pid);
+ // Enters the mount namespace identified by |path| and returns a unique_ptr
+ // that restores the original mount namespace when it goes out of scope.
+ static std::unique_ptr<ScopedMountNamespace> CreateFromPath(
+ base::FilePath ns_path);
+
explicit ScopedMountNamespace(base::ScopedFD mount_namespace_fd);
~ScopedMountNamespace();