MCPcopy Create free account
hub / github.com/opencontainers/runc / Serialize

Method Serialize

libcontainer/message_linux.go:82–93  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

80}
81
82func (msg *Boolmsg) Serialize() []byte {
83 buf := make([]byte, msg.Len())
84 native := nl.NativeEndian()
85 native.PutUint16(buf[0:2], uint16(msg.Len()))
86 native.PutUint16(buf[2:4], msg.Type)
87 if msg.Value {
88 native.PutUint32(buf[4:8], uint32(1))
89 } else {
90 native.PutUint32(buf[4:8], uint32(0))
91 }
92 return buf
93}
94
95func (msg *Boolmsg) Len() int {
96 return unix.NLA_HDRLEN + 4 // alignment

Callers

nothing calls this directly

Calls 1

LenMethod · 0.95

Tested by

no test coverage detected