mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
merge #3876 into opencontainers/runc:main
Chethan Suresh (1): Support time namespace LGTMs: kolyskin cyphar Closes #3876
This commit is contained in:
@@ -1191,6 +1191,18 @@ func (c *Container) bootstrapData(cloneFlags uintptr, nsMaps map[configs.Namespa
|
||||
})
|
||||
}
|
||||
|
||||
// write boottime and monotonic time ns offsets.
|
||||
if c.config.Namespaces.Contains(configs.NEWTIME) && c.config.TimeOffsets != nil {
|
||||
var offsetSpec bytes.Buffer
|
||||
for clock, offset := range c.config.TimeOffsets {
|
||||
fmt.Fprintf(&offsetSpec, "%s %d %d\n", clock, offset.Secs, offset.Nanosecs)
|
||||
}
|
||||
r.AddData(&Bytemsg{
|
||||
Type: TimeOffsetsAttr,
|
||||
Value: offsetSpec.Bytes(),
|
||||
})
|
||||
}
|
||||
|
||||
return bytes.NewReader(r.Serialize()), nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user