-
Notifications
You must be signed in to change notification settings - Fork 67
/
Copy pathvsock_others.go
45 lines (34 loc) · 1.7 KB
/
vsock_others.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//go:build !linux
// +build !linux
package vsock
import (
"fmt"
"net"
"os"
"runtime"
"syscall"
"time"
)
// errUnimplemented is returned by all functions on platforms that
// cannot make use of VM sockets.
var errUnimplemented = fmt.Errorf("vsock: not implemented on %s", runtime.GOOS)
func fileListener(_ *os.File) (*Listener, error) { return nil, errUnimplemented }
func listen(_, _ uint32, _ *Config) (*Listener, error) { return nil, errUnimplemented }
type listener struct{}
func (*listener) Accept() (net.Conn, error) { return nil, errUnimplemented }
func (*listener) Addr() net.Addr { return nil }
func (*listener) Close() error { return errUnimplemented }
func (*listener) SetDeadline(_ time.Time) error { return errUnimplemented }
func dial(_, _ uint32, _ *Config) (*Conn, error) { return nil, errUnimplemented }
type conn struct{}
func (*conn) Close() error { return errUnimplemented }
func (*conn) CloseRead() error { return errUnimplemented }
func (*conn) CloseWrite() error { return errUnimplemented }
func (*conn) Read(_ []byte) (int, error) { return 0, errUnimplemented }
func (*conn) Write(_ []byte) (int, error) { return 0, errUnimplemented }
func (*conn) SetDeadline(_ time.Time) error { return errUnimplemented }
func (*conn) SetReadDeadline(_ time.Time) error { return errUnimplemented }
func (*conn) SetWriteDeadline(_ time.Time) error { return errUnimplemented }
func (*conn) SyscallConn() (syscall.RawConn, error) { return nil, errUnimplemented }
func contextID() (uint32, error) { return 0, errUnimplemented }
func isErrno(_ error, _ int) bool { return false }