aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/namespaces.hh
blob: 3a920e6653d57a4f3dafa306fb871a0a8f16b421 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#pragma once
///@file

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();

bool mountAndPidNamespacesSupported();

#endif

}