libgo: update to Go 1.11
[official-gcc.git] / libgo / go / net / error_posix.go
blob70efa4c66fbca0622e5264f39e0c3e1aee8f2cfa
1 // Copyright 2017 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
5 // +build aix darwin dragonfly freebsd js,wasm linux nacl netbsd openbsd solaris windows
7 package net
9 import (
10 "os"
11 "syscall"
14 // wrapSyscallError takes an error and a syscall name. If the error is
15 // a syscall.Errno, it wraps it in a os.SyscallError using the syscall name.
16 func wrapSyscallError(name string, err error) error {
17 if _, ok := err.(syscall.Errno); ok {
18 err = os.NewSyscallError(name, err)
20 return err