blob: 4d8efa097b8a5eb3aec597ec32b26c9247269555 [file] [log] [blame]
// 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.
package zx
type Socket Handle
type Event Handle
type Channel Handle
type Port Handle
type VMO Handle
type VMAR Handle
type Log Handle
func (s *Socket) Handle() *Handle {
return (*Handle)(s)
}
func (e *Event) Handle() *Handle {
return (*Handle)(e)
}
func (c *Channel) Handle() *Handle {
return (*Handle)(c)
}
func (p *Port) Handle() *Handle {
return (*Handle)(p)
}
func (vmo *VMO) Handle() *Handle {
return (*Handle)(vmo)
}
func (l *Log) Handle() *Handle {
return (*Handle)(l)
}
func (h *Handle) IsValid() bool {
return *h > HandleInvalid
}
const (
ChannelMaxMessageBytes = 65536
ChannelMaxMessageHandles = 64
)