mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
Support time namespace
"time" namespace was introduced in Linux v5.6
support new time namespace to set boottime and monotonic time offset
Example runtime spec
"timeOffsets": {
"monotonic": {
"secs": 172800,
"nanosecs": 0
},
"boottime": {
"secs": 604800,
"nanosecs": 0
}
}
Signed-off-by: Chethan Suresh <chethan.suresh@sony.com>
This commit is contained in:
@@ -106,6 +106,12 @@ func namespaces(config *configs.Config) error {
|
||||
}
|
||||
}
|
||||
|
||||
if config.Namespaces.Contains(configs.NEWTIME) {
|
||||
if _, err := os.Stat("/proc/self/timens_offsets"); os.IsNotExist(err) {
|
||||
return errors.New("time namespaces aren't enabled in the kernel")
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user