File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change
1
+ // The following is copied and adapted from Go 1.18 official implementation.
2
+
3
+ // Copyright 2017 The Go Authors. All rights reserved.
4
+ // Use of this source code is governed by a BSD-style
5
+ // license that can be found in the LICENSE file.
6
+
7
+ //go:build aix || darwin || dragonfly || freebsd || (js && wasm) || linux || netbsd || openbsd || solaris || windows || wasi
8
+ // +build aix darwin dragonfly freebsd js,wasm linux netbsd openbsd solaris windows wasi
9
+
10
+ package net
11
+
12
+ import (
13
+ "os"
14
+ "syscall"
15
+ )
16
+
17
+ // wrapSyscallError takes an error and a syscall name. If the error is
18
+ // a syscall.Errno, it wraps it in a os.SyscallError using the syscall name.
19
+ func wrapSyscallError (name string , err error ) error {
20
+ if _ , ok := err .(syscall.Errno ); ok {
21
+ err = os .NewSyscallError (name , err )
22
+ }
23
+ return err
24
+ }
You can’t perform that action at this time.
0 commit comments