Commit 869aabbd authored by Russ Cox's avatar Russ Cox

syscall: more linux arm build fixes

Don't know if it runs, but at least it builds.

R=bradfitz
TBR=bradfitz
CC=golang-dev
https://golang.org/cl/5373093
parent 6687e52a
......@@ -32,7 +32,9 @@ func Pread(fd int, p []byte, offset int64) (n int, err error) {
}
r0, _, e1 := Syscall6(SYS_PREAD64, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32))
n = int(r0)
errno = int(e1)
if e1 != 0 {
err = e1
}
return
}
......@@ -43,7 +45,9 @@ func Pwrite(fd int, p []byte, offset int64) (n int, err error) {
}
r0, _, e1 := Syscall6(SYS_PWRITE64, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32))
n = int(r0)
errno = int(e1)
if e1 != 0 {
err = e1
}
return
}
......@@ -51,13 +55,17 @@ func Ftruncate(fd int, length int64) (err error) {
// ARM EABI requires 64-bit arguments should be put in a pair
// of registers from an even register number.
_, _, e1 := Syscall6(SYS_FTRUNCATE64, uintptr(fd), 0, uintptr(length), uintptr(length>>32), 0, 0)
errno = int(e1)
if e1 != 0 {
err = e1
}
return
}
func Truncate(path string, length int64) (err error) {
_, _, e1 := Syscall6(SYS_TRUNCATE64, uintptr(unsafe.Pointer(StringBytePtr(path))), 0, uintptr(length), uintptr(length>>32), 0, 0)
errno = int(e1)
if e1 != 0 {
err = e1
}
return
}
......
......@@ -155,114 +155,12 @@ const (
DT_SOCK = 0xc
DT_UNKNOWN = 0
DT_WHT = 0xe
E2BIG = 0x7
EACCES = 0xd
EADDRINUSE = 0x62
EADDRNOTAVAIL = 0x63
EADV = 0x44
EAFNOSUPPORT = 0x61
EAGAIN = 0xb
EALREADY = 0x72
EBADE = 0x34
EBADF = 0x9
EBADFD = 0x4d
EBADMSG = 0x4a
EBADR = 0x35
EBADRQC = 0x38
EBADSLT = 0x39
EBFONT = 0x3b
EBUSY = 0x10
ECANCELED = 0x7d
ECHILD = 0xa
ECHRNG = 0x2c
ECOMM = 0x46
ECONNABORTED = 0x67
ECONNREFUSED = 0x6f
ECONNRESET = 0x68
EDEADLK = 0x23
EDEADLOCK = 0x23
EDESTADDRREQ = 0x59
EDOM = 0x21
EDOTDOT = 0x49
EDQUOT = 0x7a
EEXIST = 0x11
EFAULT = 0xe
EFBIG = 0x1b
EHOSTDOWN = 0x70
EHOSTUNREACH = 0x71
EIDRM = 0x2b
EILSEQ = 0x54
EINPROGRESS = 0x73
EINTR = 0x4
EINVAL = 0x16
EIO = 0x5
EISCONN = 0x6a
EISDIR = 0x15
EISNAM = 0x78
EKEYEXPIRED = 0x7f
EKEYREJECTED = 0x81
EKEYREVOKED = 0x80
EL2HLT = 0x33
EL2NSYNC = 0x2d
EL3HLT = 0x2e
EL3RST = 0x2f
ELF_NGREG = 0x12
ELF_PRARGSZ = 0x50
ELIBACC = 0x4f
ELIBBAD = 0x50
ELIBEXEC = 0x53
ELIBMAX = 0x52
ELIBSCN = 0x51
ELNRNG = 0x30
ELOOP = 0x28
EMEDIUMTYPE = 0x7c
EMFILE = 0x18
EMLINK = 0x1f
EMSGSIZE = 0x5a
EMULTIHOP = 0x48
ENAMETOOLONG = 0x24
ENAVAIL = 0x77
ENETDOWN = 0x64
ENETRESET = 0x66
ENETUNREACH = 0x65
ENFILE = 0x17
ENOANO = 0x37
ENOBUFS = 0x69
ENOCSI = 0x32
ENODATA = 0x3d
ENODEV = 0x13
ENOENT = 0x2
ENOEXEC = 0x8
ENOKEY = 0x7e
ENOLCK = 0x25
ENOLINK = 0x43
ENOMEDIUM = 0x7b
ENOMEM = 0xc
ENOMSG = 0x2a
ENONET = 0x40
ENOPKG = 0x41
ENOPROTOOPT = 0x5c
ENOSPC = 0x1c
ENOSR = 0x3f
ENOSTR = 0x3c
ENOSYS = 0x26
ENOTBLK = 0xf
ENOTCONN = 0x6b
ENOTDIR = 0x14
ENOTEMPTY = 0x27
ENOTNAM = 0x76
ENOTRECOVERABLE = 0x83
ENOTSOCK = 0x58
ENOTSUP = 0x5f
ENOTTY = 0x19
ENOTUNIQ = 0x4c
ENXIO = 0x6
EOPNOTSUPP = 0x5f
EOVERFLOW = 0x4b
EOWNERDEAD = 0x82
EPERM = 0x1
EPFNOSUPPORT = 0x60
EPIPE = 0x20
EPOLLERR = 0x8
EPOLLET = -0x80000000
EPOLLHUP = 0x10
......@@ -281,23 +179,6 @@ const (
EPOLL_CTL_DEL = 0x2
EPOLL_CTL_MOD = 0x3
EPOLL_NONBLOCK = 0x800
EPROTO = 0x47
EPROTONOSUPPORT = 0x5d
EPROTOTYPE = 0x5b
ERANGE = 0x22
EREMCHG = 0x4e
EREMOTE = 0x42
EREMOTEIO = 0x79
ERESTART = 0x55
ERFKILL = 0x84
EROFS = 0x1e
ESHUTDOWN = 0x6c
ESOCKTNOSUPPORT = 0x5e
ESPIPE = 0x1d
ESRCH = 0x3
ESRMNT = 0x45
ESTALE = 0x74
ESTRPIPE = 0x56
ETH_P_1588 = 0x88f7
ETH_P_8021Q = 0x8100
ETH_P_802_2 = 0x4
......@@ -360,16 +241,6 @@ const (
ETH_P_WAN_PPP = 0x7
ETH_P_WCCP = 0x883e
ETH_P_X25 = 0x805
ETIME = 0x3e
ETIMEDOUT = 0x6e
ETOOMANYREFS = 0x6d
ETXTBSY = 0x1a
EUCLEAN = 0x75
EUNATCH = 0x31
EUSERS = 0x57
EWOULDBLOCK = 0xb
EXDEV = 0x12
EXFULL = 0x36
FD_CLOEXEC = 0x1
FD_SETSIZE = 0x400
F_DUPFD = 0
......@@ -1223,7 +1094,138 @@ const (
WUNTRACED = 0x2
)
// Types
// Errors
const (
E2BIG = Errno(0x7)
EACCES = Errno(0xd)
EADDRINUSE = Errno(0x62)
EADDRNOTAVAIL = Errno(0x63)
EADV = Errno(0x44)
EAFNOSUPPORT = Errno(0x61)
EAGAIN = Errno(0xb)
EALREADY = Errno(0x72)
EBADE = Errno(0x34)
EBADF = Errno(0x9)
EBADFD = Errno(0x4d)
EBADMSG = Errno(0x4a)
EBADR = Errno(0x35)
EBADRQC = Errno(0x38)
EBADSLT = Errno(0x39)
EBFONT = Errno(0x3b)
EBUSY = Errno(0x10)
ECANCELED = Errno(0x7d)
ECHILD = Errno(0xa)
ECHRNG = Errno(0x2c)
ECOMM = Errno(0x46)
ECONNABORTED = Errno(0x67)
ECONNREFUSED = Errno(0x6f)
ECONNRESET = Errno(0x68)
EDEADLK = Errno(0x23)
EDEADLOCK = Errno(0x23)
EDESTADDRREQ = Errno(0x59)
EDOM = Errno(0x21)
EDOTDOT = Errno(0x49)
EDQUOT = Errno(0x7a)
EEXIST = Errno(0x11)
EFAULT = Errno(0xe)
EFBIG = Errno(0x1b)
EHOSTDOWN = Errno(0x70)
EHOSTUNREACH = Errno(0x71)
EIDRM = Errno(0x2b)
EILSEQ = Errno(0x54)
EINPROGRESS = Errno(0x73)
EINTR = Errno(0x4)
EINVAL = Errno(0x16)
EIO = Errno(0x5)
EISCONN = Errno(0x6a)
EISDIR = Errno(0x15)
EISNAM = Errno(0x78)
EKEYEXPIRED = Errno(0x7f)
EKEYREJECTED = Errno(0x81)
EKEYREVOKED = Errno(0x80)
ELIBACC = Errno(0x4f)
ELIBBAD = Errno(0x50)
ELIBEXEC = Errno(0x53)
ELIBMAX = Errno(0x52)
ELIBSCN = Errno(0x51)
ELNRNG = Errno(0x30)
ELOOP = Errno(0x28)
EMEDIUMTYPE = Errno(0x7c)
EMFILE = Errno(0x18)
EMLINK = Errno(0x1f)
EMSGSIZE = Errno(0x5a)
EMULTIHOP = Errno(0x48)
ENAMETOOLONG = Errno(0x24)
ENAVAIL = Errno(0x77)
ENETDOWN = Errno(0x64)
ENETRESET = Errno(0x66)
ENETUNREACH = Errno(0x65)
ENFILE = Errno(0x17)
ENOANO = Errno(0x37)
ENOBUFS = Errno(0x69)
ENOCSI = Errno(0x32)
ENODATA = Errno(0x3d)
ENODEV = Errno(0x13)
ENOENT = Errno(0x2)
ENOEXEC = Errno(0x8)
ENOKEY = Errno(0x7e)
ENOLCK = Errno(0x25)
ENOLINK = Errno(0x43)
ENOMEDIUM = Errno(0x7b)
ENOMEM = Errno(0xc)
ENOMSG = Errno(0x2a)
ENONET = Errno(0x40)
ENOPKG = Errno(0x41)
ENOPROTOOPT = Errno(0x5c)
ENOSPC = Errno(0x1c)
ENOSR = Errno(0x3f)
ENOSTR = Errno(0x3c)
ENOSYS = Errno(0x26)
ENOTBLK = Errno(0xf)
ENOTCONN = Errno(0x6b)
ENOTDIR = Errno(0x14)
ENOTEMPTY = Errno(0x27)
ENOTNAM = Errno(0x76)
ENOTRECOVERABLE = Errno(0x83)
ENOTSOCK = Errno(0x58)
ENOTSUP = Errno(0x5f)
ENOTTY = Errno(0x19)
ENOTUNIQ = Errno(0x4c)
ENXIO = Errno(0x6)
EOPNOTSUPP = Errno(0x5f)
EOVERFLOW = Errno(0x4b)
EOWNERDEAD = Errno(0x82)
EPERM = Errno(0x1)
EPFNOSUPPORT = Errno(0x60)
EPIPE = Errno(0x20)
EPROTO = Errno(0x47)
EPROTONOSUPPORT = Errno(0x5d)
EPROTOTYPE = Errno(0x5b)
ERANGE = Errno(0x22)
EREMCHG = Errno(0x4e)
EREMOTE = Errno(0x42)
EREMOTEIO = Errno(0x79)
ERESTART = Errno(0x55)
ERFKILL = Errno(0x84)
EROFS = Errno(0x1e)
ESHUTDOWN = Errno(0x6c)
ESOCKTNOSUPPORT = Errno(0x5e)
ESPIPE = Errno(0x1d)
ESRCH = Errno(0x3)
ESRMNT = Errno(0x45)
ESTALE = Errno(0x74)
ESTRPIPE = Errno(0x56)
ETIME = Errno(0x3e)
ETIMEDOUT = Errno(0x6e)
ETOOMANYREFS = Errno(0x6d)
ETXTBSY = Errno(0x1a)
EUCLEAN = Errno(0x75)
EUNATCH = Errno(0x31)
EUSERS = Errno(0x57)
EWOULDBLOCK = Errno(0xb)
EXDEV = Errno(0x12)
EXFULL = Errno(0x36)
)
// Error table
var errors = [...]string{
......
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