-
Notifications
You must be signed in to change notification settings - Fork 227
Expand file tree
/
Copy pathstack_go_io_other.go
More file actions
76 lines (54 loc) · 1.7 KB
/
Copy pathstack_go_io_other.go
File metadata and controls
76 lines (54 loc) · 1.7 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
//go:build !(linux || windows || darwin)
package tun
import (
"net/netip"
"syscall"
E "github.com/sagernet/sing/common/exceptions"
)
const goEngineInlineTransmit = false
func newGoPlatformQueues(stack *Go) ([]goPlatformIO, error) {
return nil, E.New("go: unsupported platform")
}
func goFatalReadError(err error) bool {
return true
}
const goSpliceDuplicatesSocket = false
type goIOVector struct{}
type goSocket struct{}
func goSpliceSocket(conn syscall.Conn) (goSocket, error) {
return goSocket{}, E.New("go: splice not supported")
}
func (s *goSocket) close() {
}
func (s *goSocket) readVector(iovecs []goIOVector) (int, syscall.Errno) {
return 0, syscall.ENOSYS
}
func (s *goSocket) writeVector(iovecs []goIOVector) (int, syscall.Errno) {
return 0, syscall.ENOSYS
}
func (s *goSocket) write(data []byte) (int, syscall.Errno) {
return 0, syscall.ENOSYS
}
func (s *goSocket) sendTo(data []byte, destination netip.AddrPort, family uint8) syscall.Errno {
return syscall.ENOSYS
}
func (s *goSocket) receiveFrom(buffer []byte) (int, netip.AddrPort, syscall.Errno) {
return 0, netip.AddrPort{}, syscall.ENOSYS
}
func (s *goSocket) shutdownWrite() {
}
func (s *goSocket) family() (uint8, error) {
return 0, syscall.ENOSYS
}
func (s *goSocket) peerAddress() (netip.AddrPort, bool) {
return netip.AddrPort{}, false
}
func goIovecsFromSegments(iovecs []goIOVector, segments [][]byte) []goIOVector {
return iovecs[:0]
}
func goSocketWouldBlock(errno syscall.Errno) bool {
return errno == syscall.EAGAIN || errno == syscall.EWOULDBLOCK || errno == syscall.EINTR
}
func goSocketDropped(errno syscall.Errno) bool {
return errno == syscall.EMSGSIZE || errno == syscall.EAFNOSUPPORT || errno == syscall.ENOBUFS
}