// 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 os

import (
	
	
)

var pollCopyFileRange = poll.CopyFileRange

func ( *File) ( io.Reader) ( int64,  bool,  error) {
	// copy_file_range(2) does not support destinations opened with
	// O_APPEND, so don't even try.
	if .appendMode {
		return 0, false, nil
	}

	 := int64(1 << 62)

	,  := .(*io.LimitedReader)
	if  {
		,  = .N, .R
		if  <= 0 {
			return 0, true, nil
		}
	}

	,  := .(*File)
	if ! {
		return 0, false, nil
	}
	if .checkValid("ReadFrom") != nil {
		// Avoid returning the error as we report handled as false,
		// leave further error handling as the responsibility of the caller.
		return 0, false, nil
	}

	, ,  = pollCopyFileRange(&.pfd, &.pfd, )
	if  != nil {
		.N -= 
	}
	return , , NewSyscallError("copy_file_range", )
}