MCPcopy
hub / github.com/opencontainers/runc / doWriteSync

Function doWriteSync

libcontainer/sync.go:90–110  ·  view source on GitHub ↗
(pipe *syncSocket, sync syncT)

Source from the content-addressed store, hash-verified

88}
89
90func doWriteSync(pipe *syncSocket, sync syncT) error {
91 sync.Flags &= ^syncFlagHasFd
92 if sync.File != nil {
93 sync.Flags |= syncFlagHasFd
94 }
95 logrus.Debugf("writing sync %s", sync)
96 data, err := json.Marshal(sync)
97 if err != nil {
98 return fmt.Errorf("marshal sync %v: %w", sync.Type, err)
99 }
100 if _, err := pipe.WritePacket(data); err != nil {
101 return fmt.Errorf("writing sync %v: %w", sync.Type, err)
102 }
103 if sync.Flags&syncFlagHasFd != 0 {
104 logrus.Debugf("writing sync file %s", sync)
105 if err := cmsg.SendFile(pipe.File(), sync.File); err != nil {
106 return fmt.Errorf("sending file after sync %q: %w", sync.Type, err)
107 }
108 }
109 return nil
110}
111
112func writeSync(pipe *syncSocket, sync syncType) error {
113 return doWriteSync(pipe, syncT{Type: sync})

Callers 3

writeSyncFunction · 0.85
writeSyncArgFunction · 0.85
startMethod · 0.85

Calls 3

SendFileFunction · 0.92
WritePacketMethod · 0.80
FileMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…