// Copyright 2018 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 netimport ()// splice transfers data from r to c using the splice system call to minimize// copies from and to userspace. c must be a TCP connection. Currently, splice// is only enabled if r is a TCP or a stream-oriented Unix connection.//// If splice returns handled == false, it has performed no work.func ( *netFD, io.Reader) ( int64, error, bool) {varint64 = 1 << 62// by default, copy until EOF , := .(*io.LimitedReader)if { , = .N, .Rif <= 0 {return0, nil, true } }var *netFDif , := .(*TCPConn); { = .fd } elseif , := .(*UnixConn); {if .fd.net != "unix" {return0, nil, false } = .fd } else {return0, nil, false } , , , := poll.Splice(&.pfd, &.pfd, )if != nil { .N -= }return , wrapSyscallError(, ), }
The pages are generated with Goldsv0.4.9. (GOOS=linux GOARCH=amd64)