mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 14:13:58 +08:00
6980adb67c
Now that we dropped support for go < 1.21, we can use this; moving the sync.once out of the runningInUserNS() implementation would also allow for it to be more easily tested if we'd decide to. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
9 lines
225 B
Go
9 lines
225 B
Go
package userns
|
|
|
|
// RunningInUserNS detects whether we are currently running in a Linux
|
|
// user namespace and memoizes the result. It returns false on non-Linux
|
|
// platforms.
|
|
func RunningInUserNS() bool {
|
|
return inUserNS()
|
|
}
|