diff --git a/src/runtime/testdata/testprog/syscalls_linux.go b/src/runtime/testdata/testprog/syscalls_linux.go index 48f80142374..3939b160df6 100644 --- a/src/runtime/testdata/testprog/syscalls_linux.go +++ b/src/runtime/testdata/testprog/syscalls_linux.go @@ -7,6 +7,7 @@ package main import ( "bytes" "fmt" + "internal/testenv" "os" "syscall" ) @@ -44,11 +45,8 @@ func getcwd() (string, error) { func unshareFs() error { err := syscall.Unshare(syscall.CLONE_FS) - if err != nil { - errno, ok := err.(syscall.Errno) - if ok && errno == syscall.EPERM { - return errNotPermitted - } + if testenv.SyscallIsNotSupported(err) { + return errNotPermitted } return err }