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
|
|
@ -5,6 +5,20 @@ package syscall
|
|||
|
||||
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) {
|
||||
_, _, e1 := Syscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0)
|
||||
errno = int(e1)
|
||||
|
|
@ -314,20 +328,6 @@ func Nanosleep(time *Timespec, leftover *Timespec) (errno int) {
|
|||
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) {
|
||||
_, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0)
|
||||
errno = int(e1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue