Commit 49ebcfbb authored by Devon H. O'Dell's avatar Devon H. O'Dell Committed by Russ Cox

Add syscall.Shutdown to FreeBSD i386/amd64

Necessary for 163052

R=rsc
CC=golang-dev
https://golang.org/cl/164068
parent 1664e815
...@@ -158,6 +158,7 @@ func Sleep(ns int64) (errno int) { ...@@ -158,6 +158,7 @@ func Sleep(ns int64) (errno int) {
//sys setsockopt(s int, level int, name int, val uintptr, vallen int) (errno int) //sys setsockopt(s int, level int, name int, val uintptr, vallen int) (errno int)
//sys getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) //sys getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int)
//sys getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) //sys getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int)
//sys Shutdown(s int, how int) (errno int)
// For testing: clients can set this flag to force // For testing: clients can set this flag to force
// creation of IPv6 sockets to return EAFNOSUPPORT. // creation of IPv6 sockets to return EAFNOSUPPORT.
......
...@@ -431,6 +431,9 @@ const ( ...@@ -431,6 +431,9 @@ const (
O_TRUNC = 0x400; O_TRUNC = 0x400;
O_TTY_INIT = 0x80000; O_TTY_INIT = 0x80000;
O_WRONLY = 0x1; O_WRONLY = 0x1;
SHUT_RD = 0;
SHUT_RDWR = 0x2;
SHUT_WR = 0x1;
SIGABRT = 0x6; SIGABRT = 0x6;
SIGALRM = 0xe; SIGALRM = 0xe;
SIGBUS = 0xa; SIGBUS = 0xa;
...@@ -533,96 +536,96 @@ const ( ...@@ -533,96 +536,96 @@ const (
// Error table // Error table
var errors = [...]string{ var errors = [...]string{
90: "multihop attempted", 7: "argument list too long",
47: "address family not supported by protocol family",
13: "permission denied", 13: "permission denied",
39: "destination address required", 48: "address already in use",
86: "illegal byte sequence", 49: "can't assign requested address",
29: "illegal seek", 47: "address family not supported by protocol family",
31: "too many links", 35: "resource temporarily unavailable",
74: "RPC prog. not avail",
25: "inappropriate ioctl for device",
9: "bad file descriptor",
34: "result too large",
85: "operation canceled",
26: "text file busy",
12: "cannot allocate memory",
36: "operation now in progress",
66: "directory not empty",
15: "block device required",
41: "protocol wrong type for socket",
83: "no message of desired type",
73: "RPC version wrong",
37: "operation already in progress", 37: "operation already in progress",
60: "operation timed out",
81: "need authenticator",
4: "interrupted system call",
91: "link has been severed",
1: "operation not permitted",
50: "network is down",
70: "stale NFS file handle",
38: "socket operation on non-socket",
80: "authentication error", 80: "authentication error",
10: "no child processes", 9: "bad file descriptor",
32: "broken pipe",
87: "attribute not found",
89: "bad message", 89: "bad message",
71: "too many levels of remote in path", 72: "RPC struct is bad",
59: "too many references: can't splice", 16: "device busy",
46: "protocol family not supported", 85: "operation canceled",
76: "bad procedure for program", 10: "no child processes",
48: "address already in use", 53: "software caused connection abort",
52: "network dropped connection on reset", 61: "connection refused",
21: "is a directory", 54: "connection reset by peer",
82: "identifier removed", 11: "resource deadlock avoided",
39: "destination address required",
33: "numerical argument out of domain",
88: "programming error", 88: "programming error",
69: "disc quota exceeded",
17: "file exists",
14: "bad address",
27: "file too large",
79: "inappropriate file type or format",
64: "host is down",
65: "no route to host",
82: "identifier removed",
86: "illegal byte sequence",
36: "operation now in progress",
4: "interrupted system call",
22: "invalid argument", 22: "invalid argument",
58: "can't send after socket shutdown", 5: "input/output error",
84: "value too large to be stored in data type", 56: "socket is already connected",
16: "device busy", 21: "is a directory",
67: "too many processes",
92: "protocol error", 92: "protocol error",
19: "operation not supported by device", 62: "too many levels of symbolic links",
30: "read-only file system", 24: "too many open files",
7: "argument list too long", 31: "too many links",
11: "resource deadlock avoided", 40: "message too long",
20: "not a directory", 90: "multihop attempted",
54: "connection reset by peer",
6: "device not configured",
72: "RPC struct is bad",
63: "file name too long", 63: "file name too long",
44: "socket type not supported", 81: "need authenticator",
49: "can't assign requested address", 50: "network is down",
43: "protocol not supported", 52: "network dropped connection on reset",
5: "input/output error",
51: "network is unreachable", 51: "network is unreachable",
18: "cross-device link", 23: "too many open files in system",
69: "disc quota exceeded", 87: "attribute not found",
28: "no space left on device", 55: "no buffer space available",
19: "operation not supported by device",
2: "no such file or directory",
8: "exec format error", 8: "exec format error",
40: "message too long",
79: "inappropriate file type or format",
33: "numerical argument out of domain",
27: "file too large",
3: "no such process",
64: "host is down",
77: "no locks available", 77: "no locks available",
23: "too many open files in system", 91: "link has been severed",
12: "cannot allocate memory",
83: "no message of desired type",
42: "protocol not available",
28: "no space left on device",
78: "function not implemented", 78: "function not implemented",
15: "block device required",
57: "socket is not connected", 57: "socket is not connected",
20: "not a directory",
66: "directory not empty",
38: "socket operation on non-socket",
45: "operation not supported", 45: "operation not supported",
53: "software caused connection abort", 25: "inappropriate ioctl for device",
56: "socket is already connected", 6: "device not configured",
68: "too many users", 84: "value too large to be stored in data type",
42: "protocol not available", 1: "operation not permitted",
24: "too many open files", 46: "protocol family not supported",
62: "too many levels of symbolic links", 32: "broken pipe",
55: "no buffer space available", 67: "too many processes",
14: "bad address", 76: "bad procedure for program",
35: "resource temporarily unavailable",
61: "connection refused",
17: "file exists",
75: "program version wrong", 75: "program version wrong",
2: "no such file or directory", 74: "RPC prog. not avail",
65: "no route to host", 43: "protocol not supported",
41: "protocol wrong type for socket",
34: "result too large",
71: "too many levels of remote in path",
30: "read-only file system",
73: "RPC version wrong",
58: "can't send after socket shutdown",
44: "socket type not supported",
29: "illegal seek",
3: "no such process",
70: "stale NFS file handle",
60: "operation timed out",
59: "too many references: can't splice",
26: "text file busy",
68: "too many users",
18: "cross-device link",
} }
...@@ -431,6 +431,9 @@ const ( ...@@ -431,6 +431,9 @@ const (
O_TRUNC = 0x400; O_TRUNC = 0x400;
O_TTY_INIT = 0x80000; O_TTY_INIT = 0x80000;
O_WRONLY = 0x1; O_WRONLY = 0x1;
SHUT_RD = 0;
SHUT_RDWR = 0x2;
SHUT_WR = 0x1;
SIGABRT = 0x6; SIGABRT = 0x6;
SIGALRM = 0xe; SIGALRM = 0xe;
SIGBUS = 0xa; SIGBUS = 0xa;
...@@ -533,96 +536,96 @@ const ( ...@@ -533,96 +536,96 @@ const (
// Error table // Error table
var errors = [...]string{ var errors = [...]string{
90: "multihop attempted", 7: "argument list too long",
47: "address family not supported by protocol family",
13: "permission denied", 13: "permission denied",
39: "destination address required", 48: "address already in use",
86: "illegal byte sequence", 49: "can't assign requested address",
29: "illegal seek", 47: "address family not supported by protocol family",
31: "too many links", 35: "resource temporarily unavailable",
74: "RPC prog. not avail",
25: "inappropriate ioctl for device",
9: "bad file descriptor",
34: "result too large",
85: "operation canceled",
26: "text file busy",
12: "cannot allocate memory",
36: "operation now in progress",
66: "directory not empty",
15: "block device required",
41: "protocol wrong type for socket",
83: "no message of desired type",
73: "RPC version wrong",
20: "not a directory",
37: "operation already in progress", 37: "operation already in progress",
60: "operation timed out",
81: "need authenticator",
4: "interrupted system call",
91: "link has been severed",
1: "operation not permitted",
50: "network is down",
70: "stale NFS file handle",
38: "socket operation on non-socket",
80: "authentication error", 80: "authentication error",
10: "no child processes", 9: "bad file descriptor",
32: "broken pipe",
87: "attribute not found",
89: "bad message", 89: "bad message",
71: "too many levels of remote in path", 72: "RPC struct is bad",
59: "too many references: can't splice", 16: "device busy",
46: "protocol family not supported", 85: "operation canceled",
76: "bad procedure for program", 10: "no child processes",
48: "address already in use", 53: "software caused connection abort",
52: "network dropped connection on reset", 61: "connection refused",
21: "is a directory", 54: "connection reset by peer",
82: "identifier removed", 11: "resource deadlock avoided",
39: "destination address required",
33: "numerical argument out of domain",
88: "programming error", 88: "programming error",
69: "disc quota exceeded",
17: "file exists",
14: "bad address",
27: "file too large",
79: "inappropriate file type or format",
64: "host is down",
65: "no route to host",
82: "identifier removed",
86: "illegal byte sequence",
36: "operation now in progress",
4: "interrupted system call",
22: "invalid argument", 22: "invalid argument",
58: "can't send after socket shutdown", 5: "input/output error",
84: "value too large to be stored in data type", 56: "socket is already connected",
16: "device busy", 21: "is a directory",
67: "too many processes",
92: "protocol error", 92: "protocol error",
19: "operation not supported by device", 62: "too many levels of symbolic links",
30: "read-only file system", 24: "too many open files",
7: "argument list too long", 31: "too many links",
11: "resource deadlock avoided", 40: "message too long",
54: "connection reset by peer", 90: "multihop attempted",
6: "device not configured",
72: "RPC struct is bad",
63: "file name too long", 63: "file name too long",
44: "socket type not supported", 81: "need authenticator",
49: "can't assign requested address", 50: "network is down",
43: "protocol not supported", 52: "network dropped connection on reset",
5: "input/output error",
51: "network is unreachable", 51: "network is unreachable",
18: "cross-device link", 23: "too many open files in system",
69: "disc quota exceeded", 87: "attribute not found",
28: "no space left on device", 55: "no buffer space available",
19: "operation not supported by device",
2: "no such file or directory",
8: "exec format error", 8: "exec format error",
40: "message too long",
79: "inappropriate file type or format",
33: "numerical argument out of domain",
27: "file too large",
3: "no such process",
64: "host is down",
77: "no locks available", 77: "no locks available",
23: "too many open files in system", 91: "link has been severed",
12: "cannot allocate memory",
83: "no message of desired type",
42: "protocol not available",
28: "no space left on device",
78: "function not implemented", 78: "function not implemented",
15: "block device required",
57: "socket is not connected", 57: "socket is not connected",
20: "not a directory",
66: "directory not empty",
38: "socket operation on non-socket",
45: "operation not supported", 45: "operation not supported",
53: "software caused connection abort", 25: "inappropriate ioctl for device",
56: "socket is already connected", 6: "device not configured",
68: "too many users", 84: "value too large to be stored in data type",
42: "protocol not available", 1: "operation not permitted",
24: "too many open files", 46: "protocol family not supported",
62: "too many levels of symbolic links", 32: "broken pipe",
55: "no buffer space available", 67: "too many processes",
14: "bad address", 76: "bad procedure for program",
35: "resource temporarily unavailable",
61: "connection refused",
17: "file exists",
75: "program version wrong", 75: "program version wrong",
2: "no such file or directory", 74: "RPC prog. not avail",
65: "no route to host", 43: "protocol not supported",
41: "protocol wrong type for socket",
34: "result too large",
71: "too many levels of remote in path",
30: "read-only file system",
73: "RPC version wrong",
58: "can't send after socket shutdown",
44: "socket type not supported",
29: "illegal seek",
3: "no such process",
70: "stale NFS file handle",
60: "operation timed out",
59: "too many references: can't splice",
26: "text file busy",
68: "too many users",
18: "cross-device link",
} }
...@@ -77,6 +77,12 @@ func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) { ...@@ -77,6 +77,12 @@ func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) {
return; return;
} }
func Shutdown(s int, how int) (errno int) {
_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0);
errno = int(e1);
return;
}
func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, errno int) { func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, errno int) {
var _p0 *byte; var _p0 *byte;
if len(p) > 0 { if len(p) > 0 {
......
...@@ -77,6 +77,12 @@ func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) { ...@@ -77,6 +77,12 @@ func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) {
return; return;
} }
func Shutdown(s int, how int) (errno int) {
_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0);
errno = int(e1);
return;
}
func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, errno int) { func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, errno int) {
var _p0 *byte; var _p0 *byte;
if len(p) > 0 { if len(p) > 0 {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment