1
0
mirror of https://github.com/golang/go synced 2024-11-19 09:24:39 -07:00

syscall: correct Linux Splice definition

Fixes #1376.

R=r
CC=golang-dev
https://golang.org/cl/3869042
This commit is contained in:
Russ Cox 2011-01-05 14:35:07 -05:00
parent ddc2710d69
commit 189d4ff776
7 changed files with 35 additions and 33 deletions

View File

@ -721,7 +721,6 @@ func PtraceDetach(pid int) (errno int) { return ptrace(PTRACE_DETACH, pid, 0, 0)
//sys Setsid() (pid int, errno int) //sys Setsid() (pid int, errno int)
//sys Settimeofday(tv *Timeval) (errno int) //sys Settimeofday(tv *Timeval) (errno int)
//sys Setuid(uid int) (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 Symlink(oldpath string, newpath string) (errno int)
//sys Sync() //sys Sync()
//sys Sysinfo(info *Sysinfo_t) (errno int) //sys Sysinfo(info *Sysinfo_t) (errno int)

View File

@ -48,6 +48,7 @@ func NsecToTimeval(nsec int64) (tv Timeval) {
//sys Setresgid(rgid int, egid int, sgid int) (errno int) = SYS_SETRESGID32 //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 Setresuid(ruid int, euid int, suid int) (errno int) = SYS_SETRESUID32
//sys Setreuid(ruid int, euid int) (errno int) = SYS_SETREUID32 //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 Stat(path string, stat *Stat_t) (errno int) = SYS_STAT64
//sys SyncFileRange(fd int, off int64, n int64, flags int) (errno int) //sys SyncFileRange(fd int, off int64, n int64, flags int) (errno int)
//sys Truncate(path string, length int64) (errno int) = SYS_TRUNCATE64 //sys Truncate(path string, length int64) (errno int) = SYS_TRUNCATE64

View File

@ -30,6 +30,7 @@ package syscall
//sys Setresuid(ruid int, euid int, suid int) (errno int) //sys Setresuid(ruid int, euid int, suid int) (errno int)
//sys Setreuid(ruid int, euid int) (errno int) //sys Setreuid(ruid int, euid int) (errno int)
//sys Shutdown(fd int, how 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 Stat(path string, stat *Stat_t) (errno int)
//sys Statfs(path string, buf *Statfs_t) (errno int) //sys Statfs(path string, buf *Statfs_t) (errno int)
//sys SyncFileRange(fd int, off int64, n int64, flags int) (errno int) //sys SyncFileRange(fd int, off int64, n int64, flags int) (errno int)

View File

@ -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 Setresuid(ruid int, euid int, suid int) (errno int)
//sys Setreuid(ruid int, euid int) (errno int) //sys Setreuid(ruid int, euid int) (errno int)
//sys Shutdown(fd int, how 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 Stat(path string, stat *Stat_t) (errno int) = SYS_STAT64
//sys Statfs(path string, buf *Statfs_t) (errno int) = SYS_STATFS64 //sys Statfs(path string, buf *Statfs_t) (errno int) = SYS_STATFS64
//sys Truncate(path string, length int64) (errno int) = SYS_TRUNCATE64 //sys Truncate(path string, length int64) (errno int) = SYS_TRUNCATE64

View File

@ -579,15 +579,6 @@ func Setuid(uid int) (errno int) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT // 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) { func Symlink(oldpath string, newpath string) (errno int) {
_, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(StringBytePtr(oldpath))), uintptr(unsafe.Pointer(StringBytePtr(newpath))), 0) _, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(StringBytePtr(oldpath))), uintptr(unsafe.Pointer(StringBytePtr(newpath))), 0)
errno = int(e1) 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 // 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) { func Stat(path string, stat *Stat_t) (errno int) {
_, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(stat)), 0) _, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(stat)), 0)
errno = int(e1) errno = int(e1)

View File

@ -579,15 +579,6 @@ func Setuid(uid int) (errno int) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT // 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) { func Symlink(oldpath string, newpath string) (errno int) {
_, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(StringBytePtr(oldpath))), uintptr(unsafe.Pointer(StringBytePtr(newpath))), 0) _, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(StringBytePtr(oldpath))), uintptr(unsafe.Pointer(StringBytePtr(newpath))), 0)
errno = int(e1) 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 // 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) { func Stat(path string, stat *Stat_t) (errno int) {
_, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(stat)), 0) _, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(stat)), 0)
errno = int(e1) errno = int(e1)

View File

@ -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 // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
package syscall 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 // 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) { 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) errno = int(e1)
return return
} }
@ -579,15 +579,6 @@ func Setuid(uid int) (errno int) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT // 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) { func Symlink(oldpath string, newpath string) (errno int) {
_, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(StringBytePtr(oldpath))), uintptr(unsafe.Pointer(StringBytePtr(newpath))), 0) _, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(StringBytePtr(oldpath))), uintptr(unsafe.Pointer(StringBytePtr(newpath))), 0)
errno = int(e1) 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) { 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) 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) errno = int(e1)
return 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 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Ftruncate(fd int, length int64) (errno int) { 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) errno = int(e1)
return 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 // 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) { func Stat(path string, stat *Stat_t) (errno int) {
_, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(stat)), 0) _, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(stat)), 0)
errno = int(e1) 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 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Truncate(path string, length int64) (errno int) { 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) errno = int(e1)
return return
} }