merge #3876 into opencontainers/runc:main

Chethan Suresh (1):
  Support time namespace

LGTMs: kolyskin cyphar
Closes #3876
This commit is contained in:
Aleksa Sarai
2023-08-10 18:27:17 +10:00
9 changed files with 61 additions and 0 deletions
+12
View File
@@ -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
}