| // Copyright 2020 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. |
| |
| //go:build !fuchsia |
| |
| package fidl |
| |
| import ( |
| "syscall/zx" |
| "syscall/zx/internal/context" |
| ) |
| |
| // Return nil rather than panicking so that tests can use fake handles on non-fuchsia. |
| // Tests on non-fuchsia end up calling this because unmarshalers for strict types close |
| // handles when they receive unknown data with handles. |
| func handleClose(*zx.Handle) error { |
| return nil |
| } |
| |
| func handleReplace(handle zx.Handle, rights zx.Rights) (zx.Handle, error) { |
| // The conformance tests use simulated handles on host, so this |
| // can't panic. Instead, return an invalid handle. |
| return zx.HandleInvalid, nil |
| } |
| |
| func newChannel(uint32) (zx.Channel, zx.Channel, error) { |
| panic("channel new only supported on fuchsia") |
| } |
| |
| func channelClose(*zx.Channel) error { |
| panic("channel close only supported on fuchsia") |
| } |
| |
| func channelReadEtc(*zx.Channel, []byte, []zx.HandleInfo, uint32) (uint32, uint32, error) { |
| panic("channel read etc only supported on fuchsia") |
| } |
| |
| func channelWriteEtc(*zx.Channel, []byte, []zx.HandleDisposition, uint32) error { |
| panic("channel write etc only supported on fuchsia") |
| } |
| |
| func withRetryContext(_ context.Context, fn func() error, _ zx.Handle, _, _ zx.Signals) error { |
| return fn() |
| } |