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

Function newProcessComm

libcontainer/process_linux.go:73–105  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

71}
72
73func newProcessComm() (_ *processComm, retErr error) {
74 var (
75 comm processComm
76 err error
77 )
78 comm.initSockParent, comm.initSockChild, err = utils.NewSockPair("init")
79 if err != nil {
80 return nil, fmt.Errorf("unable to create init pipe: %w", err)
81 }
82 defer func() {
83 if retErr != nil {
84 comm.initSockParent.Close()
85 comm.initSockChild.Close()
86 }
87 }()
88
89 comm.syncSockParent, comm.syncSockChild, err = newSyncSockpair("sync")
90 if err != nil {
91 return nil, fmt.Errorf("unable to create sync pipe: %w", err)
92 }
93 defer func() {
94 if retErr != nil {
95 comm.syncSockParent.Close()
96 comm.syncSockChild.Close()
97 }
98 }()
99
100 comm.logPipeParent, comm.logPipeChild, err = os.Pipe()
101 if err != nil {
102 return nil, fmt.Errorf("unable to create log pipe: %w", err)
103 }
104 return &comm, nil
105}
106
107func (c *processComm) closeChild() {
108 _ = c.initSockChild.Close()

Callers 1

newParentProcessMethod · 0.85

Calls 3

NewSockPairFunction · 0.92
newSyncSockpairFunction · 0.85
CloseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…