]> Cypherpunks.ru repositories - gostls13.git/commitdiff
doc/go1.22: document zero-copy to net.UnixConn
authorDamien Neil <dneil@google.com>
Tue, 12 Dec 2023 19:10:35 +0000 (11:10 -0800)
committerGopher Robot <gobot@golang.org>
Tue, 12 Dec 2023 22:10:52 +0000 (22:10 +0000)
For #58808

Change-Id: Id73b9e4b5fb96426a01b76ce7a1053a6ad61a58e
Reviewed-on: https://go-review.googlesource.com/c/go/+/549197
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Auto-Submit: Damien Neil <dneil@google.com>

doc/go1.22.html

index 8bcaeedc00584fc4e6fd5d0097eaf25922c69249..31218beba646413d257a57273fb78d7005cf3353 100644 (file)
@@ -602,7 +602,10 @@ defer func() {
 <dl id="net"><dt><a href="/pkg/net/">net</a></dt>
   <dd>
     <p><!-- https://go.dev/issue/58808 -->
-      TODO: <a href="https://go.dev/issue/58808">https://go.dev/issue/58808</a>: arrange zero-copy of os.File and TCPConn to UnixConn
+      When <a href="/pkg/io#Copy"><code>io.Copy</code></a> copies
+      from a <code>TCPConn</code> to a <code>UnixConn</code>,
+      it will now use Linux's <code>sendfile(2)</code> system call if possible,
+      using the new method <a href="/pkg/net#TCPConn.WriteTo"><code>TCPConn.WriteTo</code></a>.
     </p>
 
     <p><!-- CL 467335 -->
@@ -672,7 +675,10 @@ defer func() {
     </p>
 
     <p><!-- https://go.dev/issue/58808 -->
-      TODO: <a href="https://go.dev/issue/58808">https://go.dev/issue/58808</a>: arrange zero-copy of os.File and TCPConn to UnixConn
+      When <a href="/pkg/io#Copy"><code>io.Copy</code></a> copies
+      from a <code>File</code> to a <code>net.UnixConn</code>,
+      it will now use Linux's <code>sendfile(2)</code> system call if possible,
+      using the new method <a href="/pkg/os#File.WriteTo"><code>File.WriteTo</code></a>.
     </p>
   </dd>
 </dl><!-- os -->