Commit 6f686a35 authored by Tobias Klauser's avatar Tobias Klauser Committed by Tobias Klauser

unix: add ErrnoName and SignalName

Add ErrnoName and SignalName to get errno and signal name strings from
syscall.Errno and syscall.Signal values, respectively.

This repurposes the errors and signals vars (because they are not used
within x/sys/unix currently) and turns them into slices of struct,
containing errno/signal number, name and description. ErrnoName and
SignalName can then be trivially implemented using sort.Search.

Renaming errors to errorList additionaly allows to avoid package aliases
for the errors package.

Fixes golang/go#25134

Change-Id: Ie195872793f44c437f0f175ccfaa13a2546338c5
Reviewed-on: https://go-review.googlesource.com/110875
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
parent 78d5f264
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
package unix package unix
import ( import (
errorspkg "errors" "errors"
"fmt" "fmt"
) )
...@@ -60,26 +60,26 @@ func CapRightsSet(rights *CapRights, setrights []uint64) error { ...@@ -60,26 +60,26 @@ func CapRightsSet(rights *CapRights, setrights []uint64) error {
n := caparsize(rights) n := caparsize(rights)
if n < capArSizeMin || n > capArSizeMax { if n < capArSizeMin || n > capArSizeMax {
return errorspkg.New("bad rights size") return errors.New("bad rights size")
} }
for _, right := range setrights { for _, right := range setrights {
if caprver(right) != CAP_RIGHTS_VERSION_00 { if caprver(right) != CAP_RIGHTS_VERSION_00 {
return errorspkg.New("bad right version") return errors.New("bad right version")
} }
i, err := rightToIndex(right) i, err := rightToIndex(right)
if err != nil { if err != nil {
return err return err
} }
if i >= n { if i >= n {
return errorspkg.New("index overflow") return errors.New("index overflow")
} }
if capidxbit(rights.Rights[i]) != capidxbit(right) { if capidxbit(rights.Rights[i]) != capidxbit(right) {
return errorspkg.New("index mismatch") return errors.New("index mismatch")
} }
rights.Rights[i] |= right rights.Rights[i] |= right
if capidxbit(rights.Rights[i]) != capidxbit(right) { if capidxbit(rights.Rights[i]) != capidxbit(right) {
return errorspkg.New("index mismatch (after assign)") return errors.New("index mismatch (after assign)")
} }
} }
...@@ -95,26 +95,26 @@ func CapRightsClear(rights *CapRights, clearrights []uint64) error { ...@@ -95,26 +95,26 @@ func CapRightsClear(rights *CapRights, clearrights []uint64) error {
n := caparsize(rights) n := caparsize(rights)
if n < capArSizeMin || n > capArSizeMax { if n < capArSizeMin || n > capArSizeMax {
return errorspkg.New("bad rights size") return errors.New("bad rights size")
} }
for _, right := range clearrights { for _, right := range clearrights {
if caprver(right) != CAP_RIGHTS_VERSION_00 { if caprver(right) != CAP_RIGHTS_VERSION_00 {
return errorspkg.New("bad right version") return errors.New("bad right version")
} }
i, err := rightToIndex(right) i, err := rightToIndex(right)
if err != nil { if err != nil {
return err return err
} }
if i >= n { if i >= n {
return errorspkg.New("index overflow") return errors.New("index overflow")
} }
if capidxbit(rights.Rights[i]) != capidxbit(right) { if capidxbit(rights.Rights[i]) != capidxbit(right) {
return errorspkg.New("index mismatch") return errors.New("index mismatch")
} }
rights.Rights[i] &= ^(right & 0x01FFFFFFFFFFFFFF) rights.Rights[i] &= ^(right & 0x01FFFFFFFFFFFFFF)
if capidxbit(rights.Rights[i]) != capidxbit(right) { if capidxbit(rights.Rights[i]) != capidxbit(right) {
return errorspkg.New("index mismatch (after assign)") return errors.New("index mismatch (after assign)")
} }
} }
...@@ -130,22 +130,22 @@ func CapRightsIsSet(rights *CapRights, setrights []uint64) (bool, error) { ...@@ -130,22 +130,22 @@ func CapRightsIsSet(rights *CapRights, setrights []uint64) (bool, error) {
n := caparsize(rights) n := caparsize(rights)
if n < capArSizeMin || n > capArSizeMax { if n < capArSizeMin || n > capArSizeMax {
return false, errorspkg.New("bad rights size") return false, errors.New("bad rights size")
} }
for _, right := range setrights { for _, right := range setrights {
if caprver(right) != CAP_RIGHTS_VERSION_00 { if caprver(right) != CAP_RIGHTS_VERSION_00 {
return false, errorspkg.New("bad right version") return false, errors.New("bad right version")
} }
i, err := rightToIndex(right) i, err := rightToIndex(right)
if err != nil { if err != nil {
return false, err return false, err
} }
if i >= n { if i >= n {
return false, errorspkg.New("index overflow") return false, errors.New("index overflow")
} }
if capidxbit(rights.Rights[i]) != capidxbit(right) { if capidxbit(rights.Rights[i]) != capidxbit(right) {
return false, errorspkg.New("index mismatch") return false, errors.New("index mismatch")
} }
if (rights.Rights[i] & right) != right { if (rights.Rights[i] & right) != right {
return false, nil return false, nil
......
...@@ -507,21 +507,26 @@ echo ')' ...@@ -507,21 +507,26 @@ echo ')'
enum { A = 'A', Z = 'Z', a = 'a', z = 'z' }; // avoid need for single quotes below enum { A = 'A', Z = 'Z', a = 'a', z = 'z' }; // avoid need for single quotes below
int errors[] = { struct tuple {
int num;
const char *name;
};
struct tuple errors[] = {
" "
for i in $errors for i in $errors
do do
echo -E ' '$i, echo -E ' {'$i', "'$i'" },'
done done
echo -E " echo -E "
}; };
int signals[] = { struct tuple signals[] = {
" "
for i in $signals for i in $signals
do do
echo -E ' '$i, echo -E ' {'$i', "'$i'" },'
done done
# Use -E because on some systems bash builtin interprets \n itself. # Use -E because on some systems bash builtin interprets \n itself.
...@@ -529,9 +534,9 @@ int signals[] = { ...@@ -529,9 +534,9 @@ int signals[] = {
}; };
static int static int
intcmp(const void *a, const void *b) tuplecmp(const void *a, const void *b)
{ {
return *(int*)a - *(int*)b; return ((struct tuple *)a)->num - ((struct tuple *)b)->num;
} }
int int
...@@ -541,26 +546,34 @@ main(void) ...@@ -541,26 +546,34 @@ main(void)
char buf[1024], *p; char buf[1024], *p;
printf("\n\n// Error table\n"); printf("\n\n// Error table\n");
printf("var errors = [...]string {\n"); printf("var errorList = [...]struct {\n");
qsort(errors, nelem(errors), sizeof errors[0], intcmp); printf("\tnum syscall.Errno\n");
printf("\tname string\n");
printf("\tdesc string\n");
printf("} {\n");
qsort(errors, nelem(errors), sizeof errors[0], tuplecmp);
for(i=0; i<nelem(errors); i++) { for(i=0; i<nelem(errors); i++) {
e = errors[i]; e = errors[i].num;
if(i > 0 && errors[i-1] == e) if(i > 0 && errors[i-1].num == e)
continue; continue;
strcpy(buf, strerror(e)); strcpy(buf, strerror(e));
// lowercase first letter: Bad -> bad, but STREAM -> STREAM. // lowercase first letter: Bad -> bad, but STREAM -> STREAM.
if(A <= buf[0] && buf[0] <= Z && a <= buf[1] && buf[1] <= z) if(A <= buf[0] && buf[0] <= Z && a <= buf[1] && buf[1] <= z)
buf[0] += a - A; buf[0] += a - A;
printf("\t%d: \"%s\",\n", e, buf); printf("\t{ %d, \"%s\", \"%s\" },\n", e, errors[i].name, buf);
} }
printf("}\n\n"); printf("}\n\n");
printf("\n\n// Signal table\n"); printf("\n\n// Signal table\n");
printf("var signals = [...]string {\n"); printf("var signalList = [...]struct {\n");
qsort(signals, nelem(signals), sizeof signals[0], intcmp); printf("\tnum syscall.Signal\n");
printf("\tname string\n");
printf("\tdesc string\n");
printf("} {\n");
qsort(signals, nelem(signals), sizeof signals[0], tuplecmp);
for(i=0; i<nelem(signals); i++) { for(i=0; i<nelem(signals); i++) {
e = signals[i]; e = signals[i].num;
if(i > 0 && signals[i-1] == e) if(i > 0 && signals[i-1].num == e)
continue; continue;
strcpy(buf, strsignal(e)); strcpy(buf, strsignal(e));
// lowercase first letter: Bad -> bad, but STREAM -> STREAM. // lowercase first letter: Bad -> bad, but STREAM -> STREAM.
...@@ -570,7 +583,7 @@ main(void) ...@@ -570,7 +583,7 @@ main(void)
p = strrchr(buf, ":"[0]); p = strrchr(buf, ":"[0]);
if(p) if(p)
*p = '\0'; *p = '\0';
printf("\t%d: \"%s\",\n", e, buf); printf("\t{ %d, \"%s\", \"%s\" },\n", e, signals[i].name, buf);
} }
printf("}\n\n"); printf("}\n\n");
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
package unix package unix
import ( import (
errorspkg "errors" "errors"
"syscall" "syscall"
"unsafe" "unsafe"
) )
...@@ -98,7 +98,7 @@ type attrList struct { ...@@ -98,7 +98,7 @@ type attrList struct {
func getAttrList(path string, attrList attrList, attrBuf []byte, options uint) (attrs [][]byte, err error) { func getAttrList(path string, attrList attrList, attrBuf []byte, options uint) (attrs [][]byte, err error) {
if len(attrBuf) < 4 { if len(attrBuf) < 4 {
return nil, errorspkg.New("attrBuf too small") return nil, errors.New("attrBuf too small")
} }
attrList.bitmapCount = attrBitMapCount attrList.bitmapCount = attrBitMapCount
...@@ -134,12 +134,12 @@ func getAttrList(path string, attrList attrList, attrBuf []byte, options uint) ( ...@@ -134,12 +134,12 @@ func getAttrList(path string, attrList attrList, attrBuf []byte, options uint) (
for i := uint32(0); int(i) < len(dat); { for i := uint32(0); int(i) < len(dat); {
header := dat[i:] header := dat[i:]
if len(header) < 8 { if len(header) < 8 {
return attrs, errorspkg.New("truncated attribute header") return attrs, errors.New("truncated attribute header")
} }
datOff := *(*int32)(unsafe.Pointer(&header[0])) datOff := *(*int32)(unsafe.Pointer(&header[0]))
attrLen := *(*uint32)(unsafe.Pointer(&header[4])) attrLen := *(*uint32)(unsafe.Pointer(&header[4]))
if datOff < 0 || uint32(datOff)+attrLen > uint32(len(dat)) { if datOff < 0 || uint32(datOff)+attrLen > uint32(len(dat)) {
return attrs, errorspkg.New("truncated results; attrBuf too small") return attrs, errors.New("truncated results; attrBuf too small")
} }
end := uint32(datOff) + attrLen end := uint32(datOff) + attrLen
attrs = append(attrs, dat[datOff:end]) attrs = append(attrs, dat[datOff:end])
......
...@@ -9,6 +9,7 @@ package unix ...@@ -9,6 +9,7 @@ package unix
import ( import (
"bytes" "bytes"
"runtime" "runtime"
"sort"
"sync" "sync"
"syscall" "syscall"
"unsafe" "unsafe"
...@@ -51,6 +52,28 @@ func errnoErr(e syscall.Errno) error { ...@@ -51,6 +52,28 @@ func errnoErr(e syscall.Errno) error {
return e return e
} }
// ErrnoName returns the error name for error number e.
func ErrnoName(e syscall.Errno) string {
i := sort.Search(len(errorList), func(i int) bool {
return errorList[i].num >= e
})
if i < len(errorList) && errorList[i].num == e {
return errorList[i].name
}
return ""
}
// SignalName returns the signal name for signal number s.
func SignalName(s syscall.Signal) string {
i := sort.Search(len(signalList), func(i int) bool {
return signalList[i].num >= s
})
if i < len(signalList) && signalList[i].num == s {
return signalList[i].name
}
return ""
}
// clen returns the index of the first NULL byte in n or len(n) if n contains no NULL byte. // clen returns the index of the first NULL byte in n or len(n) if n contains no NULL byte.
func clen(n []byte) int { func clen(n []byte) int {
i := bytes.IndexByte(n, 0) i := bytes.IndexByte(n, 0)
......
...@@ -15,6 +15,7 @@ import ( ...@@ -15,6 +15,7 @@ import (
"os/exec" "os/exec"
"path/filepath" "path/filepath"
"runtime" "runtime"
"syscall"
"testing" "testing"
"time" "time"
...@@ -59,6 +60,44 @@ func _() { ...@@ -59,6 +60,44 @@ func _() {
) )
} }
func TestErrnoSignalName(t *testing.T) {
testErrors := []struct {
num syscall.Errno
name string
}{
{syscall.EPERM, "EPERM"},
{syscall.EINVAL, "EINVAL"},
{syscall.ENOENT, "ENOENT"},
}
for _, te := range testErrors {
t.Run(fmt.Sprintf("%d/%s", te.num, te.name), func(t *testing.T) {
e := unix.ErrnoName(te.num)
if e != te.name {
t.Errorf("ErrnoName(%d) returned %s, want %s", te.num, e, te.name)
}
})
}
testSignals := []struct {
num syscall.Signal
name string
}{
{syscall.SIGHUP, "SIGHUP"},
{syscall.SIGPIPE, "SIGPIPE"},
{syscall.SIGSEGV, "SIGSEGV"},
}
for _, ts := range testSignals {
t.Run(fmt.Sprintf("%d/%s", ts.num, ts.name), func(t *testing.T) {
s := unix.SignalName(ts.num)
if s != ts.name {
t.Errorf("SignalName(%d) returned %s, want %s", ts.num, s, ts.name)
}
})
}
}
// TestFcntlFlock tests whether the file locking structure matches // TestFcntlFlock tests whether the file locking structure matches
// the calling convention of each kernel. // the calling convention of each kernel.
func TestFcntlFlock(t *testing.T) { func TestFcntlFlock(t *testing.T) {
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -1437,142 +1437,150 @@ const ( ...@@ -1437,142 +1437,150 @@ const (
) )
// Error table // Error table
var errors = [...]string{ var errorList = [...]struct {
1: "operation not permitted", num syscall.Errno
2: "no such file or directory", name string
3: "no such process", desc string
4: "interrupted system call", }{
5: "input/output error", {1, "EPERM", "operation not permitted"},
6: "device not configured", {2, "ENOENT", "no such file or directory"},
7: "argument list too long", {3, "ESRCH", "no such process"},
8: "exec format error", {4, "EINTR", "interrupted system call"},
9: "bad file descriptor", {5, "EIO", "input/output error"},
10: "no child processes", {6, "ENXIO", "device not configured"},
11: "resource deadlock avoided", {7, "E2BIG", "argument list too long"},
12: "cannot allocate memory", {8, "ENOEXEC", "exec format error"},
13: "permission denied", {9, "EBADF", "bad file descriptor"},
14: "bad address", {10, "ECHILD", "no child processes"},
15: "block device required", {11, "EDEADLK", "resource deadlock avoided"},
16: "device busy", {12, "ENOMEM", "cannot allocate memory"},
17: "file exists", {13, "EACCES", "permission denied"},
18: "cross-device link", {14, "EFAULT", "bad address"},
19: "operation not supported by device", {15, "ENOTBLK", "block device required"},
20: "not a directory", {16, "EBUSY", "device busy"},
21: "is a directory", {17, "EEXIST", "file exists"},
22: "invalid argument", {18, "EXDEV", "cross-device link"},
23: "too many open files in system", {19, "ENODEV", "operation not supported by device"},
24: "too many open files", {20, "ENOTDIR", "not a directory"},
25: "inappropriate ioctl for device", {21, "EISDIR", "is a directory"},
26: "text file busy", {22, "EINVAL", "invalid argument"},
27: "file too large", {23, "ENFILE", "too many open files in system"},
28: "no space left on device", {24, "EMFILE", "too many open files"},
29: "illegal seek", {25, "ENOTTY", "inappropriate ioctl for device"},
30: "read-only file system", {26, "ETXTBSY", "text file busy"},
31: "too many links", {27, "EFBIG", "file too large"},
32: "broken pipe", {28, "ENOSPC", "no space left on device"},
33: "numerical argument out of domain", {29, "ESPIPE", "illegal seek"},
34: "result too large", {30, "EROFS", "read-only file system"},
35: "resource temporarily unavailable", {31, "EMLINK", "too many links"},
36: "operation now in progress", {32, "EPIPE", "broken pipe"},
37: "operation already in progress", {33, "EDOM", "numerical argument out of domain"},
38: "socket operation on non-socket", {34, "ERANGE", "result too large"},
39: "destination address required", {35, "EWOULDBLOCK", "resource temporarily unavailable"},
40: "message too long", {36, "EINPROGRESS", "operation now in progress"},
41: "protocol wrong type for socket", {37, "EALREADY", "operation already in progress"},
42: "protocol not available", {38, "ENOTSOCK", "socket operation on non-socket"},
43: "protocol not supported", {39, "EDESTADDRREQ", "destination address required"},
44: "socket type not supported", {40, "EMSGSIZE", "message too long"},
45: "operation not supported", {41, "EPROTOTYPE", "protocol wrong type for socket"},
46: "protocol family not supported", {42, "ENOPROTOOPT", "protocol not available"},
47: "address family not supported by protocol family", {43, "EPROTONOSUPPORT", "protocol not supported"},
48: "address already in use", {44, "ESOCKTNOSUPPORT", "socket type not supported"},
49: "can't assign requested address", {45, "EOPNOTSUPP", "operation not supported"},
50: "network is down", {46, "EPFNOSUPPORT", "protocol family not supported"},
51: "network is unreachable", {47, "EAFNOSUPPORT", "address family not supported by protocol family"},
52: "network dropped connection on reset", {48, "EADDRINUSE", "address already in use"},
53: "software caused connection abort", {49, "EADDRNOTAVAIL", "can't assign requested address"},
54: "connection reset by peer", {50, "ENETDOWN", "network is down"},
55: "no buffer space available", {51, "ENETUNREACH", "network is unreachable"},
56: "socket is already connected", {52, "ENETRESET", "network dropped connection on reset"},
57: "socket is not connected", {53, "ECONNABORTED", "software caused connection abort"},
58: "can't send after socket shutdown", {54, "ECONNRESET", "connection reset by peer"},
59: "too many references: can't splice", {55, "ENOBUFS", "no buffer space available"},
60: "operation timed out", {56, "EISCONN", "socket is already connected"},
61: "connection refused", {57, "ENOTCONN", "socket is not connected"},
62: "too many levels of symbolic links", {58, "ESHUTDOWN", "can't send after socket shutdown"},
63: "file name too long", {59, "ETOOMANYREFS", "too many references: can't splice"},
64: "host is down", {60, "ETIMEDOUT", "operation timed out"},
65: "no route to host", {61, "ECONNREFUSED", "connection refused"},
66: "directory not empty", {62, "ELOOP", "too many levels of symbolic links"},
67: "too many processes", {63, "ENAMETOOLONG", "file name too long"},
68: "too many users", {64, "EHOSTDOWN", "host is down"},
69: "disc quota exceeded", {65, "EHOSTUNREACH", "no route to host"},
70: "stale NFS file handle", {66, "ENOTEMPTY", "directory not empty"},
71: "too many levels of remote in path", {67, "EPROCLIM", "too many processes"},
72: "RPC struct is bad", {68, "EUSERS", "too many users"},
73: "RPC version wrong", {69, "EDQUOT", "disc quota exceeded"},
74: "RPC prog. not avail", {70, "ESTALE", "stale NFS file handle"},
75: "program version wrong", {71, "EREMOTE", "too many levels of remote in path"},
76: "bad procedure for program", {72, "EBADRPC", "RPC struct is bad"},
77: "no locks available", {73, "ERPCMISMATCH", "RPC version wrong"},
78: "function not implemented", {74, "EPROGUNAVAIL", "RPC prog. not avail"},
79: "inappropriate file type or format", {75, "EPROGMISMATCH", "program version wrong"},
80: "authentication error", {76, "EPROCUNAVAIL", "bad procedure for program"},
81: "need authenticator", {77, "ENOLCK", "no locks available"},
82: "identifier removed", {78, "ENOSYS", "function not implemented"},
83: "no message of desired type", {79, "EFTYPE", "inappropriate file type or format"},
84: "value too large to be stored in data type", {80, "EAUTH", "authentication error"},
85: "operation canceled", {81, "ENEEDAUTH", "need authenticator"},
86: "illegal byte sequence", {82, "EIDRM", "identifier removed"},
87: "attribute not found", {83, "ENOMSG", "no message of desired type"},
88: "programming error", {84, "EOVERFLOW", "value too large to be stored in data type"},
89: "bad message", {85, "ECANCELED", "operation canceled"},
90: "multihop attempted", {86, "EILSEQ", "illegal byte sequence"},
91: "link has been severed", {87, "ENOATTR", "attribute not found"},
92: "protocol error", {88, "EDOOFUS", "programming error"},
93: "no medium found", {89, "EBADMSG", "bad message"},
94: "unknown error: 94", {90, "EMULTIHOP", "multihop attempted"},
95: "unknown error: 95", {91, "ENOLINK", "link has been severed"},
96: "unknown error: 96", {92, "EPROTO", "protocol error"},
97: "unknown error: 97", {93, "ENOMEDIUM", "no medium found"},
98: "unknown error: 98", {94, "EUNUSED94", "unknown error: 94"},
99: "unknown error: 99", {95, "EUNUSED95", "unknown error: 95"},
{96, "EUNUSED96", "unknown error: 96"},
{97, "EUNUSED97", "unknown error: 97"},
{98, "EUNUSED98", "unknown error: 98"},
{99, "ELAST", "unknown error: 99"},
} }
// Signal table // Signal table
var signals = [...]string{ var signalList = [...]struct {
1: "hangup", num syscall.Signal
2: "interrupt", name string
3: "quit", desc string
4: "illegal instruction", }{
5: "trace/BPT trap", {1, "SIGHUP", "hangup"},
6: "abort trap", {2, "SIGINT", "interrupt"},
7: "EMT trap", {3, "SIGQUIT", "quit"},
8: "floating point exception", {4, "SIGILL", "illegal instruction"},
9: "killed", {5, "SIGTRAP", "trace/BPT trap"},
10: "bus error", {6, "SIGIOT", "abort trap"},
11: "segmentation fault", {7, "SIGEMT", "EMT trap"},
12: "bad system call", {8, "SIGFPE", "floating point exception"},
13: "broken pipe", {9, "SIGKILL", "killed"},
14: "alarm clock", {10, "SIGBUS", "bus error"},
15: "terminated", {11, "SIGSEGV", "segmentation fault"},
16: "urgent I/O condition", {12, "SIGSYS", "bad system call"},
17: "suspended (signal)", {13, "SIGPIPE", "broken pipe"},
18: "suspended", {14, "SIGALRM", "alarm clock"},
19: "continued", {15, "SIGTERM", "terminated"},
20: "child exited", {16, "SIGURG", "urgent I/O condition"},
21: "stopped (tty input)", {17, "SIGSTOP", "suspended (signal)"},
22: "stopped (tty output)", {18, "SIGTSTP", "suspended"},
23: "I/O possible", {19, "SIGCONT", "continued"},
24: "cputime limit exceeded", {20, "SIGCHLD", "child exited"},
25: "filesize limit exceeded", {21, "SIGTTIN", "stopped (tty input)"},
26: "virtual timer expired", {22, "SIGTTOU", "stopped (tty output)"},
27: "profiling timer expired", {23, "SIGIO", "I/O possible"},
28: "window size changes", {24, "SIGXCPU", "cputime limit exceeded"},
29: "information request", {25, "SIGXFSZ", "filesize limit exceeded"},
30: "user defined signal 1", {26, "SIGVTALRM", "virtual timer expired"},
31: "user defined signal 2", {27, "SIGPROF", "profiling timer expired"},
32: "thread Scheduler", {28, "SIGWINCH", "window size changes"},
33: "checkPoint", {29, "SIGINFO", "information request"},
34: "checkPointExit", {30, "SIGUSR1", "user defined signal 1"},
{31, "SIGUSR2", "user defined signal 2"},
{32, "SIGTHR", "thread Scheduler"},
{33, "SIGCKPT", "checkPoint"},
{34, "SIGCKPTEXIT", "checkPointExit"},
} }
...@@ -1619,138 +1619,146 @@ const ( ...@@ -1619,138 +1619,146 @@ const (
) )
// Error table // Error table
var errors = [...]string{ var errorList = [...]struct {
1: "operation not permitted", num syscall.Errno
2: "no such file or directory", name string
3: "no such process", desc string
4: "interrupted system call", }{
5: "input/output error", {1, "EPERM", "operation not permitted"},
6: "device not configured", {2, "ENOENT", "no such file or directory"},
7: "argument list too long", {3, "ESRCH", "no such process"},
8: "exec format error", {4, "EINTR", "interrupted system call"},
9: "bad file descriptor", {5, "EIO", "input/output error"},
10: "no child processes", {6, "ENXIO", "device not configured"},
11: "resource deadlock avoided", {7, "E2BIG", "argument list too long"},
12: "cannot allocate memory", {8, "ENOEXEC", "exec format error"},
13: "permission denied", {9, "EBADF", "bad file descriptor"},
14: "bad address", {10, "ECHILD", "no child processes"},
15: "block device required", {11, "EDEADLK", "resource deadlock avoided"},
16: "device busy", {12, "ENOMEM", "cannot allocate memory"},
17: "file exists", {13, "EACCES", "permission denied"},
18: "cross-device link", {14, "EFAULT", "bad address"},
19: "operation not supported by device", {15, "ENOTBLK", "block device required"},
20: "not a directory", {16, "EBUSY", "device busy"},
21: "is a directory", {17, "EEXIST", "file exists"},
22: "invalid argument", {18, "EXDEV", "cross-device link"},
23: "too many open files in system", {19, "ENODEV", "operation not supported by device"},
24: "too many open files", {20, "ENOTDIR", "not a directory"},
25: "inappropriate ioctl for device", {21, "EISDIR", "is a directory"},
26: "text file busy", {22, "EINVAL", "invalid argument"},
27: "file too large", {23, "ENFILE", "too many open files in system"},
28: "no space left on device", {24, "EMFILE", "too many open files"},
29: "illegal seek", {25, "ENOTTY", "inappropriate ioctl for device"},
30: "read-only file system", {26, "ETXTBSY", "text file busy"},
31: "too many links", {27, "EFBIG", "file too large"},
32: "broken pipe", {28, "ENOSPC", "no space left on device"},
33: "numerical argument out of domain", {29, "ESPIPE", "illegal seek"},
34: "result too large", {30, "EROFS", "read-only file system"},
35: "resource temporarily unavailable", {31, "EMLINK", "too many links"},
36: "operation now in progress", {32, "EPIPE", "broken pipe"},
37: "operation already in progress", {33, "EDOM", "numerical argument out of domain"},
38: "socket operation on non-socket", {34, "ERANGE", "result too large"},
39: "destination address required", {35, "EAGAIN", "resource temporarily unavailable"},
40: "message too long", {36, "EINPROGRESS", "operation now in progress"},
41: "protocol wrong type for socket", {37, "EALREADY", "operation already in progress"},
42: "protocol not available", {38, "ENOTSOCK", "socket operation on non-socket"},
43: "protocol not supported", {39, "EDESTADDRREQ", "destination address required"},
44: "socket type not supported", {40, "EMSGSIZE", "message too long"},
45: "operation not supported", {41, "EPROTOTYPE", "protocol wrong type for socket"},
46: "protocol family not supported", {42, "ENOPROTOOPT", "protocol not available"},
47: "address family not supported by protocol family", {43, "EPROTONOSUPPORT", "protocol not supported"},
48: "address already in use", {44, "ESOCKTNOSUPPORT", "socket type not supported"},
49: "can't assign requested address", {45, "EOPNOTSUPP", "operation not supported"},
50: "network is down", {46, "EPFNOSUPPORT", "protocol family not supported"},
51: "network is unreachable", {47, "EAFNOSUPPORT", "address family not supported by protocol family"},
52: "network dropped connection on reset", {48, "EADDRINUSE", "address already in use"},
53: "software caused connection abort", {49, "EADDRNOTAVAIL", "can't assign requested address"},
54: "connection reset by peer", {50, "ENETDOWN", "network is down"},
55: "no buffer space available", {51, "ENETUNREACH", "network is unreachable"},
56: "socket is already connected", {52, "ENETRESET", "network dropped connection on reset"},
57: "socket is not connected", {53, "ECONNABORTED", "software caused connection abort"},
58: "can't send after socket shutdown", {54, "ECONNRESET", "connection reset by peer"},
59: "too many references: can't splice", {55, "ENOBUFS", "no buffer space available"},
60: "operation timed out", {56, "EISCONN", "socket is already connected"},
61: "connection refused", {57, "ENOTCONN", "socket is not connected"},
62: "too many levels of symbolic links", {58, "ESHUTDOWN", "can't send after socket shutdown"},
63: "file name too long", {59, "ETOOMANYREFS", "too many references: can't splice"},
64: "host is down", {60, "ETIMEDOUT", "operation timed out"},
65: "no route to host", {61, "ECONNREFUSED", "connection refused"},
66: "directory not empty", {62, "ELOOP", "too many levels of symbolic links"},
67: "too many processes", {63, "ENAMETOOLONG", "file name too long"},
68: "too many users", {64, "EHOSTDOWN", "host is down"},
69: "disc quota exceeded", {65, "EHOSTUNREACH", "no route to host"},
70: "stale NFS file handle", {66, "ENOTEMPTY", "directory not empty"},
71: "too many levels of remote in path", {67, "EPROCLIM", "too many processes"},
72: "RPC struct is bad", {68, "EUSERS", "too many users"},
73: "RPC version wrong", {69, "EDQUOT", "disc quota exceeded"},
74: "RPC prog. not avail", {70, "ESTALE", "stale NFS file handle"},
75: "program version wrong", {71, "EREMOTE", "too many levels of remote in path"},
76: "bad procedure for program", {72, "EBADRPC", "RPC struct is bad"},
77: "no locks available", {73, "ERPCMISMATCH", "RPC version wrong"},
78: "function not implemented", {74, "EPROGUNAVAIL", "RPC prog. not avail"},
79: "inappropriate file type or format", {75, "EPROGMISMATCH", "program version wrong"},
80: "authentication error", {76, "EPROCUNAVAIL", "bad procedure for program"},
81: "need authenticator", {77, "ENOLCK", "no locks available"},
82: "identifier removed", {78, "ENOSYS", "function not implemented"},
83: "no message of desired type", {79, "EFTYPE", "inappropriate file type or format"},
84: "value too large to be stored in data type", {80, "EAUTH", "authentication error"},
85: "operation canceled", {81, "ENEEDAUTH", "need authenticator"},
86: "illegal byte sequence", {82, "EIDRM", "identifier removed"},
87: "attribute not found", {83, "ENOMSG", "no message of desired type"},
88: "programming error", {84, "EOVERFLOW", "value too large to be stored in data type"},
89: "bad message", {85, "ECANCELED", "operation canceled"},
90: "multihop attempted", {86, "EILSEQ", "illegal byte sequence"},
91: "link has been severed", {87, "ENOATTR", "attribute not found"},
92: "protocol error", {88, "EDOOFUS", "programming error"},
93: "capabilities insufficient", {89, "EBADMSG", "bad message"},
94: "not permitted in capability mode", {90, "EMULTIHOP", "multihop attempted"},
95: "state not recoverable", {91, "ENOLINK", "link has been severed"},
96: "previous owner died", {92, "EPROTO", "protocol error"},
{93, "ENOTCAPABLE", "capabilities insufficient"},
{94, "ECAPMODE", "not permitted in capability mode"},
{95, "ENOTRECOVERABLE", "state not recoverable"},
{96, "EOWNERDEAD", "previous owner died"},
} }
// Signal table // Signal table
var signals = [...]string{ var signalList = [...]struct {
1: "hangup", num syscall.Signal
2: "interrupt", name string
3: "quit", desc string
4: "illegal instruction", }{
5: "trace/BPT trap", {1, "SIGHUP", "hangup"},
6: "abort trap", {2, "SIGINT", "interrupt"},
7: "EMT trap", {3, "SIGQUIT", "quit"},
8: "floating point exception", {4, "SIGILL", "illegal instruction"},
9: "killed", {5, "SIGTRAP", "trace/BPT trap"},
10: "bus error", {6, "SIGIOT", "abort trap"},
11: "segmentation fault", {7, "SIGEMT", "EMT trap"},
12: "bad system call", {8, "SIGFPE", "floating point exception"},
13: "broken pipe", {9, "SIGKILL", "killed"},
14: "alarm clock", {10, "SIGBUS", "bus error"},
15: "terminated", {11, "SIGSEGV", "segmentation fault"},
16: "urgent I/O condition", {12, "SIGSYS", "bad system call"},
17: "suspended (signal)", {13, "SIGPIPE", "broken pipe"},
18: "suspended", {14, "SIGALRM", "alarm clock"},
19: "continued", {15, "SIGTERM", "terminated"},
20: "child exited", {16, "SIGURG", "urgent I/O condition"},
21: "stopped (tty input)", {17, "SIGSTOP", "suspended (signal)"},
22: "stopped (tty output)", {18, "SIGTSTP", "suspended"},
23: "I/O possible", {19, "SIGCONT", "continued"},
24: "cputime limit exceeded", {20, "SIGCHLD", "child exited"},
25: "filesize limit exceeded", {21, "SIGTTIN", "stopped (tty input)"},
26: "virtual timer expired", {22, "SIGTTOU", "stopped (tty output)"},
27: "profiling timer expired", {23, "SIGIO", "I/O possible"},
28: "window size changes", {24, "SIGXCPU", "cputime limit exceeded"},
29: "information request", {25, "SIGXFSZ", "filesize limit exceeded"},
30: "user defined signal 1", {26, "SIGVTALRM", "virtual timer expired"},
31: "user defined signal 2", {27, "SIGPROF", "profiling timer expired"},
32: "unknown signal", {28, "SIGWINCH", "window size changes"},
33: "unknown signal", {29, "SIGINFO", "information request"},
{30, "SIGUSR1", "user defined signal 1"},
{31, "SIGUSR2", "user defined signal 2"},
{32, "SIGTHR", "unknown signal"},
{33, "SIGLIBRT", "unknown signal"},
} }
...@@ -1620,138 +1620,146 @@ const ( ...@@ -1620,138 +1620,146 @@ const (
) )
// Error table // Error table
var errors = [...]string{ var errorList = [...]struct {
1: "operation not permitted", num syscall.Errno
2: "no such file or directory", name string
3: "no such process", desc string
4: "interrupted system call", }{
5: "input/output error", {1, "EPERM", "operation not permitted"},
6: "device not configured", {2, "ENOENT", "no such file or directory"},
7: "argument list too long", {3, "ESRCH", "no such process"},
8: "exec format error", {4, "EINTR", "interrupted system call"},
9: "bad file descriptor", {5, "EIO", "input/output error"},
10: "no child processes", {6, "ENXIO", "device not configured"},
11: "resource deadlock avoided", {7, "E2BIG", "argument list too long"},
12: "cannot allocate memory", {8, "ENOEXEC", "exec format error"},
13: "permission denied", {9, "EBADF", "bad file descriptor"},
14: "bad address", {10, "ECHILD", "no child processes"},
15: "block device required", {11, "EDEADLK", "resource deadlock avoided"},
16: "device busy", {12, "ENOMEM", "cannot allocate memory"},
17: "file exists", {13, "EACCES", "permission denied"},
18: "cross-device link", {14, "EFAULT", "bad address"},
19: "operation not supported by device", {15, "ENOTBLK", "block device required"},
20: "not a directory", {16, "EBUSY", "device busy"},
21: "is a directory", {17, "EEXIST", "file exists"},
22: "invalid argument", {18, "EXDEV", "cross-device link"},
23: "too many open files in system", {19, "ENODEV", "operation not supported by device"},
24: "too many open files", {20, "ENOTDIR", "not a directory"},
25: "inappropriate ioctl for device", {21, "EISDIR", "is a directory"},
26: "text file busy", {22, "EINVAL", "invalid argument"},
27: "file too large", {23, "ENFILE", "too many open files in system"},
28: "no space left on device", {24, "EMFILE", "too many open files"},
29: "illegal seek", {25, "ENOTTY", "inappropriate ioctl for device"},
30: "read-only file system", {26, "ETXTBSY", "text file busy"},
31: "too many links", {27, "EFBIG", "file too large"},
32: "broken pipe", {28, "ENOSPC", "no space left on device"},
33: "numerical argument out of domain", {29, "ESPIPE", "illegal seek"},
34: "result too large", {30, "EROFS", "read-only file system"},
35: "resource temporarily unavailable", {31, "EMLINK", "too many links"},
36: "operation now in progress", {32, "EPIPE", "broken pipe"},
37: "operation already in progress", {33, "EDOM", "numerical argument out of domain"},
38: "socket operation on non-socket", {34, "ERANGE", "result too large"},
39: "destination address required", {35, "EAGAIN", "resource temporarily unavailable"},
40: "message too long", {36, "EINPROGRESS", "operation now in progress"},
41: "protocol wrong type for socket", {37, "EALREADY", "operation already in progress"},
42: "protocol not available", {38, "ENOTSOCK", "socket operation on non-socket"},
43: "protocol not supported", {39, "EDESTADDRREQ", "destination address required"},
44: "socket type not supported", {40, "EMSGSIZE", "message too long"},
45: "operation not supported", {41, "EPROTOTYPE", "protocol wrong type for socket"},
46: "protocol family not supported", {42, "ENOPROTOOPT", "protocol not available"},
47: "address family not supported by protocol family", {43, "EPROTONOSUPPORT", "protocol not supported"},
48: "address already in use", {44, "ESOCKTNOSUPPORT", "socket type not supported"},
49: "can't assign requested address", {45, "EOPNOTSUPP", "operation not supported"},
50: "network is down", {46, "EPFNOSUPPORT", "protocol family not supported"},
51: "network is unreachable", {47, "EAFNOSUPPORT", "address family not supported by protocol family"},
52: "network dropped connection on reset", {48, "EADDRINUSE", "address already in use"},
53: "software caused connection abort", {49, "EADDRNOTAVAIL", "can't assign requested address"},
54: "connection reset by peer", {50, "ENETDOWN", "network is down"},
55: "no buffer space available", {51, "ENETUNREACH", "network is unreachable"},
56: "socket is already connected", {52, "ENETRESET", "network dropped connection on reset"},
57: "socket is not connected", {53, "ECONNABORTED", "software caused connection abort"},
58: "can't send after socket shutdown", {54, "ECONNRESET", "connection reset by peer"},
59: "too many references: can't splice", {55, "ENOBUFS", "no buffer space available"},
60: "operation timed out", {56, "EISCONN", "socket is already connected"},
61: "connection refused", {57, "ENOTCONN", "socket is not connected"},
62: "too many levels of symbolic links", {58, "ESHUTDOWN", "can't send after socket shutdown"},
63: "file name too long", {59, "ETOOMANYREFS", "too many references: can't splice"},
64: "host is down", {60, "ETIMEDOUT", "operation timed out"},
65: "no route to host", {61, "ECONNREFUSED", "connection refused"},
66: "directory not empty", {62, "ELOOP", "too many levels of symbolic links"},
67: "too many processes", {63, "ENAMETOOLONG", "file name too long"},
68: "too many users", {64, "EHOSTDOWN", "host is down"},
69: "disc quota exceeded", {65, "EHOSTUNREACH", "no route to host"},
70: "stale NFS file handle", {66, "ENOTEMPTY", "directory not empty"},
71: "too many levels of remote in path", {67, "EPROCLIM", "too many processes"},
72: "RPC struct is bad", {68, "EUSERS", "too many users"},
73: "RPC version wrong", {69, "EDQUOT", "disc quota exceeded"},
74: "RPC prog. not avail", {70, "ESTALE", "stale NFS file handle"},
75: "program version wrong", {71, "EREMOTE", "too many levels of remote in path"},
76: "bad procedure for program", {72, "EBADRPC", "RPC struct is bad"},
77: "no locks available", {73, "ERPCMISMATCH", "RPC version wrong"},
78: "function not implemented", {74, "EPROGUNAVAIL", "RPC prog. not avail"},
79: "inappropriate file type or format", {75, "EPROGMISMATCH", "program version wrong"},
80: "authentication error", {76, "EPROCUNAVAIL", "bad procedure for program"},
81: "need authenticator", {77, "ENOLCK", "no locks available"},
82: "identifier removed", {78, "ENOSYS", "function not implemented"},
83: "no message of desired type", {79, "EFTYPE", "inappropriate file type or format"},
84: "value too large to be stored in data type", {80, "EAUTH", "authentication error"},
85: "operation canceled", {81, "ENEEDAUTH", "need authenticator"},
86: "illegal byte sequence", {82, "EIDRM", "identifier removed"},
87: "attribute not found", {83, "ENOMSG", "no message of desired type"},
88: "programming error", {84, "EOVERFLOW", "value too large to be stored in data type"},
89: "bad message", {85, "ECANCELED", "operation canceled"},
90: "multihop attempted", {86, "EILSEQ", "illegal byte sequence"},
91: "link has been severed", {87, "ENOATTR", "attribute not found"},
92: "protocol error", {88, "EDOOFUS", "programming error"},
93: "capabilities insufficient", {89, "EBADMSG", "bad message"},
94: "not permitted in capability mode", {90, "EMULTIHOP", "multihop attempted"},
95: "state not recoverable", {91, "ENOLINK", "link has been severed"},
96: "previous owner died", {92, "EPROTO", "protocol error"},
{93, "ENOTCAPABLE", "capabilities insufficient"},
{94, "ECAPMODE", "not permitted in capability mode"},
{95, "ENOTRECOVERABLE", "state not recoverable"},
{96, "EOWNERDEAD", "previous owner died"},
} }
// Signal table // Signal table
var signals = [...]string{ var signalList = [...]struct {
1: "hangup", num syscall.Signal
2: "interrupt", name string
3: "quit", desc string
4: "illegal instruction", }{
5: "trace/BPT trap", {1, "SIGHUP", "hangup"},
6: "abort trap", {2, "SIGINT", "interrupt"},
7: "EMT trap", {3, "SIGQUIT", "quit"},
8: "floating point exception", {4, "SIGILL", "illegal instruction"},
9: "killed", {5, "SIGTRAP", "trace/BPT trap"},
10: "bus error", {6, "SIGIOT", "abort trap"},
11: "segmentation fault", {7, "SIGEMT", "EMT trap"},
12: "bad system call", {8, "SIGFPE", "floating point exception"},
13: "broken pipe", {9, "SIGKILL", "killed"},
14: "alarm clock", {10, "SIGBUS", "bus error"},
15: "terminated", {11, "SIGSEGV", "segmentation fault"},
16: "urgent I/O condition", {12, "SIGSYS", "bad system call"},
17: "suspended (signal)", {13, "SIGPIPE", "broken pipe"},
18: "suspended", {14, "SIGALRM", "alarm clock"},
19: "continued", {15, "SIGTERM", "terminated"},
20: "child exited", {16, "SIGURG", "urgent I/O condition"},
21: "stopped (tty input)", {17, "SIGSTOP", "suspended (signal)"},
22: "stopped (tty output)", {18, "SIGTSTP", "suspended"},
23: "I/O possible", {19, "SIGCONT", "continued"},
24: "cputime limit exceeded", {20, "SIGCHLD", "child exited"},
25: "filesize limit exceeded", {21, "SIGTTIN", "stopped (tty input)"},
26: "virtual timer expired", {22, "SIGTTOU", "stopped (tty output)"},
27: "profiling timer expired", {23, "SIGIO", "I/O possible"},
28: "window size changes", {24, "SIGXCPU", "cputime limit exceeded"},
29: "information request", {25, "SIGXFSZ", "filesize limit exceeded"},
30: "user defined signal 1", {26, "SIGVTALRM", "virtual timer expired"},
31: "user defined signal 2", {27, "SIGPROF", "profiling timer expired"},
32: "unknown signal", {28, "SIGWINCH", "window size changes"},
33: "unknown signal", {29, "SIGINFO", "information request"},
{30, "SIGUSR1", "user defined signal 1"},
{31, "SIGUSR2", "user defined signal 2"},
{32, "SIGTHR", "unknown signal"},
{33, "SIGLIBRT", "unknown signal"},
} }
...@@ -1628,138 +1628,146 @@ const ( ...@@ -1628,138 +1628,146 @@ const (
) )
// Error table // Error table
var errors = [...]string{ var errorList = [...]struct {
1: "operation not permitted", num syscall.Errno
2: "no such file or directory", name string
3: "no such process", desc string
4: "interrupted system call", }{
5: "input/output error", {1, "EPERM", "operation not permitted"},
6: "device not configured", {2, "ENOENT", "no such file or directory"},
7: "argument list too long", {3, "ESRCH", "no such process"},
8: "exec format error", {4, "EINTR", "interrupted system call"},
9: "bad file descriptor", {5, "EIO", "input/output error"},
10: "no child processes", {6, "ENXIO", "device not configured"},
11: "resource deadlock avoided", {7, "E2BIG", "argument list too long"},
12: "cannot allocate memory", {8, "ENOEXEC", "exec format error"},
13: "permission denied", {9, "EBADF", "bad file descriptor"},
14: "bad address", {10, "ECHILD", "no child processes"},
15: "block device required", {11, "EDEADLK", "resource deadlock avoided"},
16: "device busy", {12, "ENOMEM", "cannot allocate memory"},
17: "file exists", {13, "EACCES", "permission denied"},
18: "cross-device link", {14, "EFAULT", "bad address"},
19: "operation not supported by device", {15, "ENOTBLK", "block device required"},
20: "not a directory", {16, "EBUSY", "device busy"},
21: "is a directory", {17, "EEXIST", "file exists"},
22: "invalid argument", {18, "EXDEV", "cross-device link"},
23: "too many open files in system", {19, "ENODEV", "operation not supported by device"},
24: "too many open files", {20, "ENOTDIR", "not a directory"},
25: "inappropriate ioctl for device", {21, "EISDIR", "is a directory"},
26: "text file busy", {22, "EINVAL", "invalid argument"},
27: "file too large", {23, "ENFILE", "too many open files in system"},
28: "no space left on device", {24, "EMFILE", "too many open files"},
29: "illegal seek", {25, "ENOTTY", "inappropriate ioctl for device"},
30: "read-only file system", {26, "ETXTBSY", "text file busy"},
31: "too many links", {27, "EFBIG", "file too large"},
32: "broken pipe", {28, "ENOSPC", "no space left on device"},
33: "numerical argument out of domain", {29, "ESPIPE", "illegal seek"},
34: "result too large", {30, "EROFS", "read-only file system"},
35: "resource temporarily unavailable", {31, "EMLINK", "too many links"},
36: "operation now in progress", {32, "EPIPE", "broken pipe"},
37: "operation already in progress", {33, "EDOM", "numerical argument out of domain"},
38: "socket operation on non-socket", {34, "ERANGE", "result too large"},
39: "destination address required", {35, "EAGAIN", "resource temporarily unavailable"},
40: "message too long", {36, "EINPROGRESS", "operation now in progress"},
41: "protocol wrong type for socket", {37, "EALREADY", "operation already in progress"},
42: "protocol not available", {38, "ENOTSOCK", "socket operation on non-socket"},
43: "protocol not supported", {39, "EDESTADDRREQ", "destination address required"},
44: "socket type not supported", {40, "EMSGSIZE", "message too long"},
45: "operation not supported", {41, "EPROTOTYPE", "protocol wrong type for socket"},
46: "protocol family not supported", {42, "ENOPROTOOPT", "protocol not available"},
47: "address family not supported by protocol family", {43, "EPROTONOSUPPORT", "protocol not supported"},
48: "address already in use", {44, "ESOCKTNOSUPPORT", "socket type not supported"},
49: "can't assign requested address", {45, "EOPNOTSUPP", "operation not supported"},
50: "network is down", {46, "EPFNOSUPPORT", "protocol family not supported"},
51: "network is unreachable", {47, "EAFNOSUPPORT", "address family not supported by protocol family"},
52: "network dropped connection on reset", {48, "EADDRINUSE", "address already in use"},
53: "software caused connection abort", {49, "EADDRNOTAVAIL", "can't assign requested address"},
54: "connection reset by peer", {50, "ENETDOWN", "network is down"},
55: "no buffer space available", {51, "ENETUNREACH", "network is unreachable"},
56: "socket is already connected", {52, "ENETRESET", "network dropped connection on reset"},
57: "socket is not connected", {53, "ECONNABORTED", "software caused connection abort"},
58: "can't send after socket shutdown", {54, "ECONNRESET", "connection reset by peer"},
59: "too many references: can't splice", {55, "ENOBUFS", "no buffer space available"},
60: "operation timed out", {56, "EISCONN", "socket is already connected"},
61: "connection refused", {57, "ENOTCONN", "socket is not connected"},
62: "too many levels of symbolic links", {58, "ESHUTDOWN", "can't send after socket shutdown"},
63: "file name too long", {59, "ETOOMANYREFS", "too many references: can't splice"},
64: "host is down", {60, "ETIMEDOUT", "operation timed out"},
65: "no route to host", {61, "ECONNREFUSED", "connection refused"},
66: "directory not empty", {62, "ELOOP", "too many levels of symbolic links"},
67: "too many processes", {63, "ENAMETOOLONG", "file name too long"},
68: "too many users", {64, "EHOSTDOWN", "host is down"},
69: "disc quota exceeded", {65, "EHOSTUNREACH", "no route to host"},
70: "stale NFS file handle", {66, "ENOTEMPTY", "directory not empty"},
71: "too many levels of remote in path", {67, "EPROCLIM", "too many processes"},
72: "RPC struct is bad", {68, "EUSERS", "too many users"},
73: "RPC version wrong", {69, "EDQUOT", "disc quota exceeded"},
74: "RPC prog. not avail", {70, "ESTALE", "stale NFS file handle"},
75: "program version wrong", {71, "EREMOTE", "too many levels of remote in path"},
76: "bad procedure for program", {72, "EBADRPC", "RPC struct is bad"},
77: "no locks available", {73, "ERPCMISMATCH", "RPC version wrong"},
78: "function not implemented", {74, "EPROGUNAVAIL", "RPC prog. not avail"},
79: "inappropriate file type or format", {75, "EPROGMISMATCH", "program version wrong"},
80: "authentication error", {76, "EPROCUNAVAIL", "bad procedure for program"},
81: "need authenticator", {77, "ENOLCK", "no locks available"},
82: "identifier removed", {78, "ENOSYS", "function not implemented"},
83: "no message of desired type", {79, "EFTYPE", "inappropriate file type or format"},
84: "value too large to be stored in data type", {80, "EAUTH", "authentication error"},
85: "operation canceled", {81, "ENEEDAUTH", "need authenticator"},
86: "illegal byte sequence", {82, "EIDRM", "identifier removed"},
87: "attribute not found", {83, "ENOMSG", "no message of desired type"},
88: "programming error", {84, "EOVERFLOW", "value too large to be stored in data type"},
89: "bad message", {85, "ECANCELED", "operation canceled"},
90: "multihop attempted", {86, "EILSEQ", "illegal byte sequence"},
91: "link has been severed", {87, "ENOATTR", "attribute not found"},
92: "protocol error", {88, "EDOOFUS", "programming error"},
93: "capabilities insufficient", {89, "EBADMSG", "bad message"},
94: "not permitted in capability mode", {90, "EMULTIHOP", "multihop attempted"},
95: "state not recoverable", {91, "ENOLINK", "link has been severed"},
96: "previous owner died", {92, "EPROTO", "protocol error"},
{93, "ENOTCAPABLE", "capabilities insufficient"},
{94, "ECAPMODE", "not permitted in capability mode"},
{95, "ENOTRECOVERABLE", "state not recoverable"},
{96, "EOWNERDEAD", "previous owner died"},
} }
// Signal table // Signal table
var signals = [...]string{ var signalList = [...]struct {
1: "hangup", num syscall.Signal
2: "interrupt", name string
3: "quit", desc string
4: "illegal instruction", }{
5: "trace/BPT trap", {1, "SIGHUP", "hangup"},
6: "abort trap", {2, "SIGINT", "interrupt"},
7: "EMT trap", {3, "SIGQUIT", "quit"},
8: "floating point exception", {4, "SIGILL", "illegal instruction"},
9: "killed", {5, "SIGTRAP", "trace/BPT trap"},
10: "bus error", {6, "SIGIOT", "abort trap"},
11: "segmentation fault", {7, "SIGEMT", "EMT trap"},
12: "bad system call", {8, "SIGFPE", "floating point exception"},
13: "broken pipe", {9, "SIGKILL", "killed"},
14: "alarm clock", {10, "SIGBUS", "bus error"},
15: "terminated", {11, "SIGSEGV", "segmentation fault"},
16: "urgent I/O condition", {12, "SIGSYS", "bad system call"},
17: "suspended (signal)", {13, "SIGPIPE", "broken pipe"},
18: "suspended", {14, "SIGALRM", "alarm clock"},
19: "continued", {15, "SIGTERM", "terminated"},
20: "child exited", {16, "SIGURG", "urgent I/O condition"},
21: "stopped (tty input)", {17, "SIGSTOP", "suspended (signal)"},
22: "stopped (tty output)", {18, "SIGTSTP", "suspended"},
23: "I/O possible", {19, "SIGCONT", "continued"},
24: "cputime limit exceeded", {20, "SIGCHLD", "child exited"},
25: "filesize limit exceeded", {21, "SIGTTIN", "stopped (tty input)"},
26: "virtual timer expired", {22, "SIGTTOU", "stopped (tty output)"},
27: "profiling timer expired", {23, "SIGIO", "I/O possible"},
28: "window size changes", {24, "SIGXCPU", "cputime limit exceeded"},
29: "information request", {25, "SIGXFSZ", "filesize limit exceeded"},
30: "user defined signal 1", {26, "SIGVTALRM", "virtual timer expired"},
31: "user defined signal 2", {27, "SIGPROF", "profiling timer expired"},
32: "unknown signal", {28, "SIGWINCH", "window size changes"},
33: "unknown signal", {29, "SIGINFO", "information request"},
{30, "SIGUSR1", "user defined signal 1"},
{31, "SIGUSR2", "user defined signal 2"},
{32, "SIGTHR", "unknown signal"},
{33, "SIGLIBRT", "unknown signal"},
} }
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -1584,137 +1584,145 @@ const ( ...@@ -1584,137 +1584,145 @@ const (
) )
// Error table // Error table
var errors = [...]string{ var errorList = [...]struct {
1: "operation not permitted", num syscall.Errno
2: "no such file or directory", name string
3: "no such process", desc string
4: "interrupted system call", }{
5: "input/output error", {1, "EPERM", "operation not permitted"},
6: "device not configured", {2, "ENOENT", "no such file or directory"},
7: "argument list too long", {3, "ESRCH", "no such process"},
8: "exec format error", {4, "EINTR", "interrupted system call"},
9: "bad file descriptor", {5, "EIO", "input/output error"},
10: "no child processes", {6, "ENXIO", "device not configured"},
11: "resource deadlock avoided", {7, "E2BIG", "argument list too long"},
12: "cannot allocate memory", {8, "ENOEXEC", "exec format error"},
13: "permission denied", {9, "EBADF", "bad file descriptor"},
14: "bad address", {10, "ECHILD", "no child processes"},
15: "block device required", {11, "EDEADLK", "resource deadlock avoided"},
16: "device busy", {12, "ENOMEM", "cannot allocate memory"},
17: "file exists", {13, "EACCES", "permission denied"},
18: "cross-device link", {14, "EFAULT", "bad address"},
19: "operation not supported by device", {15, "ENOTBLK", "block device required"},
20: "not a directory", {16, "EBUSY", "device busy"},
21: "is a directory", {17, "EEXIST", "file exists"},
22: "invalid argument", {18, "EXDEV", "cross-device link"},
23: "too many open files in system", {19, "ENODEV", "operation not supported by device"},
24: "too many open files", {20, "ENOTDIR", "not a directory"},
25: "inappropriate ioctl for device", {21, "EISDIR", "is a directory"},
26: "text file busy", {22, "EINVAL", "invalid argument"},
27: "file too large", {23, "ENFILE", "too many open files in system"},
28: "no space left on device", {24, "EMFILE", "too many open files"},
29: "illegal seek", {25, "ENOTTY", "inappropriate ioctl for device"},
30: "read-only file system", {26, "ETXTBSY", "text file busy"},
31: "too many links", {27, "EFBIG", "file too large"},
32: "broken pipe", {28, "ENOSPC", "no space left on device"},
33: "numerical argument out of domain", {29, "ESPIPE", "illegal seek"},
34: "result too large or too small", {30, "EROFS", "read-only file system"},
35: "resource temporarily unavailable", {31, "EMLINK", "too many links"},
36: "operation now in progress", {32, "EPIPE", "broken pipe"},
37: "operation already in progress", {33, "EDOM", "numerical argument out of domain"},
38: "socket operation on non-socket", {34, "ERANGE", "result too large or too small"},
39: "destination address required", {35, "EAGAIN", "resource temporarily unavailable"},
40: "message too long", {36, "EINPROGRESS", "operation now in progress"},
41: "protocol wrong type for socket", {37, "EALREADY", "operation already in progress"},
42: "protocol option not available", {38, "ENOTSOCK", "socket operation on non-socket"},
43: "protocol not supported", {39, "EDESTADDRREQ", "destination address required"},
44: "socket type not supported", {40, "EMSGSIZE", "message too long"},
45: "operation not supported", {41, "EPROTOTYPE", "protocol wrong type for socket"},
46: "protocol family not supported", {42, "ENOPROTOOPT", "protocol option not available"},
47: "address family not supported by protocol family", {43, "EPROTONOSUPPORT", "protocol not supported"},
48: "address already in use", {44, "ESOCKTNOSUPPORT", "socket type not supported"},
49: "can't assign requested address", {45, "EOPNOTSUPP", "operation not supported"},
50: "network is down", {46, "EPFNOSUPPORT", "protocol family not supported"},
51: "network is unreachable", {47, "EAFNOSUPPORT", "address family not supported by protocol family"},
52: "network dropped connection on reset", {48, "EADDRINUSE", "address already in use"},
53: "software caused connection abort", {49, "EADDRNOTAVAIL", "can't assign requested address"},
54: "connection reset by peer", {50, "ENETDOWN", "network is down"},
55: "no buffer space available", {51, "ENETUNREACH", "network is unreachable"},
56: "socket is already connected", {52, "ENETRESET", "network dropped connection on reset"},
57: "socket is not connected", {53, "ECONNABORTED", "software caused connection abort"},
58: "can't send after socket shutdown", {54, "ECONNRESET", "connection reset by peer"},
59: "too many references: can't splice", {55, "ENOBUFS", "no buffer space available"},
60: "connection timed out", {56, "EISCONN", "socket is already connected"},
61: "connection refused", {57, "ENOTCONN", "socket is not connected"},
62: "too many levels of symbolic links", {58, "ESHUTDOWN", "can't send after socket shutdown"},
63: "file name too long", {59, "ETOOMANYREFS", "too many references: can't splice"},
64: "host is down", {60, "ETIMEDOUT", "connection timed out"},
65: "no route to host", {61, "ECONNREFUSED", "connection refused"},
66: "directory not empty", {62, "ELOOP", "too many levels of symbolic links"},
67: "too many processes", {63, "ENAMETOOLONG", "file name too long"},
68: "too many users", {64, "EHOSTDOWN", "host is down"},
69: "disc quota exceeded", {65, "EHOSTUNREACH", "no route to host"},
70: "stale NFS file handle", {66, "ENOTEMPTY", "directory not empty"},
71: "too many levels of remote in path", {67, "EPROCLIM", "too many processes"},
72: "RPC struct is bad", {68, "EUSERS", "too many users"},
73: "RPC version wrong", {69, "EDQUOT", "disc quota exceeded"},
74: "RPC prog. not avail", {70, "ESTALE", "stale NFS file handle"},
75: "program version wrong", {71, "EREMOTE", "too many levels of remote in path"},
76: "bad procedure for program", {72, "EBADRPC", "RPC struct is bad"},
77: "no locks available", {73, "ERPCMISMATCH", "RPC version wrong"},
78: "function not implemented", {74, "EPROGUNAVAIL", "RPC prog. not avail"},
79: "inappropriate file type or format", {75, "EPROGMISMATCH", "program version wrong"},
80: "authentication error", {76, "EPROCUNAVAIL", "bad procedure for program"},
81: "need authenticator", {77, "ENOLCK", "no locks available"},
82: "identifier removed", {78, "ENOSYS", "function not implemented"},
83: "no message of desired type", {79, "EFTYPE", "inappropriate file type or format"},
84: "value too large to be stored in data type", {80, "EAUTH", "authentication error"},
85: "illegal byte sequence", {81, "ENEEDAUTH", "need authenticator"},
86: "not supported", {82, "EIDRM", "identifier removed"},
87: "operation Canceled", {83, "ENOMSG", "no message of desired type"},
88: "bad or Corrupt message", {84, "EOVERFLOW", "value too large to be stored in data type"},
89: "no message available", {85, "EILSEQ", "illegal byte sequence"},
90: "no STREAM resources", {86, "ENOTSUP", "not supported"},
91: "not a STREAM", {87, "ECANCELED", "operation Canceled"},
92: "STREAM ioctl timeout", {88, "EBADMSG", "bad or Corrupt message"},
93: "attribute not found", {89, "ENODATA", "no message available"},
94: "multihop attempted", {90, "ENOSR", "no STREAM resources"},
95: "link has been severed", {91, "ENOSTR", "not a STREAM"},
96: "protocol error", {92, "ETIME", "STREAM ioctl timeout"},
{93, "ENOATTR", "attribute not found"},
{94, "EMULTIHOP", "multihop attempted"},
{95, "ENOLINK", "link has been severed"},
{96, "ELAST", "protocol error"},
} }
// Signal table // Signal table
var signals = [...]string{ var signalList = [...]struct {
1: "hangup", num syscall.Signal
2: "interrupt", name string
3: "quit", desc string
4: "illegal instruction", }{
5: "trace/BPT trap", {1, "SIGHUP", "hangup"},
6: "abort trap", {2, "SIGINT", "interrupt"},
7: "EMT trap", {3, "SIGQUIT", "quit"},
8: "floating point exception", {4, "SIGILL", "illegal instruction"},
9: "killed", {5, "SIGTRAP", "trace/BPT trap"},
10: "bus error", {6, "SIGIOT", "abort trap"},
11: "segmentation fault", {7, "SIGEMT", "EMT trap"},
12: "bad system call", {8, "SIGFPE", "floating point exception"},
13: "broken pipe", {9, "SIGKILL", "killed"},
14: "alarm clock", {10, "SIGBUS", "bus error"},
15: "terminated", {11, "SIGSEGV", "segmentation fault"},
16: "urgent I/O condition", {12, "SIGSYS", "bad system call"},
17: "stopped (signal)", {13, "SIGPIPE", "broken pipe"},
18: "stopped", {14, "SIGALRM", "alarm clock"},
19: "continued", {15, "SIGTERM", "terminated"},
20: "child exited", {16, "SIGURG", "urgent I/O condition"},
21: "stopped (tty input)", {17, "SIGSTOP", "stopped (signal)"},
22: "stopped (tty output)", {18, "SIGTSTP", "stopped"},
23: "I/O possible", {19, "SIGCONT", "continued"},
24: "cputime limit exceeded", {20, "SIGCHLD", "child exited"},
25: "filesize limit exceeded", {21, "SIGTTIN", "stopped (tty input)"},
26: "virtual timer expired", {22, "SIGTTOU", "stopped (tty output)"},
27: "profiling timer expired", {23, "SIGIO", "I/O possible"},
28: "window size changes", {24, "SIGXCPU", "cputime limit exceeded"},
29: "information request", {25, "SIGXFSZ", "filesize limit exceeded"},
30: "user defined signal 1", {26, "SIGVTALRM", "virtual timer expired"},
31: "user defined signal 2", {27, "SIGPROF", "profiling timer expired"},
32: "power fail/restart", {28, "SIGWINCH", "window size changes"},
{29, "SIGINFO", "information request"},
{30, "SIGUSR1", "user defined signal 1"},
{31, "SIGUSR2", "user defined signal 2"},
{32, "SIGPWR", "power fail/restart"},
} }
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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