go copy_file_range_linux 源码

  • 2022-07-15
  • 浏览 (945)

golang copy_file_range_linux 代码

文件路径:/src/internal/syscall/unix/copy_file_range_linux.go

// Copyright 2020 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package unix

import (
	"syscall"
	"unsafe"
)

func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) {
	r1, _, errno := syscall.Syscall6(copyFileRangeTrap,
		uintptr(rfd),
		uintptr(unsafe.Pointer(roff)),
		uintptr(wfd),
		uintptr(unsafe.Pointer(woff)),
		uintptr(len),
		uintptr(flags),
	)
	n = int(r1)
	if errno != 0 {
		err = errno
	}
	return
}

相关信息

go 源码目录

相关文章

go at 源码

go at_aix 源码

go at_darwin 源码

go at_freebsd 源码

go at_fstatat 源码

go at_libc 源码

go at_solaris 源码

go at_statx 源码

go at_sysnum_darwin 源码

go at_sysnum_dragonfly 源码

0  赞