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

Function GetErrno

internal/linux/error.go:12–29  ·  view source on GitHub ↗

GetErrno checks if the Go error is a kernel errno.

(err error)

Source from the content-addressed store, hash-verified

10
11// GetErrno checks if the Go error is a kernel errno.
12func GetErrno(err error) (iserrno bool, errno error) {
13 var sysErr *os.SyscallError
14 if errors.As(err, &sysErr) {
15 return true, sysErr.Err
16 }
17
18 var pathErr *os.PathError
19 if errors.As(err, &pathErr) {
20 return true, pathErr.Err
21 }
22
23 var tmpErrno unix.Errno
24 if errors.As(err, &tmpErrno) {
25 return true, tmpErrno
26 }
27
28 return false, nil
29}
30
31// ExitStatus extracts the exit status from the error returned by exec.Cmd.
32// If a nil err is provided then an exit status of 0 is returned along with the nil error.

Callers 8

ReadMethod · 0.92
WriteMethod · 0.92
UnixDeviceCreateFunction · 0.92
instanceConsoleLogGetFunction · 0.92
instanceConsoleLogDeleteFunction · 0.92
runMethod · 0.92
proxyCopyFunction · 0.92
unixRelayerFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…