mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
syscall: fix arm build (fix bugs in generator, to add O_LARGEFILE)
R=r CC=golang-dev https://golang.org/cl/1021043
This commit is contained in:
parent
b3901dc1d8
commit
23bf408d41
10 changed files with 670 additions and 450 deletions
|
|
@ -146,9 +146,9 @@ linux_arm)
|
||||||
ARM="/home/kaib/public/linux-2.6.28"
|
ARM="/home/kaib/public/linux-2.6.28"
|
||||||
mksyscall="./mksyscall.sh -l32"
|
mksyscall="./mksyscall.sh -l32"
|
||||||
mksysnum="./mksysnum_linux.sh $ARM/arch/arm/include/asm/unistd.h"
|
mksysnum="./mksysnum_linux.sh $ARM/arch/arm/include/asm/unistd.h"
|
||||||
// mktypes="godefs -gsyscall -carm-gcc -f-I$ARM/arch/arm/include -f-I$ARM/include -f-D__deprecated='' -f-I$ARM/arch/arm/mach-at91/include -f-DCONFIG_ARCH_AT91SAM9260 "
|
# mktypes="godefs -gsyscall -carm-gcc -f-I$ARM/arch/arm/include -f-I$ARM/include -f-D__deprecated='' -f-I$ARM/arch/arm/mach-at91/include -f-DCONFIG_ARCH_AT91SAM9260 "
|
||||||
mktypes="godefs -gsyscall -carm-gcc"
|
mktypes="godefs -gsyscall -carm-gcc"
|
||||||
mkerrors="./mkerrors.sh"
|
mkerrors='GORUN="qemu-arm -cpu cortex-a8" ./mkerrors.sh'
|
||||||
;;
|
;;
|
||||||
windows_386)
|
windows_386)
|
||||||
mksyscall="./mksyscall_windows.sh -l32"
|
mksyscall="./mksyscall_windows.sh -l32"
|
||||||
|
|
|
||||||
|
|
@ -86,6 +86,7 @@ done
|
||||||
awk '
|
awk '
|
||||||
$1 != "#define" || $2 ~ /\(/ {next}
|
$1 != "#define" || $2 ~ /\(/ {next}
|
||||||
|
|
||||||
|
$2 ~ /^E([ABCD]X|[BIS]P|[SD]I|S|FL)$/ {next} # 386 registers
|
||||||
$2 ~ /^(SIGEV_|SIGSTKSZ|SIGRT(MIN|MAX))/ {next}
|
$2 ~ /^(SIGEV_|SIGSTKSZ|SIGRT(MIN|MAX))/ {next}
|
||||||
|
|
||||||
$2 ~ /^E[A-Z0-9_]+$/ ||
|
$2 ~ /^E[A-Z0-9_]+$/ ||
|
||||||
|
|
@ -95,7 +96,7 @@ done
|
||||||
$2 == "NAME_MAX" ||
|
$2 == "NAME_MAX" ||
|
||||||
$2 ~ /^(O|F|FD|NAME|S|PTRACE)_/ ||
|
$2 ~ /^(O|F|FD|NAME|S|PTRACE)_/ ||
|
||||||
$2 ~ /^W[A-Z0-9]+$/ {printf("\t$%s = %s,\n", $2, $2)}
|
$2 ~ /^W[A-Z0-9]+$/ {printf("\t$%s = %s,\n", $2, $2)}
|
||||||
|
$2 ~ /^__WCOREFLAG$/ {next}
|
||||||
$2 ~ /^__W[A-Z0-9]+$/ {printf("\t$%s = %s,\n", substr($2,3), $2)}
|
$2 ~ /^__W[A-Z0-9]+$/ {printf("\t$%s = %s,\n", substr($2,3), $2)}
|
||||||
|
|
||||||
{next}
|
{next}
|
||||||
|
|
@ -114,7 +115,7 @@ errors=$(
|
||||||
echo '// mkerrors.sh' "$@"
|
echo '// mkerrors.sh' "$@"
|
||||||
echo '// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT'
|
echo '// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT'
|
||||||
echo
|
echo
|
||||||
godefs "$@" -gsyscall "$@" _const.c
|
godefs -c $GCC "$@" -gsyscall "$@" _const.c
|
||||||
|
|
||||||
# Run C program to print error strings.
|
# Run C program to print error strings.
|
||||||
(
|
(
|
||||||
|
|
@ -167,4 +168,4 @@ main(void)
|
||||||
'
|
'
|
||||||
) >_errors.c
|
) >_errors.c
|
||||||
|
|
||||||
gcc $ccflags -o _errors _errors.c && ./_errors && rm -f _errors.c _errors _const.c
|
$GCC $ccflags -static -o _errors _errors.c && $GORUN ./_errors && rm -f _errors.c _errors _const.c
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,11 @@ func Open(path string, mode int, perm int) (fd int, errno int) {
|
||||||
return open(path, mode|O_LARGEFILE, perm)
|
return open(path, mode|O_LARGEFILE, perm)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//sys openat(dirfd int, path string, flags int, mode int) (fd int, errno int)
|
||||||
|
func Openat(dirfd int, path string, flags int, mode int) (fd int, errno int) {
|
||||||
|
return openat(dirfd, path, flags|O_LARGEFILE, mode)
|
||||||
|
}
|
||||||
|
|
||||||
//sys pipe(p *[2]_C_int) (errno int)
|
//sys pipe(p *[2]_C_int) (errno int)
|
||||||
func Pipe(p []int) (errno int) {
|
func Pipe(p []int) (errno int) {
|
||||||
if len(p) != 2 {
|
if len(p) != 2 {
|
||||||
|
|
@ -581,7 +586,6 @@ func PtraceDetach(pid int) (errno int) { return ptrace(PTRACE_DETACH, pid, 0, 0)
|
||||||
//sys Mknod(path string, mode int, dev int) (errno int)
|
//sys Mknod(path string, mode int, dev int) (errno int)
|
||||||
//sys Mknodat(dirfd int, path string, mode int, dev int) (errno int)
|
//sys Mknodat(dirfd int, path string, mode int, dev int) (errno int)
|
||||||
//sys Nanosleep(time *Timespec, leftover *Timespec) (errno int)
|
//sys Nanosleep(time *Timespec, leftover *Timespec) (errno int)
|
||||||
//sys Openat(dirfd int, path string, flags int, mode int) (fd int, errno int)
|
|
||||||
//sys Pause() (errno int)
|
//sys Pause() (errno int)
|
||||||
//sys PivotRoot(newroot string, putold string) (errno int) = SYS_PIVOT_ROOT
|
//sys PivotRoot(newroot string, putold string) (errno int) = SYS_PIVOT_ROOT
|
||||||
//sys Pread(fd int, p []byte, offset int64) (n int, errno int) = SYS_PREAD64
|
//sys Pread(fd int, p []byte, offset int64) (n int, errno int) = SYS_PREAD64
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,15 @@
|
||||||
|
|
||||||
package syscall
|
package syscall
|
||||||
|
|
||||||
|
// These seem not to be defined in our gcc's ARM headers
|
||||||
|
// and are thus missing from zerrors_linux_arm.go.
|
||||||
|
const (
|
||||||
|
WSTOPPED = 0x7f
|
||||||
|
O_CLOEXEC = 0
|
||||||
|
EPOLLRDHUP = EPOLLHUP
|
||||||
|
EPOLLONESHOT = 0x40000000
|
||||||
|
)
|
||||||
|
|
||||||
func Getpagesize() int { return 4096 }
|
func Getpagesize() int { return 4096 }
|
||||||
|
|
||||||
func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
|
func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
// mkerrors.sh -f -m32
|
// mkerrors.sh -f -m32
|
||||||
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
||||||
|
|
||||||
// godefs -f -m32 -gsyscall -f -m32 _const.c
|
// godefs -c gcc -f -m32 -gsyscall -f -m32 _const.c
|
||||||
|
|
||||||
// MACHINE GENERATED - DO NOT EDIT.
|
// MACHINE GENERATED - DO NOT EDIT.
|
||||||
|
|
||||||
|
|
@ -49,7 +49,6 @@ const (
|
||||||
EAFNOSUPPORT = 0x61
|
EAFNOSUPPORT = 0x61
|
||||||
EAGAIN = 0xb
|
EAGAIN = 0xb
|
||||||
EALREADY = 0x72
|
EALREADY = 0x72
|
||||||
EAX = 0x6
|
|
||||||
EBADE = 0x34
|
EBADE = 0x34
|
||||||
EBADF = 0x9
|
EBADF = 0x9
|
||||||
EBADFD = 0x4d
|
EBADFD = 0x4d
|
||||||
|
|
@ -58,9 +57,7 @@ const (
|
||||||
EBADRQC = 0x38
|
EBADRQC = 0x38
|
||||||
EBADSLT = 0x39
|
EBADSLT = 0x39
|
||||||
EBFONT = 0x3b
|
EBFONT = 0x3b
|
||||||
EBP = 0x5
|
|
||||||
EBUSY = 0x10
|
EBUSY = 0x10
|
||||||
EBX = 0
|
|
||||||
ECANCELED = 0x7d
|
ECANCELED = 0x7d
|
||||||
ECHILD = 0xa
|
ECHILD = 0xa
|
||||||
ECHRNG = 0x2c
|
ECHRNG = 0x2c
|
||||||
|
|
@ -68,19 +65,15 @@ const (
|
||||||
ECONNABORTED = 0x67
|
ECONNABORTED = 0x67
|
||||||
ECONNREFUSED = 0x6f
|
ECONNREFUSED = 0x6f
|
||||||
ECONNRESET = 0x68
|
ECONNRESET = 0x68
|
||||||
ECX = 0x1
|
|
||||||
EDEADLK = 0x23
|
EDEADLK = 0x23
|
||||||
EDEADLOCK = 0x23
|
EDEADLOCK = 0x23
|
||||||
EDESTADDRREQ = 0x59
|
EDESTADDRREQ = 0x59
|
||||||
EDI = 0x4
|
|
||||||
EDOM = 0x21
|
EDOM = 0x21
|
||||||
EDOTDOT = 0x49
|
EDOTDOT = 0x49
|
||||||
EDQUOT = 0x7a
|
EDQUOT = 0x7a
|
||||||
EDX = 0x2
|
|
||||||
EEXIST = 0x11
|
EEXIST = 0x11
|
||||||
EFAULT = 0xe
|
EFAULT = 0xe
|
||||||
EFBIG = 0x1b
|
EFBIG = 0x1b
|
||||||
EFL = 0xe
|
|
||||||
EHOSTDOWN = 0x70
|
EHOSTDOWN = 0x70
|
||||||
EHOSTUNREACH = 0x71
|
EHOSTUNREACH = 0x71
|
||||||
EIDRM = 0x2b
|
EIDRM = 0x2b
|
||||||
|
|
@ -89,7 +82,6 @@ const (
|
||||||
EINTR = 0x4
|
EINTR = 0x4
|
||||||
EINVAL = 0x16
|
EINVAL = 0x16
|
||||||
EIO = 0x5
|
EIO = 0x5
|
||||||
EIP = 0xc
|
|
||||||
EISCONN = 0x6a
|
EISCONN = 0x6a
|
||||||
EISDIR = 0x15
|
EISDIR = 0x15
|
||||||
EISNAM = 0x78
|
EISNAM = 0x78
|
||||||
|
|
@ -180,9 +172,7 @@ const (
|
||||||
EREMOTEIO = 0x79
|
EREMOTEIO = 0x79
|
||||||
ERESTART = 0x55
|
ERESTART = 0x55
|
||||||
EROFS = 0x1e
|
EROFS = 0x1e
|
||||||
ES = 0x8
|
|
||||||
ESHUTDOWN = 0x6c
|
ESHUTDOWN = 0x6c
|
||||||
ESI = 0x3
|
|
||||||
ESOCKTNOSUPPORT = 0x5e
|
ESOCKTNOSUPPORT = 0x5e
|
||||||
ESPIPE = 0x1d
|
ESPIPE = 0x1d
|
||||||
ESRCH = 0x3
|
ESRCH = 0x3
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
// mkerrors.sh
|
// mkerrors.sh
|
||||||
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
||||||
|
|
||||||
// godefs -gsyscall _errors.c
|
// godefs -c arm-gcc -gsyscall _const.c
|
||||||
|
|
||||||
// MACHINE GENERATED - DO NOT EDIT.
|
// MACHINE GENERATED - DO NOT EDIT.
|
||||||
|
|
||||||
|
|
@ -9,177 +9,498 @@ package syscall
|
||||||
|
|
||||||
// Constants
|
// Constants
|
||||||
const (
|
const (
|
||||||
EMULTIHOP = 0x48
|
AF_APPLETALK = 0x5
|
||||||
EUNATCH = 0x31
|
AF_ASH = 0x12
|
||||||
EAFNOSUPPORT = 0x61
|
AF_ATMPVC = 0x8
|
||||||
EREMCHG = 0x4e
|
AF_ATMSVC = 0x14
|
||||||
EACCES = 0xd
|
AF_AX25 = 0x3
|
||||||
EL3RST = 0x2f
|
AF_BLUETOOTH = 0x1f
|
||||||
EDESTADDRREQ = 0x59
|
AF_BRIDGE = 0x7
|
||||||
EILSEQ = 0x54
|
AF_DECnet = 0xc
|
||||||
ESPIPE = 0x1d
|
AF_ECONET = 0x13
|
||||||
EMLINK = 0x1f
|
AF_FILE = 0x1
|
||||||
EOWNERDEAD = 0x82
|
AF_INET = 0x2
|
||||||
ENOTTY = 0x19
|
AF_INET6 = 0xa
|
||||||
EBADE = 0x34
|
AF_IPX = 0x4
|
||||||
EBADF = 0x9
|
AF_IRDA = 0x17
|
||||||
EBADR = 0x35
|
AF_KEY = 0xf
|
||||||
EADV = 0x44
|
AF_LOCAL = 0x1
|
||||||
ERANGE = 0x22
|
AF_MAX = 0x20
|
||||||
ECANCELED = 0x7d
|
AF_NETBEUI = 0xd
|
||||||
ETXTBSY = 0x1a
|
AF_NETLINK = 0x10
|
||||||
ENOMEM = 0xc
|
AF_NETROM = 0x6
|
||||||
EINPROGRESS = 0x73
|
AF_PACKET = 0x11
|
||||||
ENOTEMPTY = 0x27
|
AF_PPPOX = 0x18
|
||||||
ENOTBLK = 0xf
|
AF_ROSE = 0xb
|
||||||
EPROTOTYPE = 0x5b
|
AF_ROUTE = 0x10
|
||||||
ERESTART = 0x55
|
AF_SECURITY = 0xe
|
||||||
EISNAM = 0x78
|
AF_SNA = 0x16
|
||||||
ENOMSG = 0x2a
|
AF_UNIX = 0x1
|
||||||
EALREADY = 0x72
|
AF_UNSPEC = 0
|
||||||
ETIMEDOUT = 0x6e
|
AF_WANPIPE = 0x19
|
||||||
ENODATA = 0x3d
|
AF_X25 = 0x9
|
||||||
EINTR = 0x4
|
E2BIG = 0x7
|
||||||
ENOLINK = 0x43
|
EACCES = 0xd
|
||||||
EPERM = 0x1
|
EADDRINUSE = 0x62
|
||||||
ELOOP = 0x28
|
EADDRNOTAVAIL = 0x63
|
||||||
ENETDOWN = 0x64
|
EADV = 0x44
|
||||||
ESTALE = 0x74
|
EAFNOSUPPORT = 0x61
|
||||||
ENOTSOCK = 0x58
|
EAGAIN = 0xb
|
||||||
ENOSR = 0x3f
|
EALREADY = 0x72
|
||||||
ECHILD = 0xa
|
EBADE = 0x34
|
||||||
ELNRNG = 0x30
|
EBADF = 0x9
|
||||||
EPIPE = 0x20
|
EBADFD = 0x4d
|
||||||
EBADMSG = 0x4a
|
EBADMSG = 0x4a
|
||||||
EBFONT = 0x3b
|
EBADR = 0x35
|
||||||
EREMOTE = 0x42
|
EBADRQC = 0x38
|
||||||
ETOOMANYREFS = 0x6d
|
EBADSLT = 0x39
|
||||||
EPFNOSUPPORT = 0x60
|
EBFONT = 0x3b
|
||||||
ENONET = 0x40
|
EBUSY = 0x10
|
||||||
EXFULL = 0x36
|
ECANCELED = 0x7d
|
||||||
EBADSLT = 0x39
|
ECHILD = 0xa
|
||||||
ENOTNAM = 0x76
|
ECHRNG = 0x2c
|
||||||
ENOCSI = 0x32
|
ECOMM = 0x46
|
||||||
EADDRINUSE = 0x62
|
ECONNABORTED = 0x67
|
||||||
ENETRESET = 0x66
|
ECONNREFUSED = 0x6f
|
||||||
EISDIR = 0x15
|
ECONNRESET = 0x68
|
||||||
EIDRM = 0x2b
|
EDEADLK = 0x23
|
||||||
ECOMM = 0x46
|
EDEADLOCK = 0x23
|
||||||
EBADFD = 0x4d
|
EDESTADDRREQ = 0x59
|
||||||
EL2HLT = 0x33
|
EDOM = 0x21
|
||||||
ENOKEY = 0x7e
|
EDOTDOT = 0x49
|
||||||
EINVAL = 0x16
|
EDQUOT = 0x7a
|
||||||
ESHUTDOWN = 0x6c
|
EEXIST = 0x11
|
||||||
EKEYREJECTED = 0x81
|
EFAULT = 0xe
|
||||||
ELIBSCN = 0x51
|
EFBIG = 0x1b
|
||||||
ENAVAIL = 0x77
|
EHOSTDOWN = 0x70
|
||||||
EOVERFLOW = 0x4b
|
EHOSTUNREACH = 0x71
|
||||||
EUCLEAN = 0x75
|
EIDRM = 0x2b
|
||||||
ENOMEDIUM = 0x7b
|
EILSEQ = 0x54
|
||||||
EBUSY = 0x10
|
EINPROGRESS = 0x73
|
||||||
EPROTO = 0x47
|
EINTR = 0x4
|
||||||
ENODEV = 0x13
|
EINVAL = 0x16
|
||||||
EKEYEXPIRED = 0x7f
|
EIO = 0x5
|
||||||
EROFS = 0x1e
|
EISCONN = 0x6a
|
||||||
ELIBACC = 0x4f
|
EISDIR = 0x15
|
||||||
E2BIG = 0x7
|
EISNAM = 0x78
|
||||||
EDEADLK = 0x23
|
EKEYEXPIRED = 0x7f
|
||||||
ENOTDIR = 0x14
|
EKEYREJECTED = 0x81
|
||||||
ECONNRESET = 0x68
|
EKEYREVOKED = 0x80
|
||||||
ENXIO = 0x6
|
EL2HLT = 0x33
|
||||||
EBADRQC = 0x38
|
EL2NSYNC = 0x2d
|
||||||
ENAMETOOLONG = 0x24
|
EL3HLT = 0x2e
|
||||||
ESOCKTNOSUPPORT = 0x5e
|
EL3RST = 0x2f
|
||||||
ELIBEXEC = 0x53
|
ELF_NGREG = 0x12
|
||||||
EDOTDOT = 0x49
|
ELF_PRARGSZ = 0x50
|
||||||
EADDRNOTAVAIL = 0x63
|
ELIBACC = 0x4f
|
||||||
ETIME = 0x3e
|
ELIBBAD = 0x50
|
||||||
EPROTONOSUPPORT = 0x5d
|
ELIBEXEC = 0x53
|
||||||
ENOTRECOVERABLE = 0x83
|
ELIBMAX = 0x52
|
||||||
EIO = 0x5
|
ELIBSCN = 0x51
|
||||||
ENETUNREACH = 0x65
|
ELNRNG = 0x30
|
||||||
EXDEV = 0x12
|
ELOOP = 0x28
|
||||||
EDQUOT = 0x7a
|
EMEDIUMTYPE = 0x7c
|
||||||
EREMOTEIO = 0x79
|
EMFILE = 0x18
|
||||||
ENOSPC = 0x1c
|
EMLINK = 0x1f
|
||||||
ENOEXEC = 0x8
|
EMSGSIZE = 0x5a
|
||||||
EMSGSIZE = 0x5a
|
EMULTIHOP = 0x48
|
||||||
EDOM = 0x21
|
ENAMETOOLONG = 0x24
|
||||||
ENOSTR = 0x3c
|
ENAVAIL = 0x77
|
||||||
EFBIG = 0x1b
|
ENETDOWN = 0x64
|
||||||
ESRCH = 0x3
|
ENETRESET = 0x66
|
||||||
ECHRNG = 0x2c
|
ENETUNREACH = 0x65
|
||||||
EHOSTDOWN = 0x70
|
ENFILE = 0x17
|
||||||
ENOLCK = 0x25
|
ENOANO = 0x37
|
||||||
ENFILE = 0x17
|
ENOBUFS = 0x69
|
||||||
ENOSYS = 0x26
|
ENOCSI = 0x32
|
||||||
ENOTCONN = 0x6b
|
ENODATA = 0x3d
|
||||||
ENOTSUP = 0x5f
|
ENODEV = 0x13
|
||||||
ESRMNT = 0x45
|
ENOENT = 0x2
|
||||||
EDEADLOCK = 0x23
|
ENOEXEC = 0x8
|
||||||
ECONNABORTED = 0x67
|
ENOKEY = 0x7e
|
||||||
ENOANO = 0x37
|
ENOLCK = 0x25
|
||||||
EISCONN = 0x6a
|
ENOLINK = 0x43
|
||||||
EUSERS = 0x57
|
ENOMEDIUM = 0x7b
|
||||||
ENOPROTOOPT = 0x5c
|
ENOMEM = 0xc
|
||||||
EMFILE = 0x18
|
ENOMSG = 0x2a
|
||||||
ENOBUFS = 0x69
|
ENONET = 0x40
|
||||||
EL3HLT = 0x2e
|
ENOPKG = 0x41
|
||||||
EFAULT = 0xe
|
ENOPROTOOPT = 0x5c
|
||||||
EWOULDBLOCK = 0xb
|
ENOSPC = 0x1c
|
||||||
ELIBBAD = 0x50
|
ENOSR = 0x3f
|
||||||
ESTRPIPE = 0x56
|
ENOSTR = 0x3c
|
||||||
ECONNREFUSED = 0x6f
|
ENOSYS = 0x26
|
||||||
EAGAIN = 0xb
|
ENOTBLK = 0xf
|
||||||
ELIBMAX = 0x52
|
ENOTCONN = 0x6b
|
||||||
EEXIST = 0x11
|
ENOTDIR = 0x14
|
||||||
EL2NSYNC = 0x2d
|
ENOTEMPTY = 0x27
|
||||||
ENOENT = 0x2
|
ENOTNAM = 0x76
|
||||||
ENOPKG = 0x41
|
ENOTRECOVERABLE = 0x83
|
||||||
EKEYREVOKED = 0x80
|
ENOTSOCK = 0x58
|
||||||
EHOSTUNREACH = 0x71
|
ENOTSUP = 0x5f
|
||||||
ENOTUNIQ = 0x4c
|
ENOTTY = 0x19
|
||||||
EOPNOTSUPP = 0x5f
|
ENOTUNIQ = 0x4c
|
||||||
EMEDIUMTYPE = 0x7c
|
ENXIO = 0x6
|
||||||
SIGBUS = 0x7
|
EOPNOTSUPP = 0x5f
|
||||||
SIGTTIN = 0x15
|
EOVERFLOW = 0x4b
|
||||||
SIGPROF = 0x1b
|
EOWNERDEAD = 0x82
|
||||||
SIGFPE = 0x8
|
EPERM = 0x1
|
||||||
SIGHUP = 0x1
|
EPFNOSUPPORT = 0x60
|
||||||
SIGTTOU = 0x16
|
EPIPE = 0x20
|
||||||
SIGSTKFLT = 0x10
|
EPOLLERR = 0x8
|
||||||
SIGUSR1 = 0xa
|
EPOLLET = -0x80000000
|
||||||
SIGURG = 0x17
|
EPOLLHUP = 0x10
|
||||||
SIGIO = 0x1d
|
EPOLLIN = 0x1
|
||||||
SIGQUIT = 0x3
|
EPOLLMSG = 0x400
|
||||||
SIGCLD = 0x11
|
EPOLLOUT = 0x4
|
||||||
SHUT_RD = 0
|
EPOLLPRI = 0x2
|
||||||
SHUT_RDWR = 0x2
|
EPOLLRDBAND = 0x80
|
||||||
SHUT_WR = 0x1
|
EPOLLRDNORM = 0x40
|
||||||
SIGABRT = 0x6
|
EPOLLWRBAND = 0x200
|
||||||
SIGTRAP = 0x5
|
EPOLLWRNORM = 0x100
|
||||||
SIGVTALRM = 0x1a
|
EPOLL_CTL_ADD = 0x1
|
||||||
SIGPOLL = 0x1d
|
EPOLL_CTL_DEL = 0x2
|
||||||
SIGSEGV = 0xb
|
EPOLL_CTL_MOD = 0x3
|
||||||
SIGCONT = 0x12
|
EPROTO = 0x47
|
||||||
SIGPIPE = 0xd
|
EPROTONOSUPPORT = 0x5d
|
||||||
SIGWINCH = 0x1c
|
EPROTOTYPE = 0x5b
|
||||||
SIGXFSZ = 0x19
|
ERANGE = 0x22
|
||||||
SIGCHLD = 0x11
|
EREMCHG = 0x4e
|
||||||
SIGSYS = 0x1f
|
EREMOTE = 0x42
|
||||||
SIGSTOP = 0x13
|
EREMOTEIO = 0x79
|
||||||
SIGALRM = 0xe
|
ERESTART = 0x55
|
||||||
SIGUSR2 = 0xc
|
EROFS = 0x1e
|
||||||
SIGTSTP = 0x14
|
ESHUTDOWN = 0x6c
|
||||||
SIGKILL = 0x9
|
ESOCKTNOSUPPORT = 0x5e
|
||||||
SIGXCPU = 0x18
|
ESPIPE = 0x1d
|
||||||
SIGUNUSED = 0x1f
|
ESRCH = 0x3
|
||||||
SIGPWR = 0x1e
|
ESRMNT = 0x45
|
||||||
SIGILL = 0x4
|
ESTALE = 0x74
|
||||||
SIGINT = 0x2
|
ESTRPIPE = 0x56
|
||||||
SIGIOT = 0x6
|
ETIME = 0x3e
|
||||||
SIGTERM = 0xf
|
ETIMEDOUT = 0x6e
|
||||||
O_EXCL = 0x80
|
ETOOMANYREFS = 0x6d
|
||||||
|
ETXTBSY = 0x1a
|
||||||
|
EUCLEAN = 0x75
|
||||||
|
EUNATCH = 0x31
|
||||||
|
EUSERS = 0x57
|
||||||
|
EWOULDBLOCK = 0xb
|
||||||
|
EXDEV = 0x12
|
||||||
|
EXFULL = 0x36
|
||||||
|
EXPR_NEST_MAX = 0x20
|
||||||
|
FD_CLOEXEC = 0x1
|
||||||
|
FD_SETSIZE = 0x400
|
||||||
|
F_DUPFD = 0
|
||||||
|
F_EXLCK = 0x4
|
||||||
|
F_GETFD = 0x1
|
||||||
|
F_GETFL = 0x3
|
||||||
|
F_GETLEASE = 0x401
|
||||||
|
F_GETLK = 0xc
|
||||||
|
F_GETLK64 = 0xc
|
||||||
|
F_GETOWN = 0x9
|
||||||
|
F_GETSIG = 0xb
|
||||||
|
F_LOCK = 0x1
|
||||||
|
F_NOTIFY = 0x402
|
||||||
|
F_OK = 0
|
||||||
|
F_RDLCK = 0
|
||||||
|
F_SETFD = 0x2
|
||||||
|
F_SETFL = 0x4
|
||||||
|
F_SETLEASE = 0x400
|
||||||
|
F_SETLK = 0xd
|
||||||
|
F_SETLK64 = 0xd
|
||||||
|
F_SETLKW = 0xe
|
||||||
|
F_SETLKW64 = 0xe
|
||||||
|
F_SETOWN = 0x8
|
||||||
|
F_SETSIG = 0xa
|
||||||
|
F_SHLCK = 0x8
|
||||||
|
F_TEST = 0x3
|
||||||
|
F_TLOCK = 0x2
|
||||||
|
F_ULOCK = 0
|
||||||
|
F_UNLCK = 0x2
|
||||||
|
F_WRLCK = 0x1
|
||||||
|
IPPROTO_AH = 0x33
|
||||||
|
IPPROTO_COMP = 0x6c
|
||||||
|
IPPROTO_DSTOPTS = 0x3c
|
||||||
|
IPPROTO_EGP = 0x8
|
||||||
|
IPPROTO_ENCAP = 0x62
|
||||||
|
IPPROTO_ESP = 0x32
|
||||||
|
IPPROTO_FRAGMENT = 0x2c
|
||||||
|
IPPROTO_GRE = 0x2f
|
||||||
|
IPPROTO_HOPOPTS = 0
|
||||||
|
IPPROTO_ICMP = 0x1
|
||||||
|
IPPROTO_ICMPV6 = 0x3a
|
||||||
|
IPPROTO_IDP = 0x16
|
||||||
|
IPPROTO_IGMP = 0x2
|
||||||
|
IPPROTO_IP = 0
|
||||||
|
IPPROTO_IPIP = 0x4
|
||||||
|
IPPROTO_IPV6 = 0x29
|
||||||
|
IPPROTO_MTP = 0x5c
|
||||||
|
IPPROTO_NONE = 0x3b
|
||||||
|
IPPROTO_PIM = 0x67
|
||||||
|
IPPROTO_PUP = 0xc
|
||||||
|
IPPROTO_RAW = 0xff
|
||||||
|
IPPROTO_ROUTING = 0x2b
|
||||||
|
IPPROTO_RSVP = 0x2e
|
||||||
|
IPPROTO_TCP = 0x6
|
||||||
|
IPPROTO_TP = 0x1d
|
||||||
|
IPPROTO_UDP = 0x11
|
||||||
|
IPV6_ADDRFORM = 0x1
|
||||||
|
IPV6_ADD_MEMBERSHIP = 0x14
|
||||||
|
IPV6_AUTHHDR = 0xa
|
||||||
|
IPV6_CHECKSUM = 0x7
|
||||||
|
IPV6_DROP_MEMBERSHIP = 0x15
|
||||||
|
IPV6_DSTOPTS = 0x4
|
||||||
|
IPV6_HOPLIMIT = 0x8
|
||||||
|
IPV6_HOPOPTS = 0x3
|
||||||
|
IPV6_JOIN_GROUP = 0x14
|
||||||
|
IPV6_LEAVE_GROUP = 0x15
|
||||||
|
IPV6_MTU = 0x18
|
||||||
|
IPV6_MTU_DISCOVER = 0x17
|
||||||
|
IPV6_MULTICAST_HOPS = 0x12
|
||||||
|
IPV6_MULTICAST_IF = 0x11
|
||||||
|
IPV6_MULTICAST_LOOP = 0x13
|
||||||
|
IPV6_NEXTHOP = 0x9
|
||||||
|
IPV6_PKTINFO = 0x2
|
||||||
|
IPV6_PKTOPTIONS = 0x6
|
||||||
|
IPV6_PMTUDISC_DO = 0x2
|
||||||
|
IPV6_PMTUDISC_DONT = 0
|
||||||
|
IPV6_PMTUDISC_WANT = 0x1
|
||||||
|
IPV6_RECVERR = 0x19
|
||||||
|
IPV6_ROUTER_ALERT = 0x16
|
||||||
|
IPV6_RTHDR = 0x5
|
||||||
|
IPV6_RTHDR_LOOSE = 0
|
||||||
|
IPV6_RTHDR_STRICT = 0x1
|
||||||
|
IPV6_RTHDR_TYPE_0 = 0
|
||||||
|
IPV6_RXDSTOPTS = 0x4
|
||||||
|
IPV6_RXHOPOPTS = 0x3
|
||||||
|
IPV6_UNICAST_HOPS = 0x10
|
||||||
|
IP_ADD_MEMBERSHIP = 0x23
|
||||||
|
IP_DEFAULT_MULTICAST_LOOP = 0x1
|
||||||
|
IP_DEFAULT_MULTICAST_TTL = 0x1
|
||||||
|
IP_DF = 0x4000
|
||||||
|
IP_DROP_MEMBERSHIP = 0x24
|
||||||
|
IP_HDRINCL = 0x3
|
||||||
|
IP_MAXPACKET = 0xffff
|
||||||
|
IP_MAX_MEMBERSHIPS = 0x14
|
||||||
|
IP_MF = 0x2000
|
||||||
|
IP_MSS = 0x240
|
||||||
|
IP_MTU_DISCOVER = 0xa
|
||||||
|
IP_MULTICAST_IF = 0x20
|
||||||
|
IP_MULTICAST_LOOP = 0x22
|
||||||
|
IP_MULTICAST_TTL = 0x21
|
||||||
|
IP_OFFMASK = 0x1fff
|
||||||
|
IP_OPTIONS = 0x4
|
||||||
|
IP_PKTINFO = 0x8
|
||||||
|
IP_PKTOPTIONS = 0x9
|
||||||
|
IP_PMTUDISC = 0xa
|
||||||
|
IP_PMTUDISC_DO = 0x2
|
||||||
|
IP_PMTUDISC_DONT = 0
|
||||||
|
IP_PMTUDISC_WANT = 0x1
|
||||||
|
IP_RECVERR = 0xb
|
||||||
|
IP_RECVOPTS = 0x6
|
||||||
|
IP_RECVRETOPTS = 0x7
|
||||||
|
IP_RECVTOS = 0xd
|
||||||
|
IP_RECVTTL = 0xc
|
||||||
|
IP_RETOPTS = 0x7
|
||||||
|
IP_RF = 0x8000
|
||||||
|
IP_ROUTER_ALERT = 0x5
|
||||||
|
IP_TOS = 0x1
|
||||||
|
IP_TTL = 0x2
|
||||||
|
NAME_MAX = 0xff
|
||||||
|
O_ACCMODE = 0x3
|
||||||
|
O_APPEND = 0x400
|
||||||
|
O_ASYNC = 0x2000
|
||||||
|
O_CREAT = 0x40
|
||||||
|
O_DIRECT = 0x10000
|
||||||
|
O_DIRECTORY = 0x4000
|
||||||
|
O_DSYNC = 0x1000
|
||||||
|
O_EXCL = 0x80
|
||||||
|
O_FSYNC = 0x1000
|
||||||
|
O_LARGEFILE = 0x20000
|
||||||
|
O_NDELAY = 0x800
|
||||||
|
O_NOCTTY = 0x100
|
||||||
|
O_NOFOLLOW = 0x8000
|
||||||
|
O_NONBLOCK = 0x800
|
||||||
|
O_RDONLY = 0
|
||||||
|
O_RDWR = 0x2
|
||||||
|
O_RSYNC = 0x1000
|
||||||
|
O_SYNC = 0x1000
|
||||||
|
O_TRUNC = 0x200
|
||||||
|
O_WRONLY = 0x1
|
||||||
|
PTRACE_ATTACH = 0x10
|
||||||
|
PTRACE_CONT = 0x7
|
||||||
|
PTRACE_DETACH = 0x11
|
||||||
|
PTRACE_EVENT_CLONE = 0x3
|
||||||
|
PTRACE_EVENT_EXEC = 0x4
|
||||||
|
PTRACE_EVENT_EXIT = 0x6
|
||||||
|
PTRACE_EVENT_FORK = 0x1
|
||||||
|
PTRACE_EVENT_VFORK = 0x2
|
||||||
|
PTRACE_EVENT_VFORK_DONE = 0x5
|
||||||
|
PTRACE_GETEVENTMSG = 0x4201
|
||||||
|
PTRACE_GETFPREGS = 0xe
|
||||||
|
PTRACE_GETREGS = 0xc
|
||||||
|
PTRACE_GETSIGINFO = 0x4202
|
||||||
|
PTRACE_GETWMMXREGS = 0x12
|
||||||
|
PTRACE_GET_THREAD_AREA = 0x16
|
||||||
|
PTRACE_KILL = 0x8
|
||||||
|
PTRACE_OLDSETOPTIONS = 0x15
|
||||||
|
PTRACE_O_MASK = 0x7f
|
||||||
|
PTRACE_O_TRACECLONE = 0x8
|
||||||
|
PTRACE_O_TRACEEXEC = 0x10
|
||||||
|
PTRACE_O_TRACEEXIT = 0x40
|
||||||
|
PTRACE_O_TRACEFORK = 0x2
|
||||||
|
PTRACE_O_TRACESYSGOOD = 0x1
|
||||||
|
PTRACE_O_TRACEVFORK = 0x4
|
||||||
|
PTRACE_O_TRACEVFORKDONE = 0x20
|
||||||
|
PTRACE_PEEKDATA = 0x2
|
||||||
|
PTRACE_PEEKTEXT = 0x1
|
||||||
|
PTRACE_PEEKUSR = 0x3
|
||||||
|
PTRACE_POKEDATA = 0x5
|
||||||
|
PTRACE_POKETEXT = 0x4
|
||||||
|
PTRACE_POKEUSR = 0x6
|
||||||
|
PTRACE_SETFPREGS = 0xf
|
||||||
|
PTRACE_SETOPTIONS = 0x4200
|
||||||
|
PTRACE_SETREGS = 0xd
|
||||||
|
PTRACE_SETSIGINFO = 0x4203
|
||||||
|
PTRACE_SETWMMXREGS = 0x13
|
||||||
|
PTRACE_SINGLESTEP = 0x9
|
||||||
|
PTRACE_SYSCALL = 0x18
|
||||||
|
PTRACE_TRACEME = 0
|
||||||
|
SHUT_RD = 0
|
||||||
|
SHUT_RDWR = 0x2
|
||||||
|
SHUT_WR = 0x1
|
||||||
|
SIGABRT = 0x6
|
||||||
|
SIGALRM = 0xe
|
||||||
|
SIGBUS = 0x7
|
||||||
|
SIGCHLD = 0x11
|
||||||
|
SIGCLD = 0x11
|
||||||
|
SIGCONT = 0x12
|
||||||
|
SIGFPE = 0x8
|
||||||
|
SIGHUP = 0x1
|
||||||
|
SIGILL = 0x4
|
||||||
|
SIGINT = 0x2
|
||||||
|
SIGIO = 0x1d
|
||||||
|
SIGIOT = 0x6
|
||||||
|
SIGKILL = 0x9
|
||||||
|
SIGPIPE = 0xd
|
||||||
|
SIGPOLL = 0x1d
|
||||||
|
SIGPROF = 0x1b
|
||||||
|
SIGPWR = 0x1e
|
||||||
|
SIGQUIT = 0x3
|
||||||
|
SIGSEGV = 0xb
|
||||||
|
SIGSTKFLT = 0x10
|
||||||
|
SIGSTOP = 0x13
|
||||||
|
SIGSYS = 0x1f
|
||||||
|
SIGTERM = 0xf
|
||||||
|
SIGTRAP = 0x5
|
||||||
|
SIGTSTP = 0x14
|
||||||
|
SIGTTIN = 0x15
|
||||||
|
SIGTTOU = 0x16
|
||||||
|
SIGUNUSED = 0x1f
|
||||||
|
SIGURG = 0x17
|
||||||
|
SIGUSR1 = 0xa
|
||||||
|
SIGUSR2 = 0xc
|
||||||
|
SIGVTALRM = 0x1a
|
||||||
|
SIGWINCH = 0x1c
|
||||||
|
SIGXCPU = 0x18
|
||||||
|
SIGXFSZ = 0x19
|
||||||
|
SOCK_DGRAM = 0x2
|
||||||
|
SOCK_PACKET = 0xa
|
||||||
|
SOCK_RAW = 0x3
|
||||||
|
SOCK_RDM = 0x4
|
||||||
|
SOCK_SEQPACKET = 0x5
|
||||||
|
SOCK_STREAM = 0x1
|
||||||
|
SOL_AAL = 0x109
|
||||||
|
SOL_ATM = 0x108
|
||||||
|
SOL_DECNET = 0x105
|
||||||
|
SOL_ICMPV6 = 0x3a
|
||||||
|
SOL_IP = 0
|
||||||
|
SOL_IPV6 = 0x29
|
||||||
|
SOL_IRDA = 0x10a
|
||||||
|
SOL_PACKET = 0x107
|
||||||
|
SOL_RAW = 0xff
|
||||||
|
SOL_SOCKET = 0x1
|
||||||
|
SOL_TCP = 0x6
|
||||||
|
SOL_X25 = 0x106
|
||||||
|
SOMAXCONN = 0x80
|
||||||
|
SO_ACCEPTCONN = 0x1e
|
||||||
|
SO_ATTACH_FILTER = 0x1a
|
||||||
|
SO_BINDTODEVICE = 0x19
|
||||||
|
SO_BROADCAST = 0x6
|
||||||
|
SO_BSDCOMPAT = 0xe
|
||||||
|
SO_DEBUG = 0x1
|
||||||
|
SO_DETACH_FILTER = 0x1b
|
||||||
|
SO_DONTROUTE = 0x5
|
||||||
|
SO_ERROR = 0x4
|
||||||
|
SO_KEEPALIVE = 0x9
|
||||||
|
SO_LINGER = 0xd
|
||||||
|
SO_NO_CHECK = 0xb
|
||||||
|
SO_OOBINLINE = 0xa
|
||||||
|
SO_PASSCRED = 0x10
|
||||||
|
SO_PEERCRED = 0x11
|
||||||
|
SO_PEERNAME = 0x1c
|
||||||
|
SO_PEERSEC = 0x1f
|
||||||
|
SO_PRIORITY = 0xc
|
||||||
|
SO_RCVBUF = 0x8
|
||||||
|
SO_RCVLOWAT = 0x12
|
||||||
|
SO_RCVTIMEO = 0x14
|
||||||
|
SO_REUSEADDR = 0x2
|
||||||
|
SO_SECURITY_AUTHENTICATION = 0x16
|
||||||
|
SO_SECURITY_ENCRYPTION_NETWORK = 0x18
|
||||||
|
SO_SECURITY_ENCRYPTION_TRANSPORT = 0x17
|
||||||
|
SO_SNDBUF = 0x7
|
||||||
|
SO_SNDLOWAT = 0x13
|
||||||
|
SO_SNDTIMEO = 0x15
|
||||||
|
SO_TIMESTAMP = 0x1d
|
||||||
|
SO_TYPE = 0x3
|
||||||
|
S_BLKSIZE = 0x200
|
||||||
|
S_IEXEC = 0x40
|
||||||
|
S_IFBLK = 0x6000
|
||||||
|
S_IFCHR = 0x2000
|
||||||
|
S_IFDIR = 0x4000
|
||||||
|
S_IFIFO = 0x1000
|
||||||
|
S_IFLNK = 0xa000
|
||||||
|
S_IFMT = 0xf000
|
||||||
|
S_IFREG = 0x8000
|
||||||
|
S_IFSOCK = 0xc000
|
||||||
|
S_IREAD = 0x100
|
||||||
|
S_IRGRP = 0x20
|
||||||
|
S_IROTH = 0x4
|
||||||
|
S_IRUSR = 0x100
|
||||||
|
S_IRWXG = 0x38
|
||||||
|
S_IRWXO = 0x7
|
||||||
|
S_IRWXU = 0x1c0
|
||||||
|
S_ISGID = 0x400
|
||||||
|
S_ISUID = 0x800
|
||||||
|
S_ISVTX = 0x200
|
||||||
|
S_IWGRP = 0x10
|
||||||
|
S_IWOTH = 0x2
|
||||||
|
S_IWRITE = 0x80
|
||||||
|
S_IWUSR = 0x80
|
||||||
|
S_IXGRP = 0x8
|
||||||
|
S_IXOTH = 0x1
|
||||||
|
S_IXUSR = 0x40
|
||||||
|
TCP_CORK = 0x3
|
||||||
|
TCP_DEFER_ACCEPT = 0x9
|
||||||
|
TCP_INFO = 0xb
|
||||||
|
TCP_KEEPCNT = 0x6
|
||||||
|
TCP_KEEPIDLE = 0x4
|
||||||
|
TCP_KEEPINTVL = 0x5
|
||||||
|
TCP_LINGER2 = 0x8
|
||||||
|
TCP_MAXSEG = 0x2
|
||||||
|
TCP_MAXWIN = 0xffff
|
||||||
|
TCP_MAX_WINSHIFT = 0xe
|
||||||
|
TCP_MSS = 0x200
|
||||||
|
TCP_NODELAY = 0x1
|
||||||
|
TCP_QUICKACK = 0xc
|
||||||
|
TCP_SYNCNT = 0x7
|
||||||
|
TCP_WINDOW_CLAMP = 0xa
|
||||||
|
WALL = 0x40000000
|
||||||
|
WCLONE = 0x80000000
|
||||||
|
WCOREFLAG = 0x80
|
||||||
|
WNOHANG = 0x1
|
||||||
|
WORDSIZE = 0x20
|
||||||
|
WUNTRACED = 0x2
|
||||||
)
|
)
|
||||||
|
|
||||||
// Types
|
// Types
|
||||||
|
|
@ -187,133 +508,133 @@ 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",
|
||||||
53: "invalid request descriptor",
|
|
||||||
68: "advertise error",
|
|
||||||
34: "numerical result out of range",
|
|
||||||
125: "operation canceled",
|
|
||||||
26: "text file busy",
|
|
||||||
12: "cannot allocate memory",
|
|
||||||
115: "operation now in progress",
|
|
||||||
39: "directory not empty",
|
|
||||||
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",
|
|
||||||
48: "link 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",
|
|
||||||
50: "no CSI structure available",
|
|
||||||
98: "address already in use",
|
|
||||||
102: "network dropped connection on reset",
|
|
||||||
21: "is a directory",
|
|
||||||
43: "identifier removed",
|
|
||||||
70: "communication error on send",
|
|
||||||
77: "file descriptor in bad state",
|
77: "file descriptor in bad state",
|
||||||
51: "level 2 halted",
|
74: "bad message",
|
||||||
126: "required key not available",
|
53: "invalid request descriptor",
|
||||||
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",
|
|
||||||
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",
|
|
||||||
20: "not a directory",
|
|
||||||
104: "connection reset by peer",
|
|
||||||
6: "no such device or address",
|
|
||||||
56: "invalid request code",
|
56: "invalid request code",
|
||||||
36: "file name too long",
|
57: "invalid slot",
|
||||||
94: "socket type not supported",
|
59: "bad font file format",
|
||||||
83: "cannot exec a shared library directly",
|
16: "device or resource busy",
|
||||||
73: "RFS specific error",
|
125: "operation canceled",
|
||||||
99: "cannot assign requested address",
|
10: "no child processes",
|
||||||
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",
|
|
||||||
121: "remote I/O error",
|
|
||||||
28: "no space left on device",
|
|
||||||
8: "exec format error",
|
|
||||||
90: "message too long",
|
|
||||||
33: "numerical argument out of domain",
|
|
||||||
60: "device not a stream",
|
|
||||||
27: "file too large",
|
|
||||||
3: "no such process",
|
|
||||||
44: "channel number out of range",
|
44: "channel number out of range",
|
||||||
112: "host is down",
|
70: "communication error on send",
|
||||||
37: "no locks available",
|
|
||||||
23: "too many open files in system",
|
|
||||||
38: "function not implemented",
|
|
||||||
107: "transport endpoint is not connected",
|
|
||||||
95: "operation not supported",
|
|
||||||
69: "srmount error",
|
|
||||||
103: "software caused connection abort",
|
103: "software caused connection abort",
|
||||||
55: "no anode",
|
|
||||||
106: "transport endpoint is already connected",
|
|
||||||
87: "too many users",
|
|
||||||
92: "protocol not available",
|
|
||||||
24: "too many open files",
|
|
||||||
105: "no buffer space available",
|
|
||||||
46: "level 3 halted",
|
|
||||||
14: "bad address",
|
|
||||||
11: "resource temporarily unavailable",
|
|
||||||
80: "accessing a corrupted shared library",
|
|
||||||
86: "streams pipe error",
|
|
||||||
111: "connection refused",
|
111: "connection refused",
|
||||||
82: "attempting to link in too many shared libraries",
|
104: "connection reset by peer",
|
||||||
|
35: "resource deadlock avoided",
|
||||||
|
89: "destination address required",
|
||||||
|
33: "numerical argument out of domain",
|
||||||
|
73: "RFS specific error",
|
||||||
|
122: "disk quota exceeded",
|
||||||
17: "file exists",
|
17: "file exists",
|
||||||
45: "level 2 not synchronized",
|
14: "bad address",
|
||||||
2: "no such file or directory",
|
27: "file too large",
|
||||||
65: "package not installed",
|
112: "host is down",
|
||||||
128: "key has been revoked",
|
|
||||||
113: "no route to host",
|
113: "no route to host",
|
||||||
76: "name not unique on network",
|
43: "identifier removed",
|
||||||
|
84: "invalid or incomplete multibyte or wide character",
|
||||||
|
115: "operation now in progress",
|
||||||
|
4: "interrupted system call",
|
||||||
|
22: "invalid argument",
|
||||||
|
5: "input/output error",
|
||||||
|
106: "transport endpoint is already connected",
|
||||||
|
21: "is a directory",
|
||||||
|
120: "is a named type file",
|
||||||
|
127: "unknown error 127",
|
||||||
|
129: "unknown error 129",
|
||||||
|
128: "unknown error 128",
|
||||||
|
51: "level 2 halted",
|
||||||
|
45: "level 2 not synchronized",
|
||||||
|
46: "level 3 halted",
|
||||||
|
47: "level 3 reset",
|
||||||
|
79: "can not access a needed shared library",
|
||||||
|
80: "accessing a corrupted shared library",
|
||||||
|
83: "cannot exec a shared library directly",
|
||||||
|
82: "attempting to link in too many shared libraries",
|
||||||
|
81: ".lib section in a.out corrupted",
|
||||||
|
48: "link number out of range",
|
||||||
|
40: "too many levels of symbolic links",
|
||||||
124: "wrong medium type",
|
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",
|
||||||
|
8: "exec format error",
|
||||||
|
126: "unknown error 126",
|
||||||
|
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",
|
||||||
|
92: "protocol not available",
|
||||||
|
28: "no space left on device",
|
||||||
|
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",
|
||||||
|
39: "directory not empty",
|
||||||
|
118: "not a XENIX named type file",
|
||||||
|
131: "unknown error 131",
|
||||||
|
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: "unknown error 130",
|
||||||
|
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",
|
||||||
|
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",
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,13 @@ func open(path string, mode int, perm int) (fd int, errno int) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func openat(dirfd int, path string, flags int, mode int) (fd int, errno int) {
|
||||||
|
r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(flags), uintptr(mode), 0, 0)
|
||||||
|
fd = int(r0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
func pipe(p *[2]_C_int) (errno int) {
|
func pipe(p *[2]_C_int) (errno int) {
|
||||||
_, _, e1 := Syscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0)
|
_, _, e1 := Syscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0)
|
||||||
errno = int(e1)
|
errno = int(e1)
|
||||||
|
|
@ -321,13 +328,6 @@ func Nanosleep(time *Timespec, leftover *Timespec) (errno int) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func Openat(dirfd int, path string, flags int, mode int) (fd int, errno int) {
|
|
||||||
r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(flags), uintptr(mode), 0, 0)
|
|
||||||
fd = int(r0)
|
|
||||||
errno = int(e1)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func Pause() (errno int) {
|
func Pause() (errno int) {
|
||||||
_, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0)
|
_, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0)
|
||||||
errno = int(e1)
|
errno = int(e1)
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,13 @@ func open(path string, mode int, perm int) (fd int, errno int) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func openat(dirfd int, path string, flags int, mode int) (fd int, errno int) {
|
||||||
|
r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(flags), uintptr(mode), 0, 0)
|
||||||
|
fd = int(r0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
func pipe(p *[2]_C_int) (errno int) {
|
func pipe(p *[2]_C_int) (errno int) {
|
||||||
_, _, e1 := Syscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0)
|
_, _, e1 := Syscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0)
|
||||||
errno = int(e1)
|
errno = int(e1)
|
||||||
|
|
@ -321,13 +328,6 @@ func Nanosleep(time *Timespec, leftover *Timespec) (errno int) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func Openat(dirfd int, path string, flags int, mode int) (fd int, errno int) {
|
|
||||||
r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(flags), uintptr(mode), 0, 0)
|
|
||||||
fd = int(r0)
|
|
||||||
errno = int(e1)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func Pause() (errno int) {
|
func Pause() (errno int) {
|
||||||
_, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0)
|
_, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0)
|
||||||
errno = int(e1)
|
errno = int(e1)
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,20 @@ package syscall
|
||||||
|
|
||||||
import "unsafe"
|
import "unsafe"
|
||||||
|
|
||||||
|
func open(path string, mode int, perm int) (fd int, errno int) {
|
||||||
|
r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), uintptr(perm))
|
||||||
|
fd = int(r0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func openat(dirfd int, path string, flags int, mode int) (fd int, errno int) {
|
||||||
|
r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(flags), uintptr(mode), 0, 0)
|
||||||
|
fd = int(r0)
|
||||||
|
errno = int(e1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
func pipe(p *[2]_C_int) (errno int) {
|
func pipe(p *[2]_C_int) (errno int) {
|
||||||
_, _, e1 := Syscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0)
|
_, _, e1 := Syscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0)
|
||||||
errno = int(e1)
|
errno = int(e1)
|
||||||
|
|
@ -314,20 +328,6 @@ func Nanosleep(time *Timespec, leftover *Timespec) (errno int) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func Open(path string, mode int, perm int) (fd int, errno int) {
|
|
||||||
r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), uintptr(perm))
|
|
||||||
fd = int(r0)
|
|
||||||
errno = int(e1)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func Openat(dirfd int, path string, flags int, mode int) (fd int, errno int) {
|
|
||||||
r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(flags), uintptr(mode), 0, 0)
|
|
||||||
fd = int(r0)
|
|
||||||
errno = int(e1)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func Pause() (errno int) {
|
func Pause() (errno int) {
|
||||||
_, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0)
|
_, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0)
|
||||||
errno = int(e1)
|
errno = int(e1)
|
||||||
|
|
|
||||||
|
|
@ -6,121 +6,16 @@ package syscall
|
||||||
|
|
||||||
// Constants
|
// Constants
|
||||||
const (
|
const (
|
||||||
sizeofPtr = 0x4
|
sizeofPtr = 0x4
|
||||||
sizeofShort = 0x2
|
sizeofShort = 0x2
|
||||||
sizeofInt = 0x4
|
sizeofInt = 0x4
|
||||||
sizeofLong = 0x4
|
sizeofLong = 0x4
|
||||||
sizeofLongLong = 0x8
|
sizeofLongLong = 0x8
|
||||||
PathMax = 0x1000
|
PathMax = 0x1000
|
||||||
O_RDONLY = 0
|
SizeofSockaddrInet4 = 0x10
|
||||||
O_WRONLY = 0x1
|
SizeofSockaddrInet6 = 0x1c
|
||||||
O_RDWR = 0x2
|
SizeofSockaddrAny = 0x1c
|
||||||
O_APPEND = 0x400
|
SizeofSockaddrUnix = 0x6e
|
||||||
O_ASYNC = 0x2000
|
|
||||||
O_CREAT = 0x40
|
|
||||||
O_NOCTTY = 0x100
|
|
||||||
O_NONBLOCK = 0x800
|
|
||||||
O_SYNC = 0x1000
|
|
||||||
O_TRUNC = 0x200
|
|
||||||
O_CLOEXEC = 0
|
|
||||||
F_GETFD = 0x1
|
|
||||||
F_SETFD = 0x2
|
|
||||||
F_GETFL = 0x3
|
|
||||||
F_SETFL = 0x4
|
|
||||||
FD_CLOEXEC = 0x1
|
|
||||||
NAME_MAX = 0xff
|
|
||||||
S_IFMT = 0xf000
|
|
||||||
S_IFIFO = 0x1000
|
|
||||||
S_IFCHR = 0x2000
|
|
||||||
S_IFDIR = 0x4000
|
|
||||||
S_IFBLK = 0x6000
|
|
||||||
S_IFREG = 0x8000
|
|
||||||
S_IFLNK = 0xa000
|
|
||||||
S_IFSOCK = 0xc000
|
|
||||||
S_ISUID = 0x800
|
|
||||||
S_ISGID = 0x400
|
|
||||||
S_ISVTX = 0x200
|
|
||||||
S_IRUSR = 0x100
|
|
||||||
S_IWUSR = 0x80
|
|
||||||
S_IXUSR = 0x40
|
|
||||||
WNOHANG = 0x1
|
|
||||||
WUNTRACED = 0x2
|
|
||||||
WEXITED = 0x4
|
|
||||||
WSTOPPED = 0x2
|
|
||||||
WCONTINUED = 0x8
|
|
||||||
WNOWAIT = 0x1000000
|
|
||||||
WCLONE = 0x80000000
|
|
||||||
WALL = 0x40000000
|
|
||||||
WNOTHREAD = 0x20000000
|
|
||||||
AF_UNIX = 0x1
|
|
||||||
AF_INET = 0x2
|
|
||||||
AF_INET6 = 0xa
|
|
||||||
SOCK_STREAM = 0x1
|
|
||||||
SOCK_DGRAM = 0x2
|
|
||||||
SOCK_RAW = 0x3
|
|
||||||
SOCK_SEQPACKET = 0x5
|
|
||||||
SOL_SOCKET = 0x1
|
|
||||||
SO_REUSEADDR = 0x2
|
|
||||||
SO_KEEPALIVE = 0x9
|
|
||||||
SO_DONTROUTE = 0x5
|
|
||||||
SO_BROADCAST = 0x6
|
|
||||||
SO_LINGER = 0xd
|
|
||||||
SO_SNDBUF = 0x7
|
|
||||||
SO_RCVBUF = 0x8
|
|
||||||
SO_SNDTIMEO = 0x15
|
|
||||||
SO_RCVTIMEO = 0x14
|
|
||||||
IPPROTO_TCP = 0x6
|
|
||||||
IPPROTO_UDP = 0x11
|
|
||||||
TCP_NODELAY = 0x1
|
|
||||||
SOMAXCONN = 0x80
|
|
||||||
SizeofSockaddrInet4 = 0x10
|
|
||||||
SizeofSockaddrInet6 = 0x1c
|
|
||||||
SizeofSockaddrAny = 0x1c
|
|
||||||
SizeofSockaddrUnix = 0x6e
|
|
||||||
PTRACE_TRACEME = 0
|
|
||||||
PTRACE_PEEKTEXT = 0x1
|
|
||||||
PTRACE_PEEKDATA = 0x2
|
|
||||||
PTRACE_PEEKUSER = 0x3
|
|
||||||
PTRACE_POKETEXT = 0x4
|
|
||||||
PTRACE_POKEDATA = 0x5
|
|
||||||
PTRACE_POKEUSER = 0x6
|
|
||||||
PTRACE_CONT = 0x7
|
|
||||||
PTRACE_KILL = 0x8
|
|
||||||
PTRACE_SINGLESTEP = 0x9
|
|
||||||
PTRACE_GETREGS = 0xc
|
|
||||||
PTRACE_SETREGS = 0xd
|
|
||||||
PTRACE_GETFPREGS = 0xe
|
|
||||||
PTRACE_SETFPREGS = 0xf
|
|
||||||
PTRACE_ATTACH = 0x10
|
|
||||||
PTRACE_DETACH = 0x11
|
|
||||||
PTRACE_GETFPXREGS = 0x12
|
|
||||||
PTRACE_SETFPXREGS = 0x13
|
|
||||||
PTRACE_SYSCALL = 0x18
|
|
||||||
PTRACE_SETOPTIONS = 0x4200
|
|
||||||
PTRACE_GETEVENTMSG = 0x4201
|
|
||||||
PTRACE_GETSIGINFO = 0x4202
|
|
||||||
PTRACE_SETSIGINFO = 0x4203
|
|
||||||
PTRACE_O_TRACESYSGOOD = 0x1
|
|
||||||
PTRACE_O_TRACEFORK = 0x2
|
|
||||||
PTRACE_O_TRACEVFORK = 0x4
|
|
||||||
PTRACE_O_TRACECLONE = 0x8
|
|
||||||
PTRACE_O_TRACEEXEC = 0x10
|
|
||||||
PTRACE_O_TRACEVFORKDONE = 0x20
|
|
||||||
PTRACE_O_TRACEEXIT = 0x40
|
|
||||||
PTRACE_O_MASK = 0x7f
|
|
||||||
PTRACE_EVENT_FORK = 0x1
|
|
||||||
PTRACE_EVENT_VFORK = 0x2
|
|
||||||
PTRACE_EVENT_CLONE = 0x3
|
|
||||||
PTRACE_EVENT_EXEC = 0x4
|
|
||||||
PTRACE_EVENT_VFORK_DONE = 0x5
|
|
||||||
PTRACE_EVENT_EXIT = 0x6
|
|
||||||
EPOLLIN = 0x1
|
|
||||||
EPOLLRDHUP = 0x2000
|
|
||||||
EPOLLOUT = 0x4
|
|
||||||
EPOLLONESHOT = 0x40000000
|
|
||||||
EPOLL_CTL_MOD = 0x3
|
|
||||||
EPOLL_CTL_ADD = 0x1
|
|
||||||
EPOLL_CTL_DEL = 0x2
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Types
|
// Types
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue