github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/internal/poll/splice_linux.go (about)

     1  // Copyright 2018 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package poll
     6  
     7  // Splice transfers at most remain bytes of data from src to dst, using the
     8  // splice system call to minimize copies of data from and to userspace.
     9  //
    10  // Splice gets a pipe buffer from the pool or creates a new one if needed, to serve as a buffer for the data transfer.
    11  // src and dst must both be stream-oriented sockets.
    12  //
    13  // If err != nil, sc is the system call which caused the error.
    14  func Splice(dst, src *FD, remain int64) (written int64, handled bool, sc string, err error)