Commit 0b126c1b authored by Russ Cox's avatar Russ Cox

syscall: add Shutdown on OS X, add more constants in mkerror.sh

R=dho
CC=golang-dev
https://golang.org/cl/163061
parent 42ec02be
...@@ -7,6 +7,10 @@ ...@@ -7,6 +7,10 @@
# values (ENAMETOOLONG etc.), by asking the preprocessor # values (ENAMETOOLONG etc.), by asking the preprocessor
# about the definitions. # about the definitions.
unset LANG
export LC_ALL=C
export LC_CTYPE=C
case "$GOARCH" in case "$GOARCH" in
arm) arm)
GCC=arm-gcc GCC=arm-gcc
...@@ -72,7 +76,7 @@ includes=' ...@@ -72,7 +76,7 @@ includes='
$2 ~ /^E[A-Z0-9_]+$/ || $2 ~ /^E[A-Z0-9_]+$/ ||
$2 ~ /^SIG[^_]/ || $2 ~ /^SIG[^_]/ ||
$2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|TCP|EVFILT|EV)_/ || $2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|TCP|EVFILT|EV|SHUT|PROT|MAP)_/ ||
$2 == "SOMAXCONN" || $2 == "SOMAXCONN" ||
$2 == "NAME_MAX" || $2 == "NAME_MAX" ||
$2 ~ /^(O|F|FD|NAME|S|PTRACE)_/ || $2 ~ /^(O|F|FD|NAME|S|PTRACE)_/ ||
...@@ -89,7 +93,8 @@ includes=' ...@@ -89,7 +93,8 @@ includes='
# Pull out just the error names for later. # Pull out just the error names for later.
errors=$( errors=$(
echo '#include <errno.h>' | $GCC -x c - -E -dM | echo '#include <errno.h>' | $GCC -x c - -E -dM |
awk '$1=="#define" && $2 ~ /^E[A-Z0-9_]+$/ { print $2 }' awk '$1=="#define" && $2 ~ /^E[A-Z0-9_]+$/ { print $2 }' |
sort
) )
echo '// mkerrors.sh' "$@" echo '// mkerrors.sh' "$@"
......
...@@ -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.
......
...@@ -20,6 +20,7 @@ const ( ...@@ -20,6 +20,7 @@ const (
AF_E164 = 0x1c; AF_E164 = 0x1c;
AF_ECMA = 0x8; AF_ECMA = 0x8;
AF_HYLINK = 0xf; AF_HYLINK = 0xf;
AF_IEEE80211 = 0x25;
AF_IMPLINK = 0x3; AF_IMPLINK = 0x3;
AF_INET = 0x2; AF_INET = 0x2;
AF_INET6 = 0x1e; AF_INET6 = 0x1e;
...@@ -29,7 +30,7 @@ const ( ...@@ -29,7 +30,7 @@ const (
AF_LAT = 0xe; AF_LAT = 0xe;
AF_LINK = 0x12; AF_LINK = 0x12;
AF_LOCAL = 0x1; AF_LOCAL = 0x1;
AF_MAX = 0x25; AF_MAX = 0x26;
AF_NATM = 0x1f; AF_NATM = 0x1f;
AF_NDRV = 0x1b; AF_NDRV = 0x1b;
AF_NETBIOS = 0x21; AF_NETBIOS = 0x21;
...@@ -152,16 +153,19 @@ const ( ...@@ -152,16 +153,19 @@ const (
EVFILT_MACHPORT = -0x8; EVFILT_MACHPORT = -0x8;
EVFILT_PROC = -0x5; EVFILT_PROC = -0x5;
EVFILT_READ = -0x1; EVFILT_READ = -0x1;
EVFILT_SESSION = -0xb;
EVFILT_SIGNAL = -0x6; EVFILT_SIGNAL = -0x6;
EVFILT_SYSCOUNT = 0x9; EVFILT_SYSCOUNT = 0xb;
EVFILT_THREADMARKER = 0x9; EVFILT_THREADMARKER = 0xb;
EVFILT_TIMER = -0x7; EVFILT_TIMER = -0x7;
EVFILT_USER = -0xa;
EVFILT_VNODE = -0x4; EVFILT_VNODE = -0x4;
EVFILT_WRITE = -0x2; EVFILT_WRITE = -0x2;
EV_ADD = 0x1; EV_ADD = 0x1;
EV_CLEAR = 0x20; EV_CLEAR = 0x20;
EV_DELETE = 0x2; EV_DELETE = 0x2;
EV_DISABLE = 0x8; EV_DISABLE = 0x8;
EV_DISPATCH = 0x80;
EV_ENABLE = 0x4; EV_ENABLE = 0x4;
EV_EOF = 0x8000; EV_EOF = 0x8000;
EV_ERROR = 0x4000; EV_ERROR = 0x4000;
...@@ -172,10 +176,12 @@ const ( ...@@ -172,10 +176,12 @@ const (
EV_POLL = 0x1000; EV_POLL = 0x1000;
EV_RECEIPT = 0x40; EV_RECEIPT = 0x40;
EV_SYSFLAGS = 0xf000; EV_SYSFLAGS = 0xf000;
EV_TRIGGER = 0x100;
EWOULDBLOCK = 0x23; EWOULDBLOCK = 0x23;
EXDEV = 0x12; EXDEV = 0x12;
FD_CLOEXEC = 0x1; FD_CLOEXEC = 0x1;
FD_SETSIZE = 0x400; FD_SETSIZE = 0x400;
F_ADDFILESIGS = 0x3d;
F_ADDSIGS = 0x3b; F_ADDSIGS = 0x3b;
F_ALLOCATEALL = 0x4; F_ALLOCATEALL = 0x4;
F_ALLOCATECONTIG = 0x2; F_ALLOCATECONTIG = 0x2;
...@@ -318,6 +324,7 @@ const ( ...@@ -318,6 +324,7 @@ const (
IPPROTO_XNET = 0xf; IPPROTO_XNET = 0xf;
IPPROTO_XTP = 0x24; IPPROTO_XTP = 0x24;
IP_ADD_MEMBERSHIP = 0xc; IP_ADD_MEMBERSHIP = 0xc;
IP_BOUND_IF = 0x19;
IP_DEFAULT_MULTICAST_LOOP = 0x1; IP_DEFAULT_MULTICAST_LOOP = 0x1;
IP_DEFAULT_MULTICAST_TTL = 0x1; IP_DEFAULT_MULTICAST_TTL = 0x1;
IP_DROP_MEMBERSHIP = 0xd; IP_DROP_MEMBERSHIP = 0xd;
...@@ -371,6 +378,7 @@ const ( ...@@ -371,6 +378,7 @@ const (
O_ASYNC = 0x40; O_ASYNC = 0x40;
O_CREAT = 0x200; O_CREAT = 0x200;
O_DIRECTORY = 0x100000; O_DIRECTORY = 0x100000;
O_DSYNC = 0x400000;
O_EVTONLY = 0x8000; O_EVTONLY = 0x8000;
O_EXCL = 0x800; O_EXCL = 0x800;
O_EXLOCK = 0x20; O_EXLOCK = 0x20;
...@@ -387,6 +395,9 @@ const ( ...@@ -387,6 +395,9 @@ const (
O_SYNC = 0x80; O_SYNC = 0x80;
O_TRUNC = 0x400; O_TRUNC = 0x400;
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;
...@@ -441,10 +452,12 @@ const ( ...@@ -441,10 +452,12 @@ const (
SO_NOADDRERR = 0x1023; SO_NOADDRERR = 0x1023;
SO_NOSIGPIPE = 0x1022; SO_NOSIGPIPE = 0x1022;
SO_NOTIFYCONFLICT = 0x1026; SO_NOTIFYCONFLICT = 0x1026;
SO_NP_EXTENSIONS = 0x1083;
SO_NREAD = 0x1020; SO_NREAD = 0x1020;
SO_NWRITE = 0x1024; SO_NWRITE = 0x1024;
SO_OOBINLINE = 0x100; SO_OOBINLINE = 0x100;
SO_PEERLABEL = 0x1011; SO_PEERLABEL = 0x1011;
SO_RANDOMPORT = 0x1082;
SO_RCVBUF = 0x1002; SO_RCVBUF = 0x1002;
SO_RCVLOWAT = 0x1004; SO_RCVLOWAT = 0x1004;
SO_RCVTIMEO = 0x1006; SO_RCVTIMEO = 0x1006;
...@@ -460,6 +473,7 @@ const ( ...@@ -460,6 +473,7 @@ const (
SO_SNDTIMEO = 0x1005; SO_SNDTIMEO = 0x1005;
SO_TIMESTAMP = 0x400; SO_TIMESTAMP = 0x400;
SO_TYPE = 0x1008; SO_TYPE = 0x1008;
SO_UPCALLCLOSEWAIT = 0x1027;
SO_USELOOPBACK = 0x40; SO_USELOOPBACK = 0x40;
SO_WANTMORE = 0x4000; SO_WANTMORE = 0x4000;
SO_WANTOOBFLAG = 0x8000; SO_WANTOOBFLAG = 0x8000;
...@@ -473,7 +487,6 @@ const ( ...@@ -473,7 +487,6 @@ const (
S_IFREG = 0x8000; S_IFREG = 0x8000;
S_IFSOCK = 0xc000; S_IFSOCK = 0xc000;
S_IFWHT = 0xe000; S_IFWHT = 0xe000;
S_IFXATTR = 0x10000;
S_IREAD = 0x100; S_IREAD = 0x100;
S_IRGRP = 0x20; S_IRGRP = 0x20;
S_IROTH = 0x4; S_IROTH = 0x4;
...@@ -492,6 +505,7 @@ const ( ...@@ -492,6 +505,7 @@ const (
S_IXGRP = 0x8; S_IXGRP = 0x8;
S_IXOTH = 0x1; S_IXOTH = 0x1;
S_IXUSR = 0x40; S_IXUSR = 0x40;
TCP_CONNECTIONTIMEOUT = 0x20;
TCP_KEEPALIVE = 0x10; TCP_KEEPALIVE = 0x10;
TCP_MAXBURST = 0x4; TCP_MAXBURST = 0x4;
TCP_MAXHLEN = 0x3c; TCP_MAXHLEN = 0x3c;
...@@ -511,7 +525,7 @@ const ( ...@@ -511,7 +525,7 @@ const (
WEXITED = 0x4; WEXITED = 0x4;
WNOHANG = 0x1; WNOHANG = 0x1;
WNOWAIT = 0x20; WNOWAIT = 0x20;
WORDSIZE = 0x20; WORDSIZE = 0x40;
WSTOPPED = 0x7f; WSTOPPED = 0x7f;
WUNTRACED = 0x2; WUNTRACED = 0x2;
) )
...@@ -521,107 +535,107 @@ const ( ...@@ -521,107 +535,107 @@ const (
// Error table // Error table
var errors = [...]string{ var errors = [...]string{
95: "EMULTIHOP (Reserved)", 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",
92: "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",
89: "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",
91: "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",
96: "no message available on STREAM",
4: "interrupted system call",
97: "ENOLINK (Reserved)",
1: "operation not permitted",
50: "network is down",
70: "stale NFS file handle",
38: "socket operation on non-socket",
98: "no STREAM resources",
80: "authentication error", 80: "authentication error",
10: "no child processes", 86: "bad CPU type in executable",
32: "broken pipe", 85: "bad executable (or shared library)",
93: "attribute not found", 9: "bad file descriptor",
88: "malformed Mach-o file",
94: "bad message", 94: "bad message",
71: "too many levels of remote in path", 72: "RPC struct is bad",
59: "too many references: can't splice",
46: "protocol family not supported",
76: "bad procedure for program",
48: "address already in use",
52: "network dropped connection on reset",
21: "is a directory",
90: "identifier removed",
83: "device error",
22: "invalid argument",
58: "can't send after socket shutdown",
82: "device power is off",
84: "value too large to be stored in data type",
16: "resource busy", 16: "resource busy",
67: "too many processes", 89: "operation canceled",
100: "protocol error", 10: "no child processes",
19: "operation not supported by device", 53: "software caused connection abort",
30: "read-only file system", 61: "connection refused",
7: "argument list too long",
11: "resource deadlock avoided",
54: "connection reset by peer", 54: "connection reset by peer",
88: "malformed Mach-o file", 11: "resource deadlock avoided",
6: "device not configured", 39: "destination address required",
72: "RPC struct is bad", 83: "device error",
63: "file name too long",
103: "policy not found",
44: "socket type not supported",
49: "can't assign requested address",
101: "STREAM ioctl timeout",
43: "protocol not supported",
5: "input/output error",
51: "network is unreachable",
18: "cross-device link",
69: "disc quota exceeded",
28: "no space left on device",
8: "exec format error",
40: "message too long",
79: "inappropriate file type or format",
33: "numerical argument out of domain", 33: "numerical argument out of domain",
99: "not a STREAM", 69: "disc quota exceeded",
17: "file exists",
14: "bad address",
27: "file too large", 27: "file too large",
3: "no such process", 79: "inappropriate file type or format",
64: "host is down", 64: "host is down",
77: "no locks available", 65: "no route to host",
90: "identifier removed",
92: "illegal byte sequence",
36: "operation now in progress",
4: "interrupted system call",
22: "invalid argument",
5: "input/output error",
56: "socket is already connected",
21: "is a directory",
103: "policy not found",
62: "too many levels of symbolic links",
24: "too many open files",
31: "too many links",
40: "message too long",
95: "EMULTIHOP (Reserved)",
63: "file name too long",
81: "need authenticator",
50: "network is down",
52: "network dropped connection on reset",
51: "network is unreachable",
23: "too many open files in system", 23: "too many open files in system",
93: "attribute not found",
55: "no buffer space available",
96: "no message available on STREAM",
19: "operation not supported by device",
2: "no such file or directory",
8: "exec format error",
77: "no locks available",
97: "ENOLINK (Reserved)",
12: "cannot allocate memory",
91: "no message of desired type",
42: "protocol not available",
28: "no space left on device",
98: "no STREAM resources",
99: "not a STREAM",
78: "function not implemented", 78: "function not implemented",
86: "bad CPU type in executable", 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",
102: "operation not supported on socket",
84: "value too large to be stored in data type",
1: "operation not permitted",
46: "protocol family not supported",
32: "broken pipe",
67: "too many processes",
76: "bad procedure for program",
75: "program version wrong",
74: "RPC prog. not avail",
100: "protocol error",
43: "protocol not supported",
41: "protocol wrong type for socket",
82: "device power is off",
34: "result too large",
71: "too many levels of remote in path",
30: "read-only file system",
73: "RPC version wrong",
87: "shared library version mismatch", 87: "shared library version mismatch",
58: "can't send after socket shutdown",
44: "socket type not supported",
29: "illegal seek",
3: "no such process",
70: "stale NFS file handle",
101: "STREAM ioctl timeout",
60: "operation timed out",
59: "too many references: can't splice",
26: "text file busy",
68: "too many users", 68: "too many users",
42: "protocol not available", 18: "cross-device link",
24: "too many open files",
62: "too many levels of symbolic links",
55: "no buffer space available",
14: "bad address",
35: "resource temporarily unavailable",
85: "bad executable (or shared library)",
61: "connection refused",
17: "file exists",
75: "program version wrong",
2: "no such file or directory",
65: "no route to host",
102: "operation not supported on socket",
} }
...@@ -20,6 +20,7 @@ const ( ...@@ -20,6 +20,7 @@ const (
AF_E164 = 0x1c; AF_E164 = 0x1c;
AF_ECMA = 0x8; AF_ECMA = 0x8;
AF_HYLINK = 0xf; AF_HYLINK = 0xf;
AF_IEEE80211 = 0x25;
AF_IMPLINK = 0x3; AF_IMPLINK = 0x3;
AF_INET = 0x2; AF_INET = 0x2;
AF_INET6 = 0x1e; AF_INET6 = 0x1e;
...@@ -29,7 +30,7 @@ const ( ...@@ -29,7 +30,7 @@ const (
AF_LAT = 0xe; AF_LAT = 0xe;
AF_LINK = 0x12; AF_LINK = 0x12;
AF_LOCAL = 0x1; AF_LOCAL = 0x1;
AF_MAX = 0x25; AF_MAX = 0x26;
AF_NATM = 0x1f; AF_NATM = 0x1f;
AF_NDRV = 0x1b; AF_NDRV = 0x1b;
AF_NETBIOS = 0x21; AF_NETBIOS = 0x21;
...@@ -152,16 +153,19 @@ const ( ...@@ -152,16 +153,19 @@ const (
EVFILT_MACHPORT = -0x8; EVFILT_MACHPORT = -0x8;
EVFILT_PROC = -0x5; EVFILT_PROC = -0x5;
EVFILT_READ = -0x1; EVFILT_READ = -0x1;
EVFILT_SESSION = -0xb;
EVFILT_SIGNAL = -0x6; EVFILT_SIGNAL = -0x6;
EVFILT_SYSCOUNT = 0x9; EVFILT_SYSCOUNT = 0xb;
EVFILT_THREADMARKER = 0x9; EVFILT_THREADMARKER = 0xb;
EVFILT_TIMER = -0x7; EVFILT_TIMER = -0x7;
EVFILT_USER = -0xa;
EVFILT_VNODE = -0x4; EVFILT_VNODE = -0x4;
EVFILT_WRITE = -0x2; EVFILT_WRITE = -0x2;
EV_ADD = 0x1; EV_ADD = 0x1;
EV_CLEAR = 0x20; EV_CLEAR = 0x20;
EV_DELETE = 0x2; EV_DELETE = 0x2;
EV_DISABLE = 0x8; EV_DISABLE = 0x8;
EV_DISPATCH = 0x80;
EV_ENABLE = 0x4; EV_ENABLE = 0x4;
EV_EOF = 0x8000; EV_EOF = 0x8000;
EV_ERROR = 0x4000; EV_ERROR = 0x4000;
...@@ -172,10 +176,12 @@ const ( ...@@ -172,10 +176,12 @@ const (
EV_POLL = 0x1000; EV_POLL = 0x1000;
EV_RECEIPT = 0x40; EV_RECEIPT = 0x40;
EV_SYSFLAGS = 0xf000; EV_SYSFLAGS = 0xf000;
EV_TRIGGER = 0x100;
EWOULDBLOCK = 0x23; EWOULDBLOCK = 0x23;
EXDEV = 0x12; EXDEV = 0x12;
FD_CLOEXEC = 0x1; FD_CLOEXEC = 0x1;
FD_SETSIZE = 0x400; FD_SETSIZE = 0x400;
F_ADDFILESIGS = 0x3d;
F_ADDSIGS = 0x3b; F_ADDSIGS = 0x3b;
F_ALLOCATEALL = 0x4; F_ALLOCATEALL = 0x4;
F_ALLOCATECONTIG = 0x2; F_ALLOCATECONTIG = 0x2;
...@@ -318,6 +324,7 @@ const ( ...@@ -318,6 +324,7 @@ const (
IPPROTO_XNET = 0xf; IPPROTO_XNET = 0xf;
IPPROTO_XTP = 0x24; IPPROTO_XTP = 0x24;
IP_ADD_MEMBERSHIP = 0xc; IP_ADD_MEMBERSHIP = 0xc;
IP_BOUND_IF = 0x19;
IP_DEFAULT_MULTICAST_LOOP = 0x1; IP_DEFAULT_MULTICAST_LOOP = 0x1;
IP_DEFAULT_MULTICAST_TTL = 0x1; IP_DEFAULT_MULTICAST_TTL = 0x1;
IP_DROP_MEMBERSHIP = 0xd; IP_DROP_MEMBERSHIP = 0xd;
...@@ -371,6 +378,7 @@ const ( ...@@ -371,6 +378,7 @@ const (
O_ASYNC = 0x40; O_ASYNC = 0x40;
O_CREAT = 0x200; O_CREAT = 0x200;
O_DIRECTORY = 0x100000; O_DIRECTORY = 0x100000;
O_DSYNC = 0x400000;
O_EVTONLY = 0x8000; O_EVTONLY = 0x8000;
O_EXCL = 0x800; O_EXCL = 0x800;
O_EXLOCK = 0x20; O_EXLOCK = 0x20;
...@@ -387,6 +395,9 @@ const ( ...@@ -387,6 +395,9 @@ const (
O_SYNC = 0x80; O_SYNC = 0x80;
O_TRUNC = 0x400; O_TRUNC = 0x400;
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;
...@@ -441,10 +452,12 @@ const ( ...@@ -441,10 +452,12 @@ const (
SO_NOADDRERR = 0x1023; SO_NOADDRERR = 0x1023;
SO_NOSIGPIPE = 0x1022; SO_NOSIGPIPE = 0x1022;
SO_NOTIFYCONFLICT = 0x1026; SO_NOTIFYCONFLICT = 0x1026;
SO_NP_EXTENSIONS = 0x1083;
SO_NREAD = 0x1020; SO_NREAD = 0x1020;
SO_NWRITE = 0x1024; SO_NWRITE = 0x1024;
SO_OOBINLINE = 0x100; SO_OOBINLINE = 0x100;
SO_PEERLABEL = 0x1011; SO_PEERLABEL = 0x1011;
SO_RANDOMPORT = 0x1082;
SO_RCVBUF = 0x1002; SO_RCVBUF = 0x1002;
SO_RCVLOWAT = 0x1004; SO_RCVLOWAT = 0x1004;
SO_RCVTIMEO = 0x1006; SO_RCVTIMEO = 0x1006;
...@@ -460,6 +473,7 @@ const ( ...@@ -460,6 +473,7 @@ const (
SO_SNDTIMEO = 0x1005; SO_SNDTIMEO = 0x1005;
SO_TIMESTAMP = 0x400; SO_TIMESTAMP = 0x400;
SO_TYPE = 0x1008; SO_TYPE = 0x1008;
SO_UPCALLCLOSEWAIT = 0x1027;
SO_USELOOPBACK = 0x40; SO_USELOOPBACK = 0x40;
SO_WANTMORE = 0x4000; SO_WANTMORE = 0x4000;
SO_WANTOOBFLAG = 0x8000; SO_WANTOOBFLAG = 0x8000;
...@@ -473,7 +487,6 @@ const ( ...@@ -473,7 +487,6 @@ const (
S_IFREG = 0x8000; S_IFREG = 0x8000;
S_IFSOCK = 0xc000; S_IFSOCK = 0xc000;
S_IFWHT = 0xe000; S_IFWHT = 0xe000;
S_IFXATTR = 0x10000;
S_IREAD = 0x100; S_IREAD = 0x100;
S_IRGRP = 0x20; S_IRGRP = 0x20;
S_IROTH = 0x4; S_IROTH = 0x4;
...@@ -492,6 +505,7 @@ const ( ...@@ -492,6 +505,7 @@ const (
S_IXGRP = 0x8; S_IXGRP = 0x8;
S_IXOTH = 0x1; S_IXOTH = 0x1;
S_IXUSR = 0x40; S_IXUSR = 0x40;
TCP_CONNECTIONTIMEOUT = 0x20;
TCP_KEEPALIVE = 0x10; TCP_KEEPALIVE = 0x10;
TCP_MAXBURST = 0x4; TCP_MAXBURST = 0x4;
TCP_MAXHLEN = 0x3c; TCP_MAXHLEN = 0x3c;
...@@ -511,6 +525,7 @@ const ( ...@@ -511,6 +525,7 @@ const (
WEXITED = 0x4; WEXITED = 0x4;
WNOHANG = 0x1; WNOHANG = 0x1;
WNOWAIT = 0x20; WNOWAIT = 0x20;
WORDSIZE = 0x40;
WSTOPPED = 0x7f; WSTOPPED = 0x7f;
WUNTRACED = 0x2; WUNTRACED = 0x2;
) )
...@@ -520,107 +535,107 @@ const ( ...@@ -520,107 +535,107 @@ const (
// Error table // Error table
var errors = [...]string{ var errors = [...]string{
95: "EMULTIHOP (Reserved)", 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",
92: "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",
89: "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",
91: "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",
96: "no message available on STREAM",
4: "interrupted system call",
97: "ENOLINK (Reserved)",
1: "operation not permitted",
50: "network is down",
70: "stale NFS file handle",
38: "socket operation on non-socket",
98: "no STREAM resources",
80: "authentication error", 80: "authentication error",
10: "no child processes", 86: "bad CPU type in executable",
32: "broken pipe", 85: "bad executable (or shared library)",
93: "attribute not found", 9: "bad file descriptor",
88: "malformed Mach-o file",
94: "bad message", 94: "bad message",
71: "too many levels of remote in path", 72: "RPC struct is bad",
59: "too many references: can't splice",
46: "protocol family not supported",
76: "bad procedure for program",
48: "address already in use",
52: "network dropped connection on reset",
21: "is a directory",
90: "identifier removed",
83: "device error",
22: "invalid argument",
58: "can't send after socket shutdown",
82: "device power is off",
84: "value too large to be stored in data type",
16: "resource busy", 16: "resource busy",
67: "too many processes", 89: "operation canceled",
100: "protocol error", 10: "no child processes",
19: "operation not supported by device", 53: "software caused connection abort",
30: "read-only file system", 61: "connection refused",
7: "argument list too long",
11: "resource deadlock avoided",
54: "connection reset by peer", 54: "connection reset by peer",
88: "malformed Mach-o file", 11: "resource deadlock avoided",
6: "device not configured", 39: "destination address required",
72: "RPC struct is bad", 83: "device error",
63: "file name too long",
103: "policy not found",
44: "socket type not supported",
49: "can't assign requested address",
101: "STREAM ioctl timeout",
43: "protocol not supported",
5: "input/output error",
51: "network is unreachable",
18: "cross-device link",
69: "disc quota exceeded",
28: "no space left on device",
8: "exec format error",
40: "message too long",
79: "inappropriate file type or format",
33: "numerical argument out of domain", 33: "numerical argument out of domain",
99: "not a STREAM", 69: "disc quota exceeded",
17: "file exists",
14: "bad address",
27: "file too large", 27: "file too large",
3: "no such process", 79: "inappropriate file type or format",
64: "host is down", 64: "host is down",
77: "no locks available", 65: "no route to host",
90: "identifier removed",
92: "illegal byte sequence",
36: "operation now in progress",
4: "interrupted system call",
22: "invalid argument",
5: "input/output error",
56: "socket is already connected",
21: "is a directory",
103: "policy not found",
62: "too many levels of symbolic links",
24: "too many open files",
31: "too many links",
40: "message too long",
95: "EMULTIHOP (Reserved)",
63: "file name too long",
81: "need authenticator",
50: "network is down",
52: "network dropped connection on reset",
51: "network is unreachable",
23: "too many open files in system", 23: "too many open files in system",
93: "attribute not found",
55: "no buffer space available",
96: "no message available on STREAM",
19: "operation not supported by device",
2: "no such file or directory",
8: "exec format error",
77: "no locks available",
97: "ENOLINK (Reserved)",
12: "cannot allocate memory",
91: "no message of desired type",
42: "protocol not available",
28: "no space left on device",
98: "no STREAM resources",
99: "not a STREAM",
78: "function not implemented", 78: "function not implemented",
86: "bad CPU type in executable", 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",
102: "operation not supported on socket",
84: "value too large to be stored in data type",
1: "operation not permitted",
46: "protocol family not supported",
32: "broken pipe",
67: "too many processes",
76: "bad procedure for program",
75: "program version wrong",
74: "RPC prog. not avail",
100: "protocol error",
43: "protocol not supported",
41: "protocol wrong type for socket",
82: "device power is off",
34: "result too large",
71: "too many levels of remote in path",
30: "read-only file system",
73: "RPC version wrong",
87: "shared library version mismatch", 87: "shared library version mismatch",
58: "can't send after socket shutdown",
44: "socket type not supported",
29: "illegal seek",
3: "no such process",
70: "stale NFS file handle",
101: "STREAM ioctl timeout",
60: "operation timed out",
59: "too many references: can't splice",
26: "text file busy",
68: "too many users", 68: "too many users",
42: "protocol not available", 18: "cross-device link",
24: "too many open files",
62: "too many levels of symbolic links",
55: "no buffer space available",
14: "bad address",
35: "resource temporarily unavailable",
85: "bad executable (or shared library)",
61: "connection refused",
17: "file exists",
75: "program version wrong",
2: "no such file or directory",
65: "no route to host",
102: "operation not supported on socket",
} }
...@@ -16,27 +16,34 @@ const ( ...@@ -16,27 +16,34 @@ const (
AF_AX25 = 0x3; AF_AX25 = 0x3;
AF_BLUETOOTH = 0x1f; AF_BLUETOOTH = 0x1f;
AF_BRIDGE = 0x7; AF_BRIDGE = 0x7;
AF_CAN = 0x1d;
AF_DECnet = 0xc; AF_DECnet = 0xc;
AF_ECONET = 0x13; AF_ECONET = 0x13;
AF_FILE = 0x1; AF_FILE = 0x1;
AF_IEEE802154 = 0x24;
AF_INET = 0x2; AF_INET = 0x2;
AF_INET6 = 0xa; AF_INET6 = 0xa;
AF_IPX = 0x4; AF_IPX = 0x4;
AF_IRDA = 0x17; AF_IRDA = 0x17;
AF_ISDN = 0x22;
AF_IUCV = 0x20; AF_IUCV = 0x20;
AF_KEY = 0xf; AF_KEY = 0xf;
AF_LLC = 0x1a;
AF_LOCAL = 0x1; AF_LOCAL = 0x1;
AF_MAX = 0x22; AF_MAX = 0x25;
AF_NETBEUI = 0xd; AF_NETBEUI = 0xd;
AF_NETLINK = 0x10; AF_NETLINK = 0x10;
AF_NETROM = 0x6; AF_NETROM = 0x6;
AF_PACKET = 0x11; AF_PACKET = 0x11;
AF_PHONET = 0x23;
AF_PPPOX = 0x18; AF_PPPOX = 0x18;
AF_RDS = 0x15;
AF_ROSE = 0xb; AF_ROSE = 0xb;
AF_ROUTE = 0x10; AF_ROUTE = 0x10;
AF_RXRPC = 0x21; AF_RXRPC = 0x21;
AF_SECURITY = 0xe; AF_SECURITY = 0xe;
AF_SNA = 0x16; AF_SNA = 0x16;
AF_TIPC = 0x1e;
AF_UNIX = 0x1; AF_UNIX = 0x1;
AF_UNSPEC = 0; AF_UNSPEC = 0;
AF_WANPIPE = 0x19; AF_WANPIPE = 0x19;
...@@ -160,9 +167,11 @@ const ( ...@@ -160,9 +167,11 @@ const (
EPOLLRDNORM = 0x40; EPOLLRDNORM = 0x40;
EPOLLWRBAND = 0x200; EPOLLWRBAND = 0x200;
EPOLLWRNORM = 0x100; EPOLLWRNORM = 0x100;
EPOLL_CLOEXEC = 0x80000;
EPOLL_CTL_ADD = 0x1; EPOLL_CTL_ADD = 0x1;
EPOLL_CTL_DEL = 0x2; EPOLL_CTL_DEL = 0x2;
EPOLL_CTL_MOD = 0x3; EPOLL_CTL_MOD = 0x3;
EPOLL_NONBLOCK = 0x800;
EPROTO = 0x47; EPROTO = 0x47;
EPROTONOSUPPORT = 0x5d; EPROTONOSUPPORT = 0x5d;
EPROTOTYPE = 0x5b; EPROTOTYPE = 0x5b;
...@@ -171,6 +180,7 @@ const ( ...@@ -171,6 +180,7 @@ const (
EREMOTE = 0x42; EREMOTE = 0x42;
EREMOTEIO = 0x79; EREMOTEIO = 0x79;
ERESTART = 0x55; ERESTART = 0x55;
ERFKILL = 0x84;
EROFS = 0x1e; EROFS = 0x1e;
ESHUTDOWN = 0x6c; ESHUTDOWN = 0x6c;
ESOCKTNOSUPPORT = 0x5e; ESOCKTNOSUPPORT = 0x5e;
...@@ -189,7 +199,6 @@ const ( ...@@ -189,7 +199,6 @@ const (
EWOULDBLOCK = 0xb; EWOULDBLOCK = 0xb;
EXDEV = 0x12; EXDEV = 0x12;
EXFULL = 0x36; EXFULL = 0x36;
EXPR_NEST_MAX = 0x20;
FD_CLOEXEC = 0x1; FD_CLOEXEC = 0x1;
FD_SETSIZE = 0x400; FD_SETSIZE = 0x400;
F_DUPFD = 0; F_DUPFD = 0;
...@@ -223,6 +232,7 @@ const ( ...@@ -223,6 +232,7 @@ const (
F_WRLCK = 0x1; F_WRLCK = 0x1;
IPPROTO_AH = 0x33; IPPROTO_AH = 0x33;
IPPROTO_COMP = 0x6c; IPPROTO_COMP = 0x6c;
IPPROTO_DCCP = 0x21;
IPPROTO_DSTOPTS = 0x3c; IPPROTO_DSTOPTS = 0x3c;
IPPROTO_EGP = 0x8; IPPROTO_EGP = 0x8;
IPPROTO_ENCAP = 0x62; IPPROTO_ENCAP = 0x62;
...@@ -248,6 +258,7 @@ const ( ...@@ -248,6 +258,7 @@ const (
IPPROTO_TCP = 0x6; IPPROTO_TCP = 0x6;
IPPROTO_TP = 0x1d; IPPROTO_TP = 0x1d;
IPPROTO_UDP = 0x11; IPPROTO_UDP = 0x11;
IPPROTO_UDPLITE = 0x88;
IP_ADD_MEMBERSHIP = 0x23; IP_ADD_MEMBERSHIP = 0x23;
IP_ADD_SOURCE_MEMBERSHIP = 0x27; IP_ADD_SOURCE_MEMBERSHIP = 0x27;
IP_BLOCK_SOURCE = 0x26; IP_BLOCK_SOURCE = 0x26;
...@@ -268,6 +279,7 @@ const ( ...@@ -268,6 +279,7 @@ const (
IP_PMTUDISC = 0xa; IP_PMTUDISC = 0xa;
IP_PMTUDISC_DO = 0x2; IP_PMTUDISC_DO = 0x2;
IP_PMTUDISC_DONT = 0; IP_PMTUDISC_DONT = 0;
IP_PMTUDISC_PROBE = 0x3;
IP_PMTUDISC_WANT = 0x1; IP_PMTUDISC_WANT = 0x1;
IP_RECVERR = 0xb; IP_RECVERR = 0xb;
IP_RECVOPTS = 0x6; IP_RECVOPTS = 0x6;
...@@ -304,6 +316,16 @@ const ( ...@@ -304,6 +316,16 @@ const (
O_WRONLY = 0x1; O_WRONLY = 0x1;
PTRACE_ARCH_PRCTL = 0x1e; PTRACE_ARCH_PRCTL = 0x1e;
PTRACE_ATTACH = 0x10; PTRACE_ATTACH = 0x10;
PTRACE_BTS_CLEAR = 0x2c;
PTRACE_BTS_CONFIG = 0x28;
PTRACE_BTS_DRAIN = 0x2d;
PTRACE_BTS_GET = 0x2b;
PTRACE_BTS_O_ALLOC = 0x8;
PTRACE_BTS_O_SCHED = 0x2;
PTRACE_BTS_O_SIGNAL = 0x4;
PTRACE_BTS_O_TRACE = 0x1;
PTRACE_BTS_SIZE = 0x2a;
PTRACE_BTS_STATUS = 0x29;
PTRACE_CONT = 0x7; PTRACE_CONT = 0x7;
PTRACE_DETACH = 0x11; PTRACE_DETACH = 0x11;
PTRACE_EVENT_CLONE = 0x3; PTRACE_EVENT_CLONE = 0x3;
...@@ -340,9 +362,15 @@ const ( ...@@ -340,9 +362,15 @@ const (
PTRACE_SETREGS = 0xd; PTRACE_SETREGS = 0xd;
PTRACE_SETSIGINFO = 0x4203; PTRACE_SETSIGINFO = 0x4203;
PTRACE_SET_THREAD_AREA = 0x1a; PTRACE_SET_THREAD_AREA = 0x1a;
PTRACE_SINGLEBLOCK = 0x21;
PTRACE_SINGLESTEP = 0x9; PTRACE_SINGLESTEP = 0x9;
PTRACE_SYSCALL = 0x18; PTRACE_SYSCALL = 0x18;
PTRACE_SYSEMU = 0x1f;
PTRACE_SYSEMU_SINGLESTEP = 0x20;
PTRACE_TRACEME = 0; PTRACE_TRACEME = 0;
SHUT_RD = 0;
SHUT_RDWR = 0x2;
SHUT_WR = 0x1;
SIGABRT = 0x6; SIGABRT = 0x6;
SIGALRM = 0xe; SIGALRM = 0xe;
SIGBUS = 0x7; SIGBUS = 0x7;
...@@ -378,7 +406,10 @@ const ( ...@@ -378,7 +406,10 @@ const (
SIGWINCH = 0x1c; SIGWINCH = 0x1c;
SIGXCPU = 0x18; SIGXCPU = 0x18;
SIGXFSZ = 0x19; SIGXFSZ = 0x19;
SOCK_CLOEXEC = 0x80000;
SOCK_DCCP = 0x6;
SOCK_DGRAM = 0x2; SOCK_DGRAM = 0x2;
SOCK_NONBLOCK = 0x800;
SOCK_PACKET = 0xa; SOCK_PACKET = 0xa;
SOCK_RAW = 0x3; SOCK_RAW = 0x3;
SOCK_RDM = 0x4; SOCK_RDM = 0x4;
...@@ -408,6 +439,7 @@ const ( ...@@ -408,6 +439,7 @@ const (
SO_ERROR = 0x4; SO_ERROR = 0x4;
SO_KEEPALIVE = 0x9; SO_KEEPALIVE = 0x9;
SO_LINGER = 0xd; SO_LINGER = 0xd;
SO_MARK = 0x24;
SO_NO_CHECK = 0xb; SO_NO_CHECK = 0xb;
SO_OOBINLINE = 0xa; SO_OOBINLINE = 0xa;
SO_PASSCRED = 0x10; SO_PASSCRED = 0x10;
...@@ -429,6 +461,7 @@ const ( ...@@ -429,6 +461,7 @@ const (
SO_SNDLOWAT = 0x13; SO_SNDLOWAT = 0x13;
SO_SNDTIMEO = 0x15; SO_SNDTIMEO = 0x15;
SO_TIMESTAMP = 0x1d; SO_TIMESTAMP = 0x1d;
SO_TIMESTAMPING = 0x25;
SO_TIMESTAMPNS = 0x23; SO_TIMESTAMPNS = 0x23;
SO_TYPE = 0x3; SO_TYPE = 0x3;
S_BLKSIZE = 0x200; S_BLKSIZE = 0x200;
...@@ -493,133 +526,134 @@ const ( ...@@ -493,133 +526,134 @@ const (
// Error table // Error table
var errors = [...]string{ var errors = [...]string{
72: "multihop attempted", 7: "argument list too long",
49: "protocol driver not attached",
97: "address family not supported by protocol",
78: "remote address changed",
13: "permission denied", 13: "permission denied",
47: "level 3 reset", 98: "address already in use",
89: "destination address required", 99: "cannot assign requested address",
84: "invalid or incomplete multibyte or wide character", 68: "advertise error",
29: "illegal seek", 97: "address family not supported by protocol",
31: "too many links", 11: "resource temporarily unavailable",
130: "owner died", 114: "operation already in progress",
25: "inappropriate ioctl for device",
52: "invalid exchange", 52: "invalid exchange",
9: "bad file descriptor", 9: "bad file descriptor",
77: "file descriptor in bad state",
74: "bad message",
53: "invalid request descriptor", 53: "invalid request descriptor",
68: "advertise error", 56: "invalid request code",
34: "numerical result out of range", 57: "invalid slot",
59: "bad font file format",
16: "device or resource busy",
125: "operation canceled", 125: "operation canceled",
26: "text file busy",
12: "cannot allocate memory",
115: "operation now in progress",
15: "block device required",
91: "protocol wrong type for socket",
85: "interrupted system call should be restarted",
120: "is a named type file",
42: "no message of desired type",
114: "operation already in progress",
110: "connection timed out",
61: "no data available",
4: "interrupted system call",
67: "link has been severed",
1: "operation not permitted",
40: "too many levels of symbolic links",
100: "network is down",
116: "stale NFS file handle",
88: "socket operation on non-socket",
63: "out of streams resources",
10: "no child processes", 10: "no child processes",
48: "link number out of range", 44: "channel number out of range",
32: "broken pipe",
74: "bad message",
59: "bad font file format",
66: "object is remote",
109: "too many references: cannot splice",
96: "protocol family not supported",
64: "machine is not on the network",
54: "exchange full",
57: "invalid slot",
118: "not a XENIX named type file",
83: "cannot exec a shared library directly",
50: "no CSI structure available",
39: "directory not empty",
98: "address already in use",
102: "network dropped connection on reset",
21: "is a directory",
43: "identifier removed",
70: "communication error on send", 70: "communication error on send",
77: "file descriptor in bad state", 103: "software caused connection abort",
51: "level 2 halted", 111: "connection refused",
126: "required key not available",
22: "invalid argument",
108: "cannot send after transport endpoint shutdown",
129: "key was rejected by service",
81: ".lib section in a.out corrupted",
119: "no XENIX semaphores available",
60: "device not a stream",
75: "value too large for defined data type",
117: "structure needs cleaning",
123: "no medium found",
16: "device or resource busy",
71: "protocol error",
19: "no such device",
127: "key has expired",
30: "read-only file system",
79: "can not access a needed shared library",
7: "argument list too long",
35: "resource deadlock avoided",
104: "connection reset by peer", 104: "connection reset by peer",
6: "no such device or address", 35: "resource deadlock avoided",
56: "invalid request code", 89: "destination address required",
36: "file name too long", 33: "numerical argument out of domain",
94: "socket type not supported",
73: "RFS specific error", 73: "RFS specific error",
99: "cannot assign requested address",
62: "timer expired",
93: "protocol not supported",
131: "state not recoverable",
5: "input/output error",
101: "network is unreachable",
18: "invalid cross-device link",
122: "disk quota exceeded", 122: "disk quota exceeded",
121: "remote I/O error", 17: "file exists",
28: "no space left on device", 14: "bad address",
8: "exec format error",
90: "message too long",
33: "numerical argument out of domain",
27: "file too large", 27: "file too large",
3: "no such process",
44: "channel number out of range",
112: "host is down", 112: "host is down",
37: "no locks available", 113: "no route to host",
23: "too many open files in system", 43: "identifier removed",
38: "function not implemented", 84: "invalid or incomplete multibyte or wide character",
107: "transport endpoint is not connected", 115: "operation now in progress",
95: "operation not supported", 4: "interrupted system call",
69: "srmount error", 22: "invalid argument",
103: "software caused connection abort", 5: "input/output error",
55: "no anode",
106: "transport endpoint is already connected", 106: "transport endpoint is already connected",
87: "too many users", 21: "is a directory",
92: "protocol not available", 120: "is a named type file",
24: "too many open files", 127: "key has expired",
105: "no buffer space available", 129: "key was rejected by service",
128: "key has been revoked",
51: "level 2 halted",
45: "level 2 not synchronized",
46: "level 3 halted", 46: "level 3 halted",
14: "bad address", 47: "level 3 reset",
11: "resource temporarily unavailable", 79: "can not access a needed shared library",
80: "accessing a corrupted shared library", 80: "accessing a corrupted shared library",
86: "streams pipe error", 83: "cannot exec a shared library directly",
111: "connection refused",
82: "attempting to link in too many shared libraries", 82: "attempting to link in too many shared libraries",
17: "file exists", 81: ".lib section in a.out corrupted",
45: "level 2 not synchronized", 48: "link number out of range",
40: "too many levels of symbolic links",
124: "wrong medium type",
24: "too many open files",
31: "too many links",
90: "message too long",
72: "multihop attempted",
36: "file name too long",
119: "no XENIX semaphores available",
100: "network is down",
102: "network dropped connection on reset",
101: "network is unreachable",
23: "too many open files in system",
55: "no anode",
105: "no buffer space available",
50: "no CSI structure available",
61: "no data available",
19: "no such device",
2: "no such file or directory", 2: "no such file or directory",
8: "exec format error",
126: "required key not available",
37: "no locks available",
67: "link has been severed",
123: "no medium found",
12: "cannot allocate memory",
42: "no message of desired type",
64: "machine is not on the network",
65: "package not installed", 65: "package not installed",
128: "key has been revoked", 92: "protocol not available",
113: "no route to host", 28: "no space left on device",
76: "name not unique on network", 63: "out of streams resources",
60: "device not a stream",
38: "function not implemented",
15: "block device required",
107: "transport endpoint is not connected",
20: "not a directory", 20: "not a directory",
124: "wrong medium type", 39: "directory not empty",
118: "not a XENIX named type file",
131: "state not recoverable",
88: "socket operation on non-socket",
95: "operation not supported",
25: "inappropriate ioctl for device",
76: "name not unique on network",
6: "no such device or address",
75: "value too large for defined data type",
130: "owner died",
1: "operation not permitted",
96: "protocol family not supported",
32: "broken pipe",
71: "protocol error",
93: "protocol not supported",
91: "protocol wrong type for socket",
34: "numerical result out of range",
78: "remote address changed",
66: "object is remote",
121: "remote I/O error",
85: "interrupted system call should be restarted",
132: "unknown error 132",
30: "read-only file system",
108: "cannot send after transport endpoint shutdown",
94: "socket type not supported",
29: "illegal seek",
3: "no such process",
69: "srmount error",
116: "stale NFS file handle",
86: "streams pipe error",
62: "timer expired",
110: "connection timed out",
109: "too many references: cannot splice",
26: "text file busy",
117: "structure needs cleaning",
49: "protocol driver not attached",
87: "too many users",
18: "invalid cross-device link",
54: "exchange full",
} }
...@@ -16,27 +16,34 @@ const ( ...@@ -16,27 +16,34 @@ const (
AF_AX25 = 0x3; AF_AX25 = 0x3;
AF_BLUETOOTH = 0x1f; AF_BLUETOOTH = 0x1f;
AF_BRIDGE = 0x7; AF_BRIDGE = 0x7;
AF_CAN = 0x1d;
AF_DECnet = 0xc; AF_DECnet = 0xc;
AF_ECONET = 0x13; AF_ECONET = 0x13;
AF_FILE = 0x1; AF_FILE = 0x1;
AF_IEEE802154 = 0x24;
AF_INET = 0x2; AF_INET = 0x2;
AF_INET6 = 0xa; AF_INET6 = 0xa;
AF_IPX = 0x4; AF_IPX = 0x4;
AF_IRDA = 0x17; AF_IRDA = 0x17;
AF_ISDN = 0x22;
AF_IUCV = 0x20; AF_IUCV = 0x20;
AF_KEY = 0xf; AF_KEY = 0xf;
AF_LLC = 0x1a;
AF_LOCAL = 0x1; AF_LOCAL = 0x1;
AF_MAX = 0x22; AF_MAX = 0x25;
AF_NETBEUI = 0xd; AF_NETBEUI = 0xd;
AF_NETLINK = 0x10; AF_NETLINK = 0x10;
AF_NETROM = 0x6; AF_NETROM = 0x6;
AF_PACKET = 0x11; AF_PACKET = 0x11;
AF_PHONET = 0x23;
AF_PPPOX = 0x18; AF_PPPOX = 0x18;
AF_RDS = 0x15;
AF_ROSE = 0xb; AF_ROSE = 0xb;
AF_ROUTE = 0x10; AF_ROUTE = 0x10;
AF_RXRPC = 0x21; AF_RXRPC = 0x21;
AF_SECURITY = 0xe; AF_SECURITY = 0xe;
AF_SNA = 0x16; AF_SNA = 0x16;
AF_TIPC = 0x1e;
AF_UNIX = 0x1; AF_UNIX = 0x1;
AF_UNSPEC = 0; AF_UNSPEC = 0;
AF_WANPIPE = 0x19; AF_WANPIPE = 0x19;
...@@ -160,9 +167,11 @@ const ( ...@@ -160,9 +167,11 @@ const (
EPOLLRDNORM = 0x40; EPOLLRDNORM = 0x40;
EPOLLWRBAND = 0x200; EPOLLWRBAND = 0x200;
EPOLLWRNORM = 0x100; EPOLLWRNORM = 0x100;
EPOLL_CLOEXEC = 0x80000;
EPOLL_CTL_ADD = 0x1; EPOLL_CTL_ADD = 0x1;
EPOLL_CTL_DEL = 0x2; EPOLL_CTL_DEL = 0x2;
EPOLL_CTL_MOD = 0x3; EPOLL_CTL_MOD = 0x3;
EPOLL_NONBLOCK = 0x800;
EPROTO = 0x47; EPROTO = 0x47;
EPROTONOSUPPORT = 0x5d; EPROTONOSUPPORT = 0x5d;
EPROTOTYPE = 0x5b; EPROTOTYPE = 0x5b;
...@@ -171,6 +180,7 @@ const ( ...@@ -171,6 +180,7 @@ const (
EREMOTE = 0x42; EREMOTE = 0x42;
EREMOTEIO = 0x79; EREMOTEIO = 0x79;
ERESTART = 0x55; ERESTART = 0x55;
ERFKILL = 0x84;
EROFS = 0x1e; EROFS = 0x1e;
ESHUTDOWN = 0x6c; ESHUTDOWN = 0x6c;
ESOCKTNOSUPPORT = 0x5e; ESOCKTNOSUPPORT = 0x5e;
...@@ -189,7 +199,6 @@ const ( ...@@ -189,7 +199,6 @@ const (
EWOULDBLOCK = 0xb; EWOULDBLOCK = 0xb;
EXDEV = 0x12; EXDEV = 0x12;
EXFULL = 0x36; EXFULL = 0x36;
EXPR_NEST_MAX = 0x20;
FD_CLOEXEC = 0x1; FD_CLOEXEC = 0x1;
FD_SETSIZE = 0x400; FD_SETSIZE = 0x400;
F_DUPFD = 0; F_DUPFD = 0;
...@@ -223,6 +232,7 @@ const ( ...@@ -223,6 +232,7 @@ const (
F_WRLCK = 0x1; F_WRLCK = 0x1;
IPPROTO_AH = 0x33; IPPROTO_AH = 0x33;
IPPROTO_COMP = 0x6c; IPPROTO_COMP = 0x6c;
IPPROTO_DCCP = 0x21;
IPPROTO_DSTOPTS = 0x3c; IPPROTO_DSTOPTS = 0x3c;
IPPROTO_EGP = 0x8; IPPROTO_EGP = 0x8;
IPPROTO_ENCAP = 0x62; IPPROTO_ENCAP = 0x62;
...@@ -248,6 +258,7 @@ const ( ...@@ -248,6 +258,7 @@ const (
IPPROTO_TCP = 0x6; IPPROTO_TCP = 0x6;
IPPROTO_TP = 0x1d; IPPROTO_TP = 0x1d;
IPPROTO_UDP = 0x11; IPPROTO_UDP = 0x11;
IPPROTO_UDPLITE = 0x88;
IP_ADD_MEMBERSHIP = 0x23; IP_ADD_MEMBERSHIP = 0x23;
IP_ADD_SOURCE_MEMBERSHIP = 0x27; IP_ADD_SOURCE_MEMBERSHIP = 0x27;
IP_BLOCK_SOURCE = 0x26; IP_BLOCK_SOURCE = 0x26;
...@@ -268,6 +279,7 @@ const ( ...@@ -268,6 +279,7 @@ const (
IP_PMTUDISC = 0xa; IP_PMTUDISC = 0xa;
IP_PMTUDISC_DO = 0x2; IP_PMTUDISC_DO = 0x2;
IP_PMTUDISC_DONT = 0; IP_PMTUDISC_DONT = 0;
IP_PMTUDISC_PROBE = 0x3;
IP_PMTUDISC_WANT = 0x1; IP_PMTUDISC_WANT = 0x1;
IP_RECVERR = 0xb; IP_RECVERR = 0xb;
IP_RECVOPTS = 0x6; IP_RECVOPTS = 0x6;
...@@ -304,6 +316,16 @@ const ( ...@@ -304,6 +316,16 @@ const (
O_WRONLY = 0x1; O_WRONLY = 0x1;
PTRACE_ARCH_PRCTL = 0x1e; PTRACE_ARCH_PRCTL = 0x1e;
PTRACE_ATTACH = 0x10; PTRACE_ATTACH = 0x10;
PTRACE_BTS_CLEAR = 0x2c;
PTRACE_BTS_CONFIG = 0x28;
PTRACE_BTS_DRAIN = 0x2d;
PTRACE_BTS_GET = 0x2b;
PTRACE_BTS_O_ALLOC = 0x8;
PTRACE_BTS_O_SCHED = 0x2;
PTRACE_BTS_O_SIGNAL = 0x4;
PTRACE_BTS_O_TRACE = 0x1;
PTRACE_BTS_SIZE = 0x2a;
PTRACE_BTS_STATUS = 0x29;
PTRACE_CONT = 0x7; PTRACE_CONT = 0x7;
PTRACE_DETACH = 0x11; PTRACE_DETACH = 0x11;
PTRACE_EVENT_CLONE = 0x3; PTRACE_EVENT_CLONE = 0x3;
...@@ -340,9 +362,15 @@ const ( ...@@ -340,9 +362,15 @@ const (
PTRACE_SETREGS = 0xd; PTRACE_SETREGS = 0xd;
PTRACE_SETSIGINFO = 0x4203; PTRACE_SETSIGINFO = 0x4203;
PTRACE_SET_THREAD_AREA = 0x1a; PTRACE_SET_THREAD_AREA = 0x1a;
PTRACE_SINGLEBLOCK = 0x21;
PTRACE_SINGLESTEP = 0x9; PTRACE_SINGLESTEP = 0x9;
PTRACE_SYSCALL = 0x18; PTRACE_SYSCALL = 0x18;
PTRACE_SYSEMU = 0x1f;
PTRACE_SYSEMU_SINGLESTEP = 0x20;
PTRACE_TRACEME = 0; PTRACE_TRACEME = 0;
SHUT_RD = 0;
SHUT_RDWR = 0x2;
SHUT_WR = 0x1;
SIGABRT = 0x6; SIGABRT = 0x6;
SIGALRM = 0xe; SIGALRM = 0xe;
SIGBUS = 0x7; SIGBUS = 0x7;
...@@ -378,7 +406,10 @@ const ( ...@@ -378,7 +406,10 @@ const (
SIGWINCH = 0x1c; SIGWINCH = 0x1c;
SIGXCPU = 0x18; SIGXCPU = 0x18;
SIGXFSZ = 0x19; SIGXFSZ = 0x19;
SOCK_CLOEXEC = 0x80000;
SOCK_DCCP = 0x6;
SOCK_DGRAM = 0x2; SOCK_DGRAM = 0x2;
SOCK_NONBLOCK = 0x800;
SOCK_PACKET = 0xa; SOCK_PACKET = 0xa;
SOCK_RAW = 0x3; SOCK_RAW = 0x3;
SOCK_RDM = 0x4; SOCK_RDM = 0x4;
...@@ -408,6 +439,7 @@ const ( ...@@ -408,6 +439,7 @@ const (
SO_ERROR = 0x4; SO_ERROR = 0x4;
SO_KEEPALIVE = 0x9; SO_KEEPALIVE = 0x9;
SO_LINGER = 0xd; SO_LINGER = 0xd;
SO_MARK = 0x24;
SO_NO_CHECK = 0xb; SO_NO_CHECK = 0xb;
SO_OOBINLINE = 0xa; SO_OOBINLINE = 0xa;
SO_PASSCRED = 0x10; SO_PASSCRED = 0x10;
...@@ -429,6 +461,7 @@ const ( ...@@ -429,6 +461,7 @@ const (
SO_SNDLOWAT = 0x13; SO_SNDLOWAT = 0x13;
SO_SNDTIMEO = 0x15; SO_SNDTIMEO = 0x15;
SO_TIMESTAMP = 0x1d; SO_TIMESTAMP = 0x1d;
SO_TIMESTAMPING = 0x25;
SO_TIMESTAMPNS = 0x23; SO_TIMESTAMPNS = 0x23;
SO_TYPE = 0x3; SO_TYPE = 0x3;
S_BLKSIZE = 0x200; S_BLKSIZE = 0x200;
...@@ -493,133 +526,134 @@ const ( ...@@ -493,133 +526,134 @@ const (
// Error table // Error table
var errors = [...]string{ var errors = [...]string{
72: "multihop attempted", 7: "argument list too long",
49: "protocol driver not attached",
97: "address family not supported by protocol",
78: "remote address changed",
13: "permission denied", 13: "permission denied",
47: "level 3 reset", 98: "address already in use",
89: "destination address required", 99: "cannot assign requested address",
84: "invalid or incomplete multibyte or wide character", 68: "advertise error",
29: "illegal seek", 97: "address family not supported by protocol",
31: "too many links", 11: "resource temporarily unavailable",
130: "owner died", 114: "operation already in progress",
25: "inappropriate ioctl for device",
52: "invalid exchange", 52: "invalid exchange",
9: "bad file descriptor", 9: "bad file descriptor",
77: "file descriptor in bad state",
74: "bad message",
53: "invalid request descriptor", 53: "invalid request descriptor",
68: "advertise error", 56: "invalid request code",
34: "numerical result out of range", 57: "invalid slot",
59: "bad font file format",
16: "device or resource busy",
125: "operation canceled", 125: "operation canceled",
26: "text file busy",
12: "cannot allocate memory",
115: "operation now in progress",
15: "block device required",
91: "protocol wrong type for socket",
85: "interrupted system call should be restarted",
120: "is a named type file",
42: "no message of desired type",
114: "operation already in progress",
110: "connection timed out",
61: "no data available",
4: "interrupted system call",
67: "link has been severed",
1: "operation not permitted",
40: "too many levels of symbolic links",
100: "network is down",
116: "stale NFS file handle",
88: "socket operation on non-socket",
63: "out of streams resources",
10: "no child processes", 10: "no child processes",
48: "link number out of range", 44: "channel number out of range",
32: "broken pipe",
74: "bad message",
59: "bad font file format",
66: "object is remote",
109: "too many references: cannot splice",
96: "protocol family not supported",
64: "machine is not on the network",
54: "exchange full",
57: "invalid slot",
118: "not a XENIX named type file",
83: "cannot exec a shared library directly",
50: "no CSI structure available",
39: "directory not empty",
98: "address already in use",
102: "network dropped connection on reset",
21: "is a directory",
43: "identifier removed",
70: "communication error on send", 70: "communication error on send",
77: "file descriptor in bad state", 103: "software caused connection abort",
51: "level 2 halted", 111: "connection refused",
126: "required key not available",
22: "invalid argument",
108: "cannot send after transport endpoint shutdown",
129: "key was rejected by service",
81: ".lib section in a.out corrupted",
119: "no XENIX semaphores available",
60: "device not a stream",
75: "value too large for defined data type",
117: "structure needs cleaning",
123: "no medium found",
16: "device or resource busy",
71: "protocol error",
19: "no such device",
127: "key has expired",
30: "read-only file system",
79: "can not access a needed shared library",
7: "argument list too long",
35: "resource deadlock avoided",
104: "connection reset by peer", 104: "connection reset by peer",
6: "no such device or address", 35: "resource deadlock avoided",
56: "invalid request code", 89: "destination address required",
36: "file name too long", 33: "numerical argument out of domain",
94: "socket type not supported",
73: "RFS specific error", 73: "RFS specific error",
99: "cannot assign requested address",
62: "timer expired",
93: "protocol not supported",
131: "state not recoverable",
5: "input/output error",
101: "network is unreachable",
18: "invalid cross-device link",
122: "disk quota exceeded", 122: "disk quota exceeded",
121: "remote I/O error", 17: "file exists",
28: "no space left on device", 14: "bad address",
8: "exec format error",
90: "message too long",
33: "numerical argument out of domain",
27: "file too large", 27: "file too large",
3: "no such process",
44: "channel number out of range",
112: "host is down", 112: "host is down",
37: "no locks available", 113: "no route to host",
23: "too many open files in system", 43: "identifier removed",
38: "function not implemented", 84: "invalid or incomplete multibyte or wide character",
107: "transport endpoint is not connected", 115: "operation now in progress",
95: "operation not supported", 4: "interrupted system call",
69: "srmount error", 22: "invalid argument",
103: "software caused connection abort", 5: "input/output error",
55: "no anode",
106: "transport endpoint is already connected", 106: "transport endpoint is already connected",
87: "too many users", 21: "is a directory",
92: "protocol not available", 120: "is a named type file",
24: "too many open files", 127: "key has expired",
105: "no buffer space available", 129: "key was rejected by service",
128: "key has been revoked",
51: "level 2 halted",
45: "level 2 not synchronized",
46: "level 3 halted", 46: "level 3 halted",
14: "bad address", 47: "level 3 reset",
11: "resource temporarily unavailable", 79: "can not access a needed shared library",
80: "accessing a corrupted shared library", 80: "accessing a corrupted shared library",
86: "streams pipe error", 83: "cannot exec a shared library directly",
111: "connection refused",
82: "attempting to link in too many shared libraries", 82: "attempting to link in too many shared libraries",
17: "file exists", 81: ".lib section in a.out corrupted",
45: "level 2 not synchronized", 48: "link number out of range",
40: "too many levels of symbolic links",
124: "wrong medium type",
24: "too many open files",
31: "too many links",
90: "message too long",
72: "multihop attempted",
36: "file name too long",
119: "no XENIX semaphores available",
100: "network is down",
102: "network dropped connection on reset",
101: "network is unreachable",
23: "too many open files in system",
55: "no anode",
105: "no buffer space available",
50: "no CSI structure available",
61: "no data available",
19: "no such device",
2: "no such file or directory", 2: "no such file or directory",
8: "exec format error",
126: "required key not available",
37: "no locks available",
67: "link has been severed",
123: "no medium found",
12: "cannot allocate memory",
42: "no message of desired type",
64: "machine is not on the network",
65: "package not installed", 65: "package not installed",
128: "key has been revoked", 92: "protocol not available",
113: "no route to host", 28: "no space left on device",
76: "name not unique on network", 63: "out of streams resources",
60: "device not a stream",
38: "function not implemented",
15: "block device required",
107: "transport endpoint is not connected",
20: "not a directory", 20: "not a directory",
124: "wrong medium type", 39: "directory not empty",
118: "not a XENIX named type file",
131: "state not recoverable",
88: "socket operation on non-socket",
95: "operation not supported",
25: "inappropriate ioctl for device",
76: "name not unique on network",
6: "no such device or address",
75: "value too large for defined data type",
130: "owner died",
1: "operation not permitted",
96: "protocol family not supported",
32: "broken pipe",
71: "protocol error",
93: "protocol not supported",
91: "protocol wrong type for socket",
34: "numerical result out of range",
78: "remote address changed",
66: "object is remote",
121: "remote I/O error",
85: "interrupted system call should be restarted",
132: "unknown error 132",
30: "read-only file system",
108: "cannot send after transport endpoint shutdown",
94: "socket type not supported",
29: "illegal seek",
3: "no such process",
69: "srmount error",
116: "stale NFS file handle",
86: "streams pipe error",
62: "timer expired",
110: "connection timed out",
109: "too many references: cannot splice",
26: "text file busy",
117: "structure needs cleaning",
49: "protocol driver not attached",
87: "too many users",
18: "invalid cross-device link",
54: "exchange full",
} }
...@@ -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