blob: a72a2b8569f90c96a98ed0f138cd5aa8e9ab5ac1 [file] [log] [blame]
// Copyright 2018 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.
// +build fuchsia !plan9,!windows,!unix
package net
import (
"os"
"syscall"
"syscall/zx"
)
var (
errTimedout = syscall.ETIMEDOUT
errOpNotSupported = syscall.EOPNOTSUPP
abortedConnRequestErrors = []error{syscall.ECONNABORTED} // see accept in fd_unix.go
)
func isPlatformError(err error) bool {
_, ok := err.(zx.Error)
return ok
}
func samePlatformError(err, want error) bool {
if op, ok := err.(*OpError); ok {
err = op.Err
}
if sys, ok := err.(*os.SyscallError); ok {
err = sys.Err
}
return err == want
}