| // Copyright 2009 The Go Authors. All rights reserved. | |
| // Use of this source code is governed by a BSD-style | |
| // license that can be found in the LICENSE file. | |
| package os | |
| import ( | |
| "syscall/zx" | |
| ) | |
| type syscallErrorType = *zx.Error | |
| func wrapSyscallError(name string, err error) error { | |
| if err, ok := err.(*zx.Error); ok { | |
| text := name | |
| if err.Text != "" { | |
| text += ": " + err.Text | |
| } | |
| return &zx.Error{Status: err.Status, Text: text} | |
| } | |
| return err | |
| } |