2023-01-25 17:31:27 +01:00
|
|
|
#pragma once
|
2023-03-31 23:18:41 -04:00
|
|
|
///@file
|
2023-01-25 17:31:27 +01:00
|
|
|
|
2023-10-25 00:43:36 -04:00
|
|
|
#include <optional>
|
|
|
|
|
|
|
|
#include "types.hh"
|
|
|
|
|
2023-01-25 17:31:27 +01:00
|
|
|
namespace nix {
|
|
|
|
|
2023-10-25 00:43:36 -04:00
|
|
|
/**
|
|
|
|
* 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();
|
|
|
|
|
2023-01-25 17:31:27 +01:00
|
|
|
bool userNamespacesSupported();
|
|
|
|
|
2023-02-10 14:38:14 +01:00
|
|
|
bool mountAndPidNamespacesSupported();
|
2023-01-27 15:25:56 +01:00
|
|
|
|
2023-01-25 17:31:27 +01:00
|
|
|
}
|