diff options
| author | Russ Cox <rsc@golang.org> | 2010-04-29 23:34:06 -0700 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2010-04-29 23:34:06 -0700 |
| commit | 52f66a0ccf87f10aaabbf573aea89c4a55d134a0 (patch) | |
| tree | e7780fda66e7ee6659a7963ac9bf189cbd5585bf /src/pkg/syscall/zsyscall_linux_amd64.go | |
| parent | 884ccd25ed97fe0ef5ae8715f3d0b1d081f2f78b (diff) | |
| download | golang-52f66a0ccf87f10aaabbf573aea89c4a55d134a0.tar.gz | |
syscall: force O_LARGEFILE in Linux open system call
Fixes issue 717.
R=adg, PeterGo
CC=golang-dev
http://codereview.appspot.com/1032041
Diffstat (limited to 'src/pkg/syscall/zsyscall_linux_amd64.go')
| -rw-r--r-- | src/pkg/syscall/zsyscall_linux_amd64.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/pkg/syscall/zsyscall_linux_amd64.go b/src/pkg/syscall/zsyscall_linux_amd64.go index 030bed260..c5daf0d9a 100644 --- a/src/pkg/syscall/zsyscall_linux_amd64.go +++ b/src/pkg/syscall/zsyscall_linux_amd64.go @@ -5,6 +5,13 @@ 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 pipe(p *[2]_C_int) (errno int) { _, _, e1 := Syscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0) errno = int(e1) @@ -314,13 +321,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) |
