1
2
3
4
5
6
7 package testenv
8
9 import (
10 "errors"
11 "io/fs"
12 "syscall"
13 )
14
15
16
17 var Sigquit = syscall.SIGQUIT
18
19 func syscallIsNotSupported(err error) bool {
20 if err == nil {
21 return false
22 }
23
24 var errno syscall.Errno
25 if errors.As(err, &errno) {
26 switch errno {
27 case syscall.EPERM, syscall.EROFS:
28
29
30 return true
31 case syscall.EINVAL:
32
33
34 return true
35 }
36 }
37
38 if errors.Is(err, fs.ErrPermission) || errors.Is(err, errors.ErrUnsupported) {
39 return true
40 }
41
42 return false
43 }
44
View as plain text