MCPcopy
hub / github.com/lxc/incus / Write

Method Write

internal/eagain/file_linux.go:42–56  ·  view source on GitHub ↗

Write behaves like io.Writer.Write but will retry on EAGAIN.

(p []byte)

Source from the content-addressed store, hash-verified

40
41// Write behaves like io.Writer.Write but will retry on EAGAIN.
42func (ew Writer) Write(p []byte) (int, error) {
43again:
44 n, err := ew.Writer.Write(p)
45 if err == nil {
46 return n, nil
47 }
48
49 // keep retrying on EAGAIN
50 ok, errno := linux.GetErrno(err)
51 if ok && (errors.Is(errno, unix.EAGAIN) || errors.Is(errno, unix.EINTR)) {
52 goto again
53 }
54
55 return n, err
56}

Callers 4

RenderMethod · 0.95
runMethod · 0.95
runMethod · 0.95
RenderTableFunction · 0.95

Calls 1

GetErrnoFunction · 0.92

Tested by

no test coverage detected