1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>do_splice_direct</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="Linux Filesystems API"><link rel="up" href="splice.html" title="Chapter 7. splice API"><link rel="prev" href="API-splice-direct-to-actor.html" title="splice_direct_to_actor"><link rel="next" href="pipes.html" title="Chapter 8. pipes API"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><span class="phrase">do_splice_direct</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-splice-direct-to-actor.html">Prev</a> </td><th width="60%" align="center">Chapter 7. splice API</th><td width="20%" align="right"> <a accesskey="n" href="pipes.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-do-splice-direct"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>do_splice_direct — 2 splices data directly between two files 3 </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">long <b class="fsfunc">do_splice_direct </b>(</code></td><td>struct file * <var class="pdparam">in</var>, </td></tr><tr><td> </td><td>loff_t * <var class="pdparam">ppos</var>, </td></tr><tr><td> </td><td>struct file * <var class="pdparam">out</var>, </td></tr><tr><td> </td><td>loff_t * <var class="pdparam">opos</var>, </td></tr><tr><td> </td><td>size_t <var class="pdparam">len</var>, </td></tr><tr><td> </td><td>unsigned int <var class="pdparam">flags</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="idp1104109396"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>in</code></em></span></dt><dd><p> 4 file to splice from 5 </p></dd><dt><span class="term"><em class="parameter"><code>ppos</code></em></span></dt><dd><p> 6 input file offset 7 </p></dd><dt><span class="term"><em class="parameter"><code>out</code></em></span></dt><dd><p> 8 file to splice to 9 </p></dd><dt><span class="term"><em class="parameter"><code>opos</code></em></span></dt><dd><p> 10 output file offset 11 </p></dd><dt><span class="term"><em class="parameter"><code>len</code></em></span></dt><dd><p> 12 number of bytes to splice 13 </p></dd><dt><span class="term"><em class="parameter"><code>flags</code></em></span></dt><dd><p> 14 splice modifier flags 15 </p></dd></dl></div></div><div class="refsect1"><a name="idp1104116092"></a><h2>Description</h2><p> 16 For use by <code class="function">do_sendfile</code>. splice can easily emulate sendfile, but 17 doing it in the application would incur an extra system call 18 (splice in + splice out, as compared to just <code class="function">sendfile</code>). So this helper 19 can splice directly through a process-private pipe. 20</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-splice-direct-to-actor.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="splice.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="pipes.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">splice_direct_to_actor</span> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 8. pipes API</td></tr></table></div></body></html> 21