[sys] unix: add CopyFileRange syscall

100 views
Skip to first unread message

Rob Pike (Gerrit)

unread,
Apr 7, 2017, 5:13:05 PM4/7/17
to Derek McGowan, Rob Pike, golang-co...@googlegroups.com

Rob Pike posted comments on this change.

View Change

Patch set 1:Code-Review +1

The Linux kernel is a wonderment.

    To view, visit change 39992. To unsubscribe, visit settings.

    Gerrit-Project: sys
    Gerrit-Branch: master
    Gerrit-MessageType: comment
    Gerrit-Change-Id: Id365f1e5d4d5ddf7159478e3a13084c9576ebd5c
    Gerrit-Change-Number: 39992
    Gerrit-PatchSet: 1
    Gerrit-Owner: Derek McGowan <dm...@drizz.net>
    Gerrit-Reviewer: Rob Pike <r...@golang.org>
    Gerrit-Comment-Date: Fri, 07 Apr 2017 21:13:04 +0000
    Gerrit-HasComments: No
    Gerrit-HasLabels: Yes

    Ian Lance Taylor (Gerrit)

    unread,
    Apr 7, 2017, 5:19:50 PM4/7/17
    to Derek McGowan, Rob Pike, golang-co...@googlegroups.com

    Ian Lance Taylor posted comments on this change.

    View Change

    Patch set 1:

    (1 comment)

    • File unix/syscall_linux_amd64.go:

      • Patch Set #1, Line 9: int64

        It's simpler for programmers if we use the same types on all systems, which means the type of the result parameter n should be `int` in all cases. (Or `int64` in all cases, but since the function returns `ssize_t` I think that `int` will work fine.)

    To view, visit change 39992. To unsubscribe, visit settings.

    Gerrit-Project: sys
    Gerrit-Branch: master
    Gerrit-MessageType: comment
    Gerrit-Change-Id: Id365f1e5d4d5ddf7159478e3a13084c9576ebd5c
    Gerrit-Change-Number: 39992
    Gerrit-PatchSet: 1
    Gerrit-Owner: Derek McGowan <dm...@drizz.net>
    Gerrit-Reviewer: Rob Pike <r...@golang.org>
    Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
    Gerrit-Comment-Date: Fri, 07 Apr 2017 21:19:49 +0000
    Gerrit-HasComments: Yes
    Gerrit-HasLabels: No

    Derek McGowan (Gerrit)

    unread,
    Apr 7, 2017, 7:00:09 PM4/7/17
    to Ian Lance Taylor, Rob Pike, golang-co...@googlegroups.com

    Derek McGowan has uploaded this change for review.

    View Change

    unix: add CopyFileRange syscall

    Introduces the CopyFileRange syscall which first appears in kernel 4.5.
    Allows copying file content between file descriptors within the kernel
    without transfering data to user space. This syscall also allows the
    kernel to take advantage of reflinking or other fast copy methods on
    supported file systems.
    http://man7.org/linux/man-pages/man2/copy_file_range.2.html

    Change-Id: Id365f1e5d4d5ddf7159478e3a13084c9576ebd5c
    ---
    M unix/syscall_linux_386.go
    M unix/syscall_linux_amd64.go
    M unix/syscall_linux_arm.go
    M unix/syscall_linux_arm64.go
    M unix/syscall_linux_mips64x.go
    M unix/syscall_linux_mipsx.go
    M unix/syscall_linux_ppc64x.go
    M unix/syscall_linux_s390x.go
    M unix/syscall_linux_sparc64.go
    M unix/zsyscall_linux_386.go
    M unix/zsyscall_linux_amd64.go
    M unix/zsyscall_linux_arm.go
    M unix/zsyscall_linux_arm64.go
    M unix/zsyscall_linux_mips.go
    M unix/zsyscall_linux_mips64.go
    M unix/zsyscall_linux_mips64le.go
    M unix/zsyscall_linux_mipsle.go
    M unix/zsyscall_linux_ppc64.go
    M unix/zsyscall_linux_ppc64le.go
    M unix/zsyscall_linux_s390x.go
    M unix/zsyscall_linux_sparc64.go
    21 files changed, 141 insertions(+), 0 deletions(-)

    diff --git a/unix/syscall_linux_386.go b/unix/syscall_linux_386.go
    index 2b881b9..eb72611 100644
    --- a/unix/syscall_linux_386.go
    +++ b/unix/syscall_linux_386.go
    @@ -59,6 +59,7 @@

    // 64-bit file system and 32-bit uid calls
    // (386 default is 32-bit file system and 16-bit uid).
    +//sys CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error)
    //sys Dup2(oldfd int, newfd int) (err error)
    //sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64_64
    //sys Fchown(fd int, uid int, gid int) (err error) = SYS_FCHOWN32
    diff --git a/unix/syscall_linux_amd64.go b/unix/syscall_linux_amd64.go
    index 9516a3f..5271602 100644
    --- a/unix/syscall_linux_amd64.go
    +++ b/unix/syscall_linux_amd64.go
    @@ -6,6 +6,7 @@

    package unix

    +//sys CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
    //sys Dup2(oldfd int, newfd int) (err error)
    //sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
    //sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
    diff --git a/unix/syscall_linux_arm.go b/unix/syscall_linux_arm.go
    index 71d8702..0a242b2 100644
    --- a/unix/syscall_linux_arm.go
    +++ b/unix/syscall_linux_arm.go
    @@ -83,6 +83,7 @@

    // 64-bit file system and 32-bit uid calls
    // (16-bit uid calls are not always supported in newer kernels)
    +//sys CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error)
    //sys Dup2(oldfd int, newfd int) (err error)
    //sys Fchown(fd int, uid int, gid int) (err error) = SYS_FCHOWN32
    //sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64
    diff --git a/unix/syscall_linux_arm64.go b/unix/syscall_linux_arm64.go
    index 4a13639..2fdb003 100644
    --- a/unix/syscall_linux_arm64.go
    +++ b/unix/syscall_linux_arm64.go
    @@ -6,6 +6,7 @@

    package unix

    +//sys CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
    //sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) = SYS_EPOLL_PWAIT
    //sys Fchown(fd int, uid int, gid int) (err error)
    //sys Fstat(fd int, stat *Stat_t) (err error)
    diff --git a/unix/syscall_linux_mips64x.go b/unix/syscall_linux_mips64x.go
    index 8119fde..e82adfa 100644
    --- a/unix/syscall_linux_mips64x.go
    +++ b/unix/syscall_linux_mips64x.go
    @@ -7,6 +7,7 @@

    package unix

    +//sys CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
    //sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
    //sys Fchown(fd int, uid int, gid int) (err error)
    //sys Fstatfs(fd int, buf *Statfs_t) (err error)
    diff --git a/unix/syscall_linux_mipsx.go b/unix/syscall_linux_mipsx.go
    index be77d24..f0cc164 100644
    --- a/unix/syscall_linux_mipsx.go
    +++ b/unix/syscall_linux_mipsx.go
    @@ -14,6 +14,7 @@

    func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)

    +//sys CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
    //sys Dup2(oldfd int, newfd int) (err error)
    //sys Fchown(fd int, uid int, gid int) (err error)
    //sys Ftruncate(fd int, length int64) (err error) = SYS_FTRUNCATE64
    diff --git a/unix/syscall_linux_ppc64x.go b/unix/syscall_linux_ppc64x.go
    index 60770f6..6cfc350 100644
    --- a/unix/syscall_linux_ppc64x.go
    +++ b/unix/syscall_linux_ppc64x.go
    @@ -7,6 +7,7 @@

    package unix

    +//sys CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
    //sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
    //sys Dup2(oldfd int, newfd int) (err error)
    //sys Fchown(fd int, uid int, gid int) (err error)
    diff --git a/unix/syscall_linux_s390x.go b/unix/syscall_linux_s390x.go
    index 1708a4b..b764343 100644
    --- a/unix/syscall_linux_s390x.go
    +++ b/unix/syscall_linux_s390x.go
    @@ -10,6 +10,7 @@
    "unsafe"
    )

    +//sys CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
    //sys Dup2(oldfd int, newfd int) (err error)
    //sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
    //sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
    diff --git a/unix/syscall_linux_sparc64.go b/unix/syscall_linux_sparc64.go
    index 20b7454..49e64a8 100644
    --- a/unix/syscall_linux_sparc64.go
    +++ b/unix/syscall_linux_sparc64.go
    @@ -11,6 +11,7 @@
    "syscall"
    )

    +//sys CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
    //sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
    //sys Dup2(oldfd int, newfd int) (err error)
    //sys Fchown(fd int, uid int, gid int) (err error)
    diff --git a/unix/zsyscall_linux_386.go b/unix/zsyscall_linux_386.go
    index d4ec806..69988d7 100644
    --- a/unix/zsyscall_linux_386.go
    +++ b/unix/zsyscall_linux_386.go
    @@ -1214,6 +1214,17 @@

    // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

    +func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) {
    + r0, _, e1 := Syscall6(SYS_COPY_FILE_RANGE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))
    + n = int(r0)
    + if e1 != 0 {
    + err = errnoErr(e1)
    + }
    + return
    +}
    +
    +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
    +
    func Dup2(oldfd int, newfd int) (err error) {
    _, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
    if e1 != 0 {
    diff --git a/unix/zsyscall_linux_amd64.go b/unix/zsyscall_linux_amd64.go
    index 8b2e87d..85b6484 100644
    --- a/unix/zsyscall_linux_amd64.go
    +++ b/unix/zsyscall_linux_amd64.go
    @@ -1194,6 +1194,17 @@

    // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

    +func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) {
    + r0, _, e1 := Syscall6(SYS_COPY_FILE_RANGE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))
    + n = int64(r0)
    + if e1 != 0 {
    + err = errnoErr(e1)
    + }
    + return
    +}
    +
    +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
    +
    func Dup2(oldfd int, newfd int) (err error) {
    _, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
    if e1 != 0 {
    diff --git a/unix/zsyscall_linux_arm.go b/unix/zsyscall_linux_arm.go
    index 82d36a4..f4364ba 100644
    --- a/unix/zsyscall_linux_arm.go
    +++ b/unix/zsyscall_linux_arm.go
    @@ -1383,6 +1383,17 @@

    // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

    +func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) {
    + r0, _, e1 := Syscall6(SYS_COPY_FILE_RANGE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))
    + n = int(r0)
    + if e1 != 0 {
    + err = errnoErr(e1)
    + }
    + return
    +}
    +
    +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
    +
    func Dup2(oldfd int, newfd int) (err error) {
    _, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
    if e1 != 0 {
    diff --git a/unix/zsyscall_linux_arm64.go b/unix/zsyscall_linux_arm64.go
    index f6cc320..ce85de3 100644
    --- a/unix/zsyscall_linux_arm64.go
    +++ b/unix/zsyscall_linux_arm64.go
    @@ -1194,6 +1194,17 @@

    // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

    +func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) {
    + r0, _, e1 := Syscall6(SYS_COPY_FILE_RANGE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))
    + n = int64(r0)
    + if e1 != 0 {
    + err = errnoErr(e1)
    + }
    + return
    +}
    +
    +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
    +
    func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
    var _p0 unsafe.Pointer
    if len(events) > 0 {
    diff --git a/unix/zsyscall_linux_mips.go b/unix/zsyscall_linux_mips.go
    index f91afb4..087d32a 100644
    --- a/unix/zsyscall_linux_mips.go
    +++ b/unix/zsyscall_linux_mips.go
    @@ -1194,6 +1194,17 @@

    // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

    +func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) {
    + r0, r1, e1 := Syscall6(SYS_COPY_FILE_RANGE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))
    + n = int64(int64(r0)<<32 | int64(r1))
    + if e1 != 0 {
    + err = errnoErr(e1)
    + }
    + return
    +}
    +
    +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
    +
    func Dup2(oldfd int, newfd int) (err error) {
    _, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
    if e1 != 0 {
    diff --git a/unix/zsyscall_linux_mips64.go b/unix/zsyscall_linux_mips64.go
    index 657d11e..239cca0 100644
    --- a/unix/zsyscall_linux_mips64.go
    +++ b/unix/zsyscall_linux_mips64.go
    @@ -1194,6 +1194,17 @@

    // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

    +func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) {
    + r0, _, e1 := Syscall6(SYS_COPY_FILE_RANGE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))
    + n = int64(r0)
    + if e1 != 0 {
    + err = errnoErr(e1)
    + }
    + return
    +}
    +
    +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
    +
    func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
    var _p0 unsafe.Pointer
    if len(events) > 0 {
    diff --git a/unix/zsyscall_linux_mips64le.go b/unix/zsyscall_linux_mips64le.go
    index 31ff177..a70483e 100644
    --- a/unix/zsyscall_linux_mips64le.go
    +++ b/unix/zsyscall_linux_mips64le.go
    @@ -1194,6 +1194,17 @@

    // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

    +func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) {
    + r0, _, e1 := Syscall6(SYS_COPY_FILE_RANGE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))
    + n = int64(r0)
    + if e1 != 0 {
    + err = errnoErr(e1)
    + }
    + return
    +}
    +
    +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
    +
    func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
    var _p0 unsafe.Pointer
    if len(events) > 0 {
    diff --git a/unix/zsyscall_linux_mipsle.go b/unix/zsyscall_linux_mipsle.go
    index 797e633..9bf7516 100644
    --- a/unix/zsyscall_linux_mipsle.go
    +++ b/unix/zsyscall_linux_mipsle.go
    @@ -1194,6 +1194,17 @@

    // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

    +func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) {
    + r0, r1, e1 := Syscall6(SYS_COPY_FILE_RANGE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))
    + n = int64(int64(r1)<<32 | int64(r0))
    + if e1 != 0 {
    + err = errnoErr(e1)
    + }
    + return
    +}
    +
    +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
    +
    func Dup2(oldfd int, newfd int) (err error) {
    _, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
    if e1 != 0 {
    diff --git a/unix/zsyscall_linux_ppc64.go b/unix/zsyscall_linux_ppc64.go
    index 307dbb5..23a2f23 100644
    --- a/unix/zsyscall_linux_ppc64.go
    +++ b/unix/zsyscall_linux_ppc64.go
    @@ -1194,6 +1194,17 @@

    // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

    +func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) {
    + r0, _, e1 := Syscall6(SYS_COPY_FILE_RANGE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))
    + n = int64(r0)
    + if e1 != 0 {
    + err = errnoErr(e1)
    + }
    + return
    +}
    +
    +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
    +
    func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
    var _p0 unsafe.Pointer
    if len(events) > 0 {
    diff --git a/unix/zsyscall_linux_ppc64le.go b/unix/zsyscall_linux_ppc64le.go
    index f458a63..8d2f41e 100644
    --- a/unix/zsyscall_linux_ppc64le.go
    +++ b/unix/zsyscall_linux_ppc64le.go
    @@ -1194,6 +1194,17 @@

    // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

    +func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) {
    + r0, _, e1 := Syscall6(SYS_COPY_FILE_RANGE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))
    + n = int64(r0)
    + if e1 != 0 {
    + err = errnoErr(e1)
    + }
    + return
    +}
    +
    +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
    +
    func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
    var _p0 unsafe.Pointer
    if len(events) > 0 {
    diff --git a/unix/zsyscall_linux_s390x.go b/unix/zsyscall_linux_s390x.go
    index b1d5a9b..048feba 100644
    --- a/unix/zsyscall_linux_s390x.go
    +++ b/unix/zsyscall_linux_s390x.go
    @@ -1194,6 +1194,17 @@

    // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

    +func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) {
    + r0, _, e1 := Syscall6(SYS_COPY_FILE_RANGE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))
    + n = int64(r0)
    + if e1 != 0 {
    + err = errnoErr(e1)
    + }
    + return
    +}
    +
    +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
    +
    func Dup2(oldfd int, newfd int) (err error) {
    _, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
    if e1 != 0 {
    diff --git a/unix/zsyscall_linux_sparc64.go b/unix/zsyscall_linux_sparc64.go
    index ce3ec58..6dc9ad7 100644
    --- a/unix/zsyscall_linux_sparc64.go
    +++ b/unix/zsyscall_linux_sparc64.go
    @@ -1194,6 +1194,17 @@

    // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

    +func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) {
    + r0, _, e1 := Syscall6(SYS_COPY_FILE_RANGE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))
    + n = int64(r0)
    + if e1 != 0 {
    + err = errnoErr(e1)
    + }
    + return
    +}
    +
    +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
    +
    func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
    var _p0 unsafe.Pointer
    if len(events) > 0 {

    To view, visit change 39992. To unsubscribe, visit settings.

    Gerrit-Project: sys
    Gerrit-Branch: master
    Gerrit-MessageType: newchange

    Derek McGowan (Gerrit)

    unread,
    Apr 7, 2017, 7:39:13 PM4/7/17
    to Ian Lance Taylor, Rob Pike, golang-co...@googlegroups.com

    Derek McGowan posted comments on this change.

    View Change

    Patch set 1:

    (1 comment)

    To view, visit change 39992. To unsubscribe, visit settings.

    Gerrit-Project: sys
    Gerrit-Branch: master
    Gerrit-MessageType: comment
    Gerrit-Change-Id: Id365f1e5d4d5ddf7159478e3a13084c9576ebd5c
    Gerrit-Change-Number: 39992
    Gerrit-PatchSet: 1
    Gerrit-Owner: Derek McGowan <dm...@drizz.net>
    Gerrit-Reviewer: Derek McGowan <dm...@drizz.net>
    Gerrit-Reviewer: Rob Pike <r...@golang.org>
    Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
    Gerrit-Comment-Date: Fri, 07 Apr 2017 23:39:11 +0000
    Gerrit-HasComments: Yes
    Gerrit-HasLabels: No

    Ian Lance Taylor (Gerrit)

    unread,
    Apr 7, 2017, 8:50:26 PM4/7/17
    to Derek McGowan, Rob Pike, golang-co...@googlegroups.com

    Ian Lance Taylor posted comments on this change.

    View Change

    Patch set 1:

    (1 comment)

      • I made sure to use the same interface that Splice is using since they have

        Seems to me that Splice is broken, and I can't see a reason for us to emulate a broken approach.

        Why don't you send an e-mail to golang-dev to see if there are any other opinions.

    To view, visit change 39992. To unsubscribe, visit settings.

    Gerrit-Project: sys
    Gerrit-Branch: master
    Gerrit-MessageType: comment
    Gerrit-Change-Id: Id365f1e5d4d5ddf7159478e3a13084c9576ebd5c
    Gerrit-Change-Number: 39992
    Gerrit-PatchSet: 1
    Gerrit-Owner: Derek McGowan <dm...@drizz.net>
    Gerrit-Reviewer: Derek McGowan <dm...@drizz.net>
    Gerrit-Reviewer: Rob Pike <r...@golang.org>
    Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
    Gerrit-Comment-Date: Sat, 08 Apr 2017 00:50:24 +0000
    Gerrit-HasComments: Yes
    Gerrit-HasLabels: No

    Derek McGowan (Gerrit)

    unread,
    Apr 9, 2017, 10:18:56 AM4/9/17
    to Rob Pike, Ian Lance Taylor, golang-co...@googlegroups.com

    Derek McGowan uploaded patch set #2 to this change.

    To view, visit change 39992. To unsubscribe, visit settings.

    Gerrit-Project: sys
    Gerrit-Branch: master
    Gerrit-MessageType: newpatchset
    Gerrit-Change-Id: Id365f1e5d4d5ddf7159478e3a13084c9576ebd5c
    Gerrit-Change-Number: 39992
    Gerrit-PatchSet: 2

    Derek McGowan (Gerrit)

    unread,
    Apr 9, 2017, 10:22:29 AM4/9/17
    to Ian Lance Taylor, Rob Pike, golang-co...@googlegroups.com

    Derek McGowan posted comments on this change.

    View Change

    Patch set 2:

    Looked more at some other commands, I agree Splice is wrong here. The return type should match the len type, such is the case with sendfile. Updated here to use int. I can still solicit feedback about making Splice correct but I think you are right here. Thanks!

    http://man7.org/linux/man-pages/man2/sendfile.2.html

      To view, visit change 39992. To unsubscribe, visit settings.

      Gerrit-Project: sys
      Gerrit-Branch: master
      Gerrit-MessageType: comment
      Gerrit-Change-Id: Id365f1e5d4d5ddf7159478e3a13084c9576ebd5c
      Gerrit-Change-Number: 39992
      Gerrit-PatchSet: 2
      Gerrit-Owner: Derek McGowan <dm...@drizz.net>
      Gerrit-Reviewer: Derek McGowan <dm...@drizz.net>
      Gerrit-Reviewer: Rob Pike <r...@golang.org>
      Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Comment-Date: Sun, 09 Apr 2017 14:22:28 +0000
      Gerrit-HasComments: No
      Gerrit-HasLabels: No

      Brad Fitzpatrick (Gerrit)

      unread,
      Apr 9, 2017, 1:17:33 PM4/9/17
      to Derek McGowan, Brad Fitzpatrick, Ian Lance Taylor, Rob Pike, golang-co...@googlegroups.com

      Brad Fitzpatrick posted comments on this change.

      View Change

      Patch set 2:Code-Review -2

      Temporary -2 to hold this until https://go-review.googlesource.com/c/37943/ is in first.

      (But I agree we should add CopyFileRange)

        To view, visit change 39992. To unsubscribe, visit settings.

        Gerrit-Project: sys
        Gerrit-Branch: master
        Gerrit-MessageType: comment
        Gerrit-Change-Id: Id365f1e5d4d5ddf7159478e3a13084c9576ebd5c
        Gerrit-Change-Number: 39992
        Gerrit-PatchSet: 2
        Gerrit-Owner: Derek McGowan <dm...@drizz.net>
        Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
        Gerrit-Reviewer: Derek McGowan <dm...@drizz.net>
        Gerrit-Reviewer: Rob Pike <r...@golang.org>
        Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
        Gerrit-Comment-Date: Sun, 09 Apr 2017 17:17:31 +0000
        Gerrit-HasComments: No
        Gerrit-HasLabels: Yes

        Brad Fitzpatrick (Gerrit)

        unread,
        Apr 20, 2017, 8:53:32 PM4/20/17
        to Derek McGowan, Brad Fitzpatrick, Ian Lance Taylor, Rob Pike, golang-co...@googlegroups.com

        Brad Fitzpatrick posted comments on this change.

        View Change

        Patch set 2:-Code-Review

        Okay, that other CL is now in. Feel free to rebase this and continue.

          To view, visit change 39992. To unsubscribe, visit settings.

          Gerrit-Project: sys
          Gerrit-Branch: master
          Gerrit-MessageType: comment
          Gerrit-Change-Id: Id365f1e5d4d5ddf7159478e3a13084c9576ebd5c
          Gerrit-Change-Number: 39992
          Gerrit-PatchSet: 2
          Gerrit-Owner: Derek McGowan <dm...@drizz.net>
          Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
          Gerrit-Reviewer: Derek McGowan <dm...@drizz.net>
          Gerrit-Reviewer: Rob Pike <r...@golang.org>
          Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
          Gerrit-Comment-Date: Fri, 21 Apr 2017 00:53:31 +0000
          Gerrit-HasComments: No
          Gerrit-HasLabels: Yes

          Joe Richey (Gerrit)

          unread,
          May 11, 2017, 2:29:06 PM5/11/17
          to Derek McGowan, Brad Fitzpatrick, Ian Lance Taylor, Rob Pike, golang-co...@googlegroups.com

          Joe Richey posted comments on this change.

          View Change

          Patch set 3:

          As the change here is the same for each Linux architecture, the syscall annotation should just be added to syscall_linux.go under the "Direct Access" section.

          After rebasing, making that change, and running:

          (For the 11 supported archetectures)
          ./mkall.sh
          (For sparc64 using "GOARCH=sparc64 ./mkall.sh -n")
          GOARCH=sparc64 ./mksyscall.pl -tags linux,sparc64 syscall_linux.go syscall_linux_sparc64.go |gofmt >zsyscall_linux_sparc64.go

          It looks like the same stuff is still generated.

            To view, visit change 39992. To unsubscribe, visit settings.

            Gerrit-Project: sys
            Gerrit-Branch: master
            Gerrit-MessageType: comment
            Gerrit-Change-Id: Id365f1e5d4d5ddf7159478e3a13084c9576ebd5c
            Gerrit-Change-Number: 39992
            Gerrit-PatchSet: 3
            Gerrit-Owner: Derek McGowan <dm...@drizz.net>
            Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
            Gerrit-Reviewer: Derek McGowan <dm...@drizz.net>
            Gerrit-Reviewer: Rob Pike <r...@golang.org>
            Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
            Gerrit-CC: Joe Richey <joer...@google.com>
            Gerrit-Comment-Date: Thu, 11 May 2017 18:28:59 +0000
            Gerrit-HasComments: No
            Gerrit-HasLabels: No

            Derek McGowan (Gerrit)

            unread,
            May 12, 2017, 1:59:35 PM5/12/17
            to Rob Pike, Brad Fitzpatrick, Joe Richey, Ian Lance Taylor, golang-co...@googlegroups.com

            Derek McGowan uploaded patch set #4 to this change.

            View Change

            unix: add CopyFileRange syscall

            Introduces the CopyFileRange syscall which first appears in kernel 4.5.
            Allows copying file content between file descriptors within the kernel
            without transfering data to user space. This syscall also allows the
            kernel to take advantage of reflinking or other fast copy methods on
            supported file systems.
            http://man7.org/linux/man-pages/man2/copy_file_range.2.html

            Change-Id: Id365f1e5d4d5ddf7159478e3a13084c9576ebd5c
            ---
            M unix/syscall_linux.go

            M unix/zsyscall_linux_386.go
            M unix/zsyscall_linux_amd64.go
            M unix/zsyscall_linux_arm.go
            M unix/zsyscall_linux_arm64.go
            M unix/zsyscall_linux_mips.go
            M unix/zsyscall_linux_mips64.go
            M unix/zsyscall_linux_mips64le.go
            M unix/zsyscall_linux_mipsle.go
            M unix/zsyscall_linux_ppc64.go
            M unix/zsyscall_linux_ppc64le.go
            M unix/zsyscall_linux_s390x.go
            M unix/zsyscall_linux_sparc64.go
            13 files changed, 134 insertions(+), 1 deletion(-)

            To view, visit change 39992. To unsubscribe, visit settings.

            Gerrit-Project: sys
            Gerrit-Branch: master
            Gerrit-MessageType: newpatchset
            Gerrit-Change-Id: Id365f1e5d4d5ddf7159478e3a13084c9576ebd5c
            Gerrit-Change-Number: 39992
            Gerrit-PatchSet: 4

            Derek McGowan (Gerrit)

            unread,
            May 12, 2017, 2:00:23 PM5/12/17
            to Joe Richey, Brad Fitzpatrick, Ian Lance Taylor, Rob Pike, golang-co...@googlegroups.com

            Derek McGowan posted comments on this change.

            View Change

            Patch set 4:

            Patch Set 3:

            As the change here is the same for each Linux architecture, the syscall annotation should just be added to syscall_linux.go under the "Direct Access" section.

            After rebasing, making that change, and running:

            (For the 11 supported archetectures)
            ./mkall.sh
            (For sparc64 using "GOARCH=sparc64 ./mkall.sh -n")
            GOARCH=sparc64 ./mksyscall.pl -tags linux,sparc64 syscall_linux.go syscall_linux_sparc64.go |gofmt >zsyscall_linux_sparc64.go

            It looks like the same stuff is still generated.

            Good catch! Didn't notice that after updating the return type. Updated

              To view, visit change 39992. To unsubscribe, visit settings.

              Gerrit-Project: sys
              Gerrit-Branch: master
              Gerrit-MessageType: comment
              Gerrit-Change-Id: Id365f1e5d4d5ddf7159478e3a13084c9576ebd5c
              Gerrit-Change-Number: 39992
              Gerrit-PatchSet: 4
              Gerrit-Owner: Derek McGowan <dm...@drizz.net>
              Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
              Gerrit-Reviewer: Derek McGowan <dm...@drizz.net>
              Gerrit-Reviewer: Rob Pike <r...@golang.org>
              Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
              Gerrit-CC: Joe Richey <joer...@google.com>
              Gerrit-Comment-Date: Fri, 12 May 2017 18:00:21 +0000
              Gerrit-HasComments: No
              Gerrit-HasLabels: No

              Brad Fitzpatrick (Gerrit)

              unread,
              May 12, 2017, 2:00:41 PM5/12/17
              to Derek McGowan, Brad Fitzpatrick, Joe Richey, Ian Lance Taylor, Rob Pike, golang-co...@googlegroups.com

              Brad Fitzpatrick posted comments on this change.

              View Change

              Patch set 4:Run-TryBot +1Code-Review +2

                To view, visit change 39992. To unsubscribe, visit settings.

                Gerrit-Project: sys
                Gerrit-Branch: master
                Gerrit-MessageType: comment
                Gerrit-Change-Id: Id365f1e5d4d5ddf7159478e3a13084c9576ebd5c
                Gerrit-Change-Number: 39992
                Gerrit-PatchSet: 4
                Gerrit-Owner: Derek McGowan <dm...@drizz.net>
                Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
                Gerrit-Reviewer: Derek McGowan <dm...@drizz.net>
                Gerrit-Reviewer: Rob Pike <r...@golang.org>
                Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
                Gerrit-CC: Joe Richey <joer...@google.com>
                Gerrit-Comment-Date: Fri, 12 May 2017 18:00:39 +0000
                Gerrit-HasComments: No
                Gerrit-HasLabels: Yes

                Gobot Gobot (Gerrit)

                unread,
                May 12, 2017, 2:00:45 PM5/12/17
                to Derek McGowan, Brad Fitzpatrick, Joe Richey, Ian Lance Taylor, Rob Pike, golang-co...@googlegroups.com

                Gobot Gobot posted comments on this change.

                View Change

                Patch set 4:

                TryBots beginning. Status page: https://farmer.golang.org/try?commit=629aa0be

                  To view, visit change 39992. To unsubscribe, visit settings.

                  Gerrit-Project: sys
                  Gerrit-Branch: master
                  Gerrit-MessageType: comment
                  Gerrit-Change-Id: Id365f1e5d4d5ddf7159478e3a13084c9576ebd5c
                  Gerrit-Change-Number: 39992
                  Gerrit-PatchSet: 4
                  Gerrit-Owner: Derek McGowan <dm...@drizz.net>
                  Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
                  Gerrit-Reviewer: Derek McGowan <dm...@drizz.net>
                  Gerrit-Reviewer: Rob Pike <r...@golang.org>
                  Gerrit-CC: Gobot Gobot <go...@golang.org>
                  Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
                  Gerrit-CC: Joe Richey <joer...@google.com>
                  Gerrit-Comment-Date: Fri, 12 May 2017 18:00:43 +0000
                  Gerrit-HasComments: No
                  Gerrit-HasLabels: No

                  Gobot Gobot (Gerrit)

                  unread,
                  May 12, 2017, 2:03:57 PM5/12/17
                  to Derek McGowan, Brad Fitzpatrick, Joe Richey, Ian Lance Taylor, Rob Pike, golang-co...@googlegroups.com

                  Gobot Gobot posted comments on this change.

                  View Change

                  Patch set 4:TryBot-Result +1

                  TryBots are happy.

                    To view, visit change 39992. To unsubscribe, visit settings.

                    Gerrit-Project: sys
                    Gerrit-Branch: master
                    Gerrit-MessageType: comment
                    Gerrit-Change-Id: Id365f1e5d4d5ddf7159478e3a13084c9576ebd5c
                    Gerrit-Change-Number: 39992
                    Gerrit-PatchSet: 4
                    Gerrit-Owner: Derek McGowan <dm...@drizz.net>
                    Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
                    Gerrit-Reviewer: Derek McGowan <dm...@drizz.net>
                    Gerrit-Reviewer: Gobot Gobot <go...@golang.org>
                    Gerrit-Reviewer: Rob Pike <r...@golang.org>
                    Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
                    Gerrit-CC: Joe Richey <joer...@google.com>
                    Gerrit-Comment-Date: Fri, 12 May 2017 18:02:09 +0000
                    Gerrit-HasComments: No
                    Gerrit-HasLabels: Yes

                    Rob Pike (Gerrit)

                    unread,
                    May 12, 2017, 2:04:24 PM5/12/17
                    to Derek McGowan, Rob Pike, Gobot Gobot, Brad Fitzpatrick, Joe Richey, Ian Lance Taylor, golang-co...@googlegroups.com

                    Rob Pike posted comments on this change.

                    View Change

                    Patch set 4:

                    (1 comment)

                    • Commit Message:

                      • Patch Set #4, Line 11: without transfering data to user space. This syscall also allows the

                        transferring

                        Nothing to do now, but please everyone take care when writing CL descriptions. They are important and should be checked carefully.

                        But for the record: this is otherwise a very good CL description: thorough, helpful, with background and references.

                    To view, visit change 39992. To unsubscribe, visit settings.

                    Gerrit-Project: sys
                    Gerrit-Branch: master
                    Gerrit-MessageType: comment
                    Gerrit-Change-Id: Id365f1e5d4d5ddf7159478e3a13084c9576ebd5c
                    Gerrit-Change-Number: 39992
                    Gerrit-PatchSet: 4
                    Gerrit-Owner: Derek McGowan <dm...@drizz.net>
                    Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
                    Gerrit-Reviewer: Derek McGowan <dm...@drizz.net>
                    Gerrit-Reviewer: Gobot Gobot <go...@golang.org>
                    Gerrit-Reviewer: Rob Pike <r...@golang.org>
                    Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
                    Gerrit-CC: Joe Richey <joer...@google.com>
                    Gerrit-Comment-Date: Fri, 12 May 2017 18:04:21 +0000
                    Gerrit-HasComments: Yes
                    Gerrit-HasLabels: No

                    Brad Fitzpatrick (Gerrit)

                    unread,
                    May 12, 2017, 2:09:42 PM5/12/17
                    to Derek McGowan, Brad Fitzpatrick, Rob Pike, Gobot Gobot, Joe Richey, Ian Lance Taylor, golang-co...@googlegroups.com

                    Brad Fitzpatrick posted comments on this change.

                    View Change

                    Patch set 4:

                    (1 comment)

                    To view, visit change 39992. To unsubscribe, visit settings.

                    Gerrit-Project: sys
                    Gerrit-Branch: master
                    Gerrit-MessageType: comment
                    Gerrit-Change-Id: Id365f1e5d4d5ddf7159478e3a13084c9576ebd5c
                    Gerrit-Change-Number: 39992
                    Gerrit-PatchSet: 4
                    Gerrit-Owner: Derek McGowan <dm...@drizz.net>
                    Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
                    Gerrit-Reviewer: Derek McGowan <dm...@drizz.net>
                    Gerrit-Reviewer: Gobot Gobot <go...@golang.org>
                    Gerrit-Reviewer: Rob Pike <r...@golang.org>
                    Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
                    Gerrit-CC: Joe Richey <joer...@google.com>
                    Gerrit-Comment-Date: Fri, 12 May 2017 18:09:40 +0000
                    Gerrit-HasComments: Yes
                    Gerrit-HasLabels: No

                    Brad Fitzpatrick (Gerrit)

                    unread,
                    May 12, 2017, 2:10:11 PM5/12/17
                    to Derek McGowan, Brad Fitzpatrick, Rob Pike, Gobot Gobot, Joe Richey, Ian Lance Taylor, golang-co...@googlegroups.com

                    Brad Fitzpatrick uploaded patch set #5 to the change originally created by Derek McGowan.

                    View Change

                    unix: add Linux CopyFileRange syscall

                    Introduces the CopyFileRange syscall which first appears in Linux 4.5.

                    Allows copying file content between file descriptors within the kernel
                    without transferring data to user space. This syscall also allows the

                    kernel to take advantage of reflinking or other fast copy methods on
                    supported file systems.
                    http://man7.org/linux/man-pages/man2/copy_file_range.2.html

                    Change-Id: Id365f1e5d4d5ddf7159478e3a13084c9576ebd5c
                    ---
                    M unix/syscall_linux.go

                    M unix/zsyscall_linux_386.go
                    M unix/zsyscall_linux_amd64.go
                    M unix/zsyscall_linux_arm.go
                    M unix/zsyscall_linux_arm64.go
                    M unix/zsyscall_linux_mips.go
                    M unix/zsyscall_linux_mips64.go
                    M unix/zsyscall_linux_mips64le.go
                    M unix/zsyscall_linux_mipsle.go
                    M unix/zsyscall_linux_ppc64.go
                    M unix/zsyscall_linux_ppc64le.go
                    M unix/zsyscall_linux_s390x.go
                    M unix/zsyscall_linux_sparc64.go
                    13 files changed, 134 insertions(+), 1 deletion(-)

                    To view, visit change 39992. To unsubscribe, visit settings.

                    Gerrit-Project: sys
                    Gerrit-Branch: master
                    Gerrit-MessageType: newpatchset
                    Gerrit-Change-Id: Id365f1e5d4d5ddf7159478e3a13084c9576ebd5c
                    Gerrit-Change-Number: 39992
                    Gerrit-PatchSet: 5

                    Brad Fitzpatrick (Gerrit)

                    unread,
                    May 12, 2017, 2:10:26 PM5/12/17
                    to Derek McGowan, Brad Fitzpatrick, Rob Pike, Gobot Gobot, Joe Richey, Ian Lance Taylor, golang-co...@googlegroups.com

                    Brad Fitzpatrick posted comments on this change.

                    View Change

                    Patch set 5:

                    I also updated the commit message to clarify this is for Linux.

                      To view, visit change 39992. To unsubscribe, visit settings.

                      Gerrit-Project: sys
                      Gerrit-Branch: master
                      Gerrit-MessageType: comment
                      Gerrit-Change-Id: Id365f1e5d4d5ddf7159478e3a13084c9576ebd5c
                      Gerrit-Change-Number: 39992
                      Gerrit-PatchSet: 5
                      Gerrit-Owner: Derek McGowan <dm...@drizz.net>
                      Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
                      Gerrit-Reviewer: Derek McGowan <dm...@drizz.net>
                      Gerrit-Reviewer: Gobot Gobot <go...@golang.org>
                      Gerrit-Reviewer: Rob Pike <r...@golang.org>
                      Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
                      Gerrit-CC: Joe Richey <joer...@google.com>
                      Gerrit-Comment-Date: Fri, 12 May 2017 18:10:25 +0000
                      Gerrit-HasComments: No
                      Gerrit-HasLabels: No

                      Brad Fitzpatrick (Gerrit)

                      unread,
                      May 12, 2017, 2:10:35 PM5/12/17
                      to Derek McGowan, Brad Fitzpatrick, golang-...@googlegroups.com, Rob Pike, Gobot Gobot, Joe Richey, Ian Lance Taylor, golang-co...@googlegroups.com

                      Brad Fitzpatrick merged this change.

                      View Change

                      Approvals: Brad Fitzpatrick: Looks good to me, approved
                      unix: add Linux CopyFileRange syscall

                      Introduces the CopyFileRange syscall which first appears in Linux 4.5.

                      Allows copying file content between file descriptors within the kernel
                      without transferring data to user space. This syscall also allows the

                      kernel to take advantage of reflinking or other fast copy methods on
                      supported file systems.
                      http://man7.org/linux/man-pages/man2/copy_file_range.2.html

                      Change-Id: Id365f1e5d4d5ddf7159478e3a13084c9576ebd5c
                      Reviewed-on: https://go-review.googlesource.com/39992
                      Reviewed-by: Brad Fitzpatrick <brad...@golang.org>
                      ---
                      M unix/syscall_linux.go

                      M unix/zsyscall_linux_386.go
                      M unix/zsyscall_linux_amd64.go
                      M unix/zsyscall_linux_arm.go
                      M unix/zsyscall_linux_arm64.go
                      M unix/zsyscall_linux_mips.go
                      M unix/zsyscall_linux_mips64.go
                      M unix/zsyscall_linux_mips64le.go
                      M unix/zsyscall_linux_mipsle.go
                      M unix/zsyscall_linux_ppc64.go
                      M unix/zsyscall_linux_ppc64le.go
                      M unix/zsyscall_linux_s390x.go
                      M unix/zsyscall_linux_sparc64.go
                      13 files changed, 134 insertions(+), 1 deletion(-)

                      diff --git a/unix/syscall_linux.go b/unix/syscall_linux.go
                      index 9737e08..8c102bc 100644
                      --- a/unix/syscall_linux.go
                      +++ b/unix/syscall_linux.go
                      @@ -1038,6 +1038,7 @@
                      //sys Chroot(path string) (err error)
                      //sys ClockGettime(clockid int32, time *Timespec) (err error)
                      //sys Close(fd int) (err error)

                      +//sys CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error)
                       //sys	Dup(oldfd int) (fd int, err error)
                      //sys Dup3(oldfd int, newfd int, flags int) (err error)
                      //sysnb EpollCreate(size int) (fd int, err error)
                      diff --git a/unix/zsyscall_linux_386.go b/unix/zsyscall_linux_386.go
                      index 41693a9..b4e9d8b 100644
                      --- a/unix/zsyscall_linux_386.go
                      +++ b/unix/zsyscall_linux_386.go
                      @@ -312,6 +312,17 @@


                      // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

                      +func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) {
                      + r0, _, e1 := Syscall6(SYS_COPY_FILE_RANGE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))
                      + n = int(r0)
                      + if e1 != 0 {
                      + err = errnoErr(e1)
                      + }
                      + return
                      +}
                      +
                      +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
                      +
                       func Dup(oldfd int) (fd int, err error) {
                      r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)
                      fd = int(r0)
                      diff --git a/unix/zsyscall_linux_amd64.go b/unix/zsyscall_linux_amd64.go
                      index f10621d..3de166a 100644
                      --- a/unix/zsyscall_linux_amd64.go
                      +++ b/unix/zsyscall_linux_amd64.go
                      @@ -312,6 +312,17 @@


                      // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

                      +func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) {
                      + r0, _, e1 := Syscall6(SYS_COPY_FILE_RANGE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))
                      + n = int(r0)
                      + if e1 != 0 {
                      + err = errnoErr(e1)
                      + }
                      + return
                      +}
                      +
                      +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
                      +
                       func Dup(oldfd int) (fd int, err error) {
                      r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)
                      fd = int(r0)
                      diff --git a/unix/zsyscall_linux_arm.go b/unix/zsyscall_linux_arm.go
                      index fae666f..03463ae 100644
                      --- a/unix/zsyscall_linux_arm.go
                      +++ b/unix/zsyscall_linux_arm.go
                      @@ -312,6 +312,17 @@


                      // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

                      +func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) {
                      + r0, _, e1 := Syscall6(SYS_COPY_FILE_RANGE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))
                      + n = int(r0)
                      + if e1 != 0 {
                      + err = errnoErr(e1)
                      + }
                      + return
                      +}
                      +
                      +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
                      +
                       func Dup(oldfd int) (fd int, err error) {
                      r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)
                      fd = int(r0)
                      diff --git a/unix/zsyscall_linux_arm64.go b/unix/zsyscall_linux_arm64.go
                      index a4dca39..4f68f39 100644
                      --- a/unix/zsyscall_linux_arm64.go
                      +++ b/unix/zsyscall_linux_arm64.go
                      @@ -312,6 +312,17 @@


                      // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

                      +func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) {
                      + r0, _, e1 := Syscall6(SYS_COPY_FILE_RANGE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))
                      + n = int(r0)
                      + if e1 != 0 {
                      + err = errnoErr(e1)
                      + }
                      + return
                      +}
                      +
                      +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
                      +
                       func Dup(oldfd int) (fd int, err error) {
                      r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)
                      fd = int(r0)
                      diff --git a/unix/zsyscall_linux_mips.go b/unix/zsyscall_linux_mips.go
                      index b56db72..73d6889 100644
                      --- a/unix/zsyscall_linux_mips.go
                      +++ b/unix/zsyscall_linux_mips.go
                      @@ -312,6 +312,17 @@


                      // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

                      +func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) {
                      + r0, _, e1 := Syscall6(SYS_COPY_FILE_RANGE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))
                      + n = int(r0)
                      + if e1 != 0 {
                      + err = errnoErr(e1)
                      + }
                      + return
                      +}
                      +
                      +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
                      +
                       func Dup(oldfd int) (fd int, err error) {
                      r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)
                      fd = int(r0)
                      diff --git a/unix/zsyscall_linux_mips64.go b/unix/zsyscall_linux_mips64.go
                      index 1f97828..60c9629 100644
                      --- a/unix/zsyscall_linux_mips64.go
                      +++ b/unix/zsyscall_linux_mips64.go
                      @@ -312,6 +312,17 @@


                      // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

                      +func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) {
                      + r0, _, e1 := Syscall6(SYS_COPY_FILE_RANGE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))
                      + n = int(r0)
                      + if e1 != 0 {
                      + err = errnoErr(e1)
                      + }
                      + return
                      +}
                      +
                      +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
                      +
                       func Dup(oldfd int) (fd int, err error) {
                      r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)
                      fd = int(r0)
                      diff --git a/unix/zsyscall_linux_mips64le.go b/unix/zsyscall_linux_mips64le.go
                      index c1fdbb5..1fc8c65 100644
                      --- a/unix/zsyscall_linux_mips64le.go
                      +++ b/unix/zsyscall_linux_mips64le.go
                      @@ -312,6 +312,17 @@


                      // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

                      +func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) {
                      + r0, _, e1 := Syscall6(SYS_COPY_FILE_RANGE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))
                      + n = int(r0)
                      + if e1 != 0 {
                      + err = errnoErr(e1)
                      + }
                      + return
                      +}
                      +
                      +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
                      +
                       func Dup(oldfd int) (fd int, err error) {
                      r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)
                      fd = int(r0)
                      diff --git a/unix/zsyscall_linux_mipsle.go b/unix/zsyscall_linux_mipsle.go
                      index 31836d4..c5f87e6 100644
                      --- a/unix/zsyscall_linux_mipsle.go
                      +++ b/unix/zsyscall_linux_mipsle.go
                      @@ -312,6 +312,17 @@


                      // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

                      +func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) {
                      + r0, _, e1 := Syscall6(SYS_COPY_FILE_RANGE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))
                      + n = int(r0)
                      + if e1 != 0 {
                      + err = errnoErr(e1)
                      + }
                      + return
                      +}
                      +
                      +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
                      +
                       func Dup(oldfd int) (fd int, err error) {
                      r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)
                      fd = int(r0)
                      diff --git a/unix/zsyscall_linux_ppc64.go b/unix/zsyscall_linux_ppc64.go
                      index 4a76755..cee6ec3 100644
                      --- a/unix/zsyscall_linux_ppc64.go
                      +++ b/unix/zsyscall_linux_ppc64.go
                      @@ -312,6 +312,17 @@


                      // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

                      +func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) {
                      + r0, _, e1 := Syscall6(SYS_COPY_FILE_RANGE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))
                      + n = int(r0)
                      + if e1 != 0 {
                      + err = errnoErr(e1)
                      + }
                      + return
                      +}
                      +
                      +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
                      +
                       func Dup(oldfd int) (fd int, err error) {
                      r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)
                      fd = int(r0)
                      diff --git a/unix/zsyscall_linux_ppc64le.go b/unix/zsyscall_linux_ppc64le.go
                      index 5fb3428..f031e10 100644
                      --- a/unix/zsyscall_linux_ppc64le.go
                      +++ b/unix/zsyscall_linux_ppc64le.go
                      @@ -312,6 +312,17 @@


                      // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

                      +func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) {
                      + r0, _, e1 := Syscall6(SYS_COPY_FILE_RANGE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))
                      + n = int(r0)
                      + if e1 != 0 {
                      + err = errnoErr(e1)
                      + }
                      + return
                      +}
                      +
                      +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
                      +
                       func Dup(oldfd int) (fd int, err error) {
                      r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)
                      fd = int(r0)
                      diff --git a/unix/zsyscall_linux_s390x.go b/unix/zsyscall_linux_s390x.go
                      index 79d285c..4e4728a 100644
                      --- a/unix/zsyscall_linux_s390x.go
                      +++ b/unix/zsyscall_linux_s390x.go
                      @@ -312,6 +312,17 @@


                      // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

                      +func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) {
                      + r0, _, e1 := Syscall6(SYS_COPY_FILE_RANGE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))
                      + n = int(r0)
                      + if e1 != 0 {
                      + err = errnoErr(e1)
                      + }
                      + return
                      +}
                      +
                      +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
                      +
                       func Dup(oldfd int) (fd int, err error) {
                      r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)
                      fd = int(r0)
                      diff --git a/unix/zsyscall_linux_sparc64.go b/unix/zsyscall_linux_sparc64.go
                      index ce3ec58..2dd9843 100644
                      --- a/unix/zsyscall_linux_sparc64.go
                      +++ b/unix/zsyscall_linux_sparc64.go
                      @@ -1,5 +1,5 @@
                      // mksyscall.pl -tags linux,sparc64 syscall_linux.go syscall_linux_sparc64.go
                      -// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
                      +// Code generated by the command above; see README.md. DO NOT EDIT.

                      // +build linux,sparc64

                      @@ -312,6 +312,17 @@


                      // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT

                      +func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) {
                      + r0, _, e1 := Syscall6(SYS_COPY_FILE_RANGE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))
                      + n = int(r0)
                      + if e1 != 0 {
                      + err = errnoErr(e1)
                      + }
                      + return
                      +}
                      +
                      +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
                      +
                       func Dup(oldfd int) (fd int, err error) {
                      r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)
                      fd = int(r0)

                      To view, visit change 39992. To unsubscribe, visit settings.

                      Gerrit-Project: sys
                      Gerrit-Branch: master
                      Gerrit-MessageType: merged
                      Gerrit-Change-Id: Id365f1e5d4d5ddf7159478e3a13084c9576ebd5c
                      Gerrit-Change-Number: 39992
                      Gerrit-PatchSet: 6
                      Reply all
                      Reply to author
                      Forward
                      0 new messages