Sophie

Sophie

distrib > Fedora > 18 > x86_64 > media > updates > by-pkgid > 1a595394b241504ff370a8d12ebfcea7 > files > 3720

kernel-doc-3.11.10-100.fc18.noarch.rpm

<?xml version="1.0" encoding="ANSI_X3.4-1968" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968" /><title>V4L2 write()</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1" /><link rel="home" href="index.html" title="LINUX MEDIA INFRASTRUCTURE API" /><link rel="up" href="user-func.html" title="Appendix&#160;A.&#160;Function Reference" /><link rel="prev" href="func-select.html" title="V4L2 select()" /><link rel="next" href="apb.html" title="Appendix&#160;B.&#160;Common definitions for V4L2 and V4L2 subdev interfaces" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">V4L2 write()</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="func-select.html">Prev</a>&#160;</td><th width="60%" align="center">Appendix&#160;A.&#160;Function Reference</th><td width="20%" align="right">&#160;<a accesskey="n" href="apb.html">Next</a></td></tr></table><hr /></div><div class="refentry"><a id="func-write"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>v4l2-write &#8212; Write to a V4L2 device</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;unistd.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">ssize_t <strong class="fsfunc">write</strong>(</code></td><td>int <var class="pdparam">fd</var>, </td></tr><tr><td>&#160;</td><td>void *<var class="pdparam">buf</var>, </td></tr><tr><td>&#160;</td><td>size_t <var class="pdparam">count</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div></div><div class="refsect1"><a id="idm140470002734176"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>fd</code></em></span></dt><dd><p>File descriptor returned by <a class="link" href="func-open.html" title="V4L2 open()"><code class="function">open()</code></a>.</p></dd><dt><span class="term"><em class="parameter"><code>buf</code></em></span></dt><dd><p></p></dd><dt><span class="term"><em class="parameter"><code>count</code></em></span></dt><dd><p></p></dd></dl></div></div><div class="refsect1"><a id="idm140470002726288"></a><h2>Description</h2><p><code class="function">write()</code> writes up to
<em class="parameter"><code>count</code></em> bytes to the device referenced by the
file descriptor <em class="parameter"><code>fd</code></em> from the buffer starting at
<em class="parameter"><code>buf</code></em>. When the hardware outputs are not active
yet, this function enables them. When <em class="parameter"><code>count</code></em> is
zero, <code class="function">write()</code> returns
<span class="returnvalue">0</span> without any other effect.</p><p>When the application does not provide more data in time, the
previous video frame, raw VBI image, sliced VPS or WSS data is
displayed again. Sliced Teletext or Closed Caption data is not
repeated, the driver inserts a blank line instead.</p></div><div class="refsect1"><a id="idm140470002719792"></a><h2>Return Value</h2><p>On success, the number of bytes written are returned. Zero
indicates nothing was written. On error, <span class="returnvalue">-1</span>
is returned, and the <code class="varname">errno</code> variable is set
appropriately. In this case the next write will start at the beginning
of a new frame. Possible error codes are:</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><span class="errorcode">EAGAIN</span></span></dt><dd><p>Non-blocking I/O has been selected using the <a class="link" href="func-open.html" title="V4L2 open()"><code class="constant">O_NONBLOCK</code></a> flag and no
buffer space was available to write the data immediately.</p></dd><dt><span class="term"><span class="errorcode">EBADF</span></span></dt><dd><p><em class="parameter"><code>fd</code></em> is not a valid file
descriptor or is not open for writing.</p></dd><dt><span class="term"><span class="errorcode">EBUSY</span></span></dt><dd><p>The driver does not support multiple write streams and the
device is already in use.</p></dd><dt><span class="term"><span class="errorcode">EFAULT</span></span></dt><dd><p><em class="parameter"><code>buf</code></em> references an inaccessible
memory area.</p></dd><dt><span class="term"><span class="errorcode">EINTR</span></span></dt><dd><p>The call was interrupted by a signal before any
data was written.</p></dd><dt><span class="term"><span class="errorcode">EIO</span></span></dt><dd><p>I/O error. This indicates some hardware problem.</p></dd><dt><span class="term"><span class="errorcode">EINVAL</span></span></dt><dd><p>The <code class="function">write()</code> function is not
supported by this driver, not on this device, or generally not on this
type of device.</p></dd></dl></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="func-select.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="user-func.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="apb.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">V4L2 select()&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;Appendix&#160;B.&#160;Common definitions for V4L2 and V4L2 subdev interfaces</td></tr></table></div></body></html>