forked from mdlayher/vsock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vsock_others.go
42 lines (31 loc) · 1.47 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
//+build !linux
package vsock
import (
"fmt"
"net"
"runtime"
"time"
)
var (
// errUnimplemented is returned by all functions on platforms that
// cannot make use of VM sockets.
errUnimplemented = fmt.Errorf("vsock: not implemented on %s/%s",
runtime.GOOS, runtime.GOARCH)
)
func listen(_, _ uint32) (*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) (*Conn, error) { return nil, errUnimplemented }
type connFD struct{}
func (*connFD) LocalAddr() net.Addr { return nil }
func (*connFD) RemoteAddr() net.Addr { return nil }
func (*connFD) SetDeadline(_ time.Time, _ deadlineType) error { return errUnimplemented }
func (*connFD) Read(_ []byte) (int, error) { return 0, errUnimplemented }
func (*connFD) Write(_ []byte) (int, error) { return 0, errUnimplemented }
func (*connFD) Close() error { return errUnimplemented }
func (*connFD) Shutdown(_ int) error { return errUnimplemented }
func contextID() (uint32, error) { return 0, errUnimplemented }
func isErrno(_ error, _ int) bool { return false }