diff options
author | Russ Cox <rsc@golang.org> | 2011-01-05 14:35:07 -0500 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2011-01-05 14:35:07 -0500 |
commit | 189d4ff7762f73b7602dd5a7d8451dccc3eb9764 (patch) | |
tree | c768d4fc4311cb25f8147ddc99bb2a16cfbc9a7d | |
parent | ddc2710d69adceb1f457792f17c4837a3d52a10a (diff) | |
download | go-189d4ff7762f73b7602dd5a7d8451dccc3eb9764.tar.gz go-189d4ff7762f73b7602dd5a7d8451dccc3eb9764.zip |
syscall: correct Linux Splice definition
Fixes #1376.
R=r
CC=golang-dev
https://golang.org/cl/3869042
-rw-r--r-- | src/pkg/syscall/syscall_linux.go | 1 | ||||
-rw-r--r-- | src/pkg/syscall/syscall_linux_386.go | 1 | ||||
-rw-r--r-- | src/pkg/syscall/syscall_linux_amd64.go | 1 | ||||
-rw-r--r-- | src/pkg/syscall/syscall_linux_arm.go | 1 | ||||
-rw-r--r-- | src/pkg/syscall/zsyscall_linux_386.go | 18 | ||||
-rw-r--r-- | src/pkg/syscall/zsyscall_linux_amd64.go | 18 | ||||
-rw-r--r-- | src/pkg/syscall/zsyscall_linux_arm.go | 28 |
7 files changed, 35 insertions, 33 deletions
diff --git a/src/pkg/syscall/syscall_linux.go b/src/pkg/syscall/syscall_linux.go index 710ab74fa5..a65e41dc62 100644 --- a/src/pkg/syscall/syscall_linux.go +++ b/src/pkg/syscall/syscall_linux.go @@ -721,7 +721,6 @@ func PtraceDetach(pid int) (errno int) { return ptrace(PTRACE_DETACH, pid, 0, 0) //sys Setsid() (pid int, errno int) //sys Settimeofday(tv *Timeval) (errno int) //sys Setuid(uid int) (errno int) -//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, errno int) //sys Symlink(oldpath string, newpath string) (errno int) //sys Sync() //sys Sysinfo(info *Sysinfo_t) (errno int) diff --git a/src/pkg/syscall/syscall_linux_386.go b/src/pkg/syscall/syscall_linux_386.go index bf5dd47d1e..5bd3406de6 100644 --- a/src/pkg/syscall/syscall_linux_386.go +++ b/src/pkg/syscall/syscall_linux_386.go @@ -48,6 +48,7 @@ func NsecToTimeval(nsec int64) (tv Timeval) { //sys Setresgid(rgid int, egid int, sgid int) (errno int) = SYS_SETRESGID32 //sys Setresuid(ruid int, euid int, suid int) (errno int) = SYS_SETRESUID32 //sys Setreuid(ruid int, euid int) (errno int) = SYS_SETREUID32 +//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, errno int) //sys Stat(path string, stat *Stat_t) (errno int) = SYS_STAT64 //sys SyncFileRange(fd int, off int64, n int64, flags int) (errno int) //sys Truncate(path string, length int64) (errno int) = SYS_TRUNCATE64 diff --git a/src/pkg/syscall/syscall_linux_amd64.go b/src/pkg/syscall/syscall_linux_amd64.go index 0b8ccb0d5d..ae108bd184 100644 --- a/src/pkg/syscall/syscall_linux_amd64.go +++ b/src/pkg/syscall/syscall_linux_amd64.go @@ -30,6 +30,7 @@ package syscall //sys Setresuid(ruid int, euid int, suid int) (errno int) //sys Setreuid(ruid int, euid int) (errno int) //sys Shutdown(fd int, how int) (errno int) +//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, errno int) //sys Stat(path string, stat *Stat_t) (errno int) //sys Statfs(path string, buf *Statfs_t) (errno int) //sys SyncFileRange(fd int, off int64, n int64, flags int) (errno int) diff --git a/src/pkg/syscall/syscall_linux_arm.go b/src/pkg/syscall/syscall_linux_arm.go index c567bcec1c..1fc7a7b183 100644 --- a/src/pkg/syscall/syscall_linux_arm.go +++ b/src/pkg/syscall/syscall_linux_arm.go @@ -88,6 +88,7 @@ func Seek(fd int, offset int64, whence int) (newoffset int64, errno int) //sys Setresuid(ruid int, euid int, suid int) (errno int) //sys Setreuid(ruid int, euid int) (errno int) //sys Shutdown(fd int, how int) (errno int) +//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, errno int) //sys Stat(path string, stat *Stat_t) (errno int) = SYS_STAT64 //sys Statfs(path string, buf *Statfs_t) (errno int) = SYS_STATFS64 //sys Truncate(path string, length int64) (errno int) = SYS_TRUNCATE64 diff --git a/src/pkg/syscall/zsyscall_linux_386.go b/src/pkg/syscall/zsyscall_linux_386.go index 1d0c1c1c01..aa8c41a312 100644 --- a/src/pkg/syscall/zsyscall_linux_386.go +++ b/src/pkg/syscall/zsyscall_linux_386.go @@ -579,15 +579,6 @@ func Setuid(uid int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, errno int) { - r0, r1, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags)) - n = int64(int64(r1)<<32 | int64(r0)) - errno = int(e1) - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Symlink(oldpath string, newpath string) (errno int) { _, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(StringBytePtr(oldpath))), uintptr(unsafe.Pointer(StringBytePtr(newpath))), 0) errno = int(e1) @@ -910,6 +901,15 @@ func Setreuid(ruid int, euid int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, errno int) { + r0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags)) + n = int(r0) + errno = int(e1) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Stat(path string, stat *Stat_t) (errno int) { _, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(stat)), 0) errno = int(e1) diff --git a/src/pkg/syscall/zsyscall_linux_amd64.go b/src/pkg/syscall/zsyscall_linux_amd64.go index 94cdc023c2..2759c5c8bb 100644 --- a/src/pkg/syscall/zsyscall_linux_amd64.go +++ b/src/pkg/syscall/zsyscall_linux_amd64.go @@ -579,15 +579,6 @@ func Setuid(uid int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, errno int) { - r0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags)) - n = int64(r0) - errno = int(e1) - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Symlink(oldpath string, newpath string) (errno int) { _, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(StringBytePtr(oldpath))), uintptr(unsafe.Pointer(StringBytePtr(newpath))), 0) errno = int(e1) @@ -952,6 +943,15 @@ func Shutdown(fd int, how int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, errno int) { + r0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags)) + n = int64(r0) + errno = int(e1) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Stat(path string, stat *Stat_t) (errno int) { _, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(stat)), 0) errno = int(e1) diff --git a/src/pkg/syscall/zsyscall_linux_arm.go b/src/pkg/syscall/zsyscall_linux_arm.go index 67d5e4b6a5..b2e27c7965 100644 --- a/src/pkg/syscall/zsyscall_linux_arm.go +++ b/src/pkg/syscall/zsyscall_linux_arm.go @@ -1,4 +1,4 @@ -// mksyscall.sh -b32 syscall_linux.go syscall_linux_arm.go +// mksyscall.sh -l32 syscall_linux.go syscall_linux_arm.go // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT package syscall @@ -209,7 +209,7 @@ func Faccessat(dirfd int, path string, mode uint32, flags int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fallocate(fd int, mode uint32, off int64, len int64) (errno int) { - _, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off>>32), uintptr(off), uintptr(len>>32), uintptr(len)) + _, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(off>>32), uintptr(len), uintptr(len>>32)) errno = int(e1) return } @@ -579,15 +579,6 @@ func Setuid(uid int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, errno int) { - r0, r1, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags)) - n = int64(int64(r0)<<32 | int64(r1)) - errno = int(e1) - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Symlink(oldpath string, newpath string) (errno int) { _, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(StringBytePtr(oldpath))), uintptr(unsafe.Pointer(StringBytePtr(newpath))), 0) errno = int(e1) @@ -613,7 +604,7 @@ func Sysinfo(info *Sysinfo_t) (errno int) { func Tee(rfd int, wfd int, len int, flags int) (n int64, errno int) { r0, r1, e1 := Syscall6(SYS_TEE, uintptr(rfd), uintptr(wfd), uintptr(len), uintptr(flags), 0, 0) - n = int64(int64(r0)<<32 | int64(r1)) + n = int64(int64(r1)<<32 | int64(r0)) errno = int(e1) return } @@ -890,7 +881,7 @@ func Fstatfs(fd int, buf *Statfs_t) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ftruncate(fd int, length int64) (errno int) { - _, _, e1 := Syscall(SYS_FTRUNCATE64, uintptr(fd), uintptr(length>>32), uintptr(length)) + _, _, e1 := Syscall(SYS_FTRUNCATE64, uintptr(fd), uintptr(length), uintptr(length>>32)) errno = int(e1) return } @@ -1026,6 +1017,15 @@ func Shutdown(fd int, how int) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, errno int) { + r0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags)) + n = int(r0) + errno = int(e1) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Stat(path string, stat *Stat_t) (errno int) { _, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(stat)), 0) errno = int(e1) @@ -1043,7 +1043,7 @@ func Statfs(path string, buf *Statfs_t) (errno int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Truncate(path string, length int64) (errno int) { - _, _, e1 := Syscall(SYS_TRUNCATE64, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(length>>32), uintptr(length)) + _, _, e1 := Syscall(SYS_TRUNCATE64, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(length), uintptr(length>>32)) errno = int(e1) return } |