<?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>eventfd_ctx_read</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1" /><link rel="home" href="index.html" title="Linux Filesystems API" /><link rel="up" href="fs_events.html" title="Chapter 3. Events based on file descriptors" /><link rel="prev" href="API-eventfd-ctx-remove-wait-queue.html" title="eventfd_ctx_remove_wait_queue" /><link rel="next" href="API-eventfd-fget.html" title="eventfd_fget" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><span>eventfd_ctx_read</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-eventfd-ctx-remove-wait-queue.html">Prev</a> </td><th width="60%" align="center">Chapter 3. Events based on file descriptors</th><td width="20%" align="right"> <a accesskey="n" href="API-eventfd-fget.html">Next</a></td></tr></table><hr /></div><div class="refentry" title="eventfd_ctx_read"><a id="API-eventfd-ctx-read"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>eventfd_ctx_read — Reads the eventfd counter or wait if it is zero. </p></div><div class="refsynopsisdiv" title="Synopsis"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">ssize_t <strong>fsfunceventfd_ctx_read </strong>(</code></td><td>struct eventfd_ctx * <var class="pdparam">ctx</var>, </td></tr><tr><td> </td><td>int <var class="pdparam">no_wait</var>, </td></tr><tr><td> </td><td>__u64 * <var class="pdparam">cnt</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1" title="Arguments"><a id="id2763899"></a><h2>Arguments</h2><div class="variablelist"><dl><dt><span class="term"><em class="parameter"><code>ctx</code></em></span></dt><dd><p> [in] Pointer to eventfd context. </p></dd><dt><span class="term"><em class="parameter"><code>no_wait</code></em></span></dt><dd><p> [in] Different from zero if the operation should not block. </p></dd><dt><span class="term"><em class="parameter"><code>cnt</code></em></span></dt><dd><p> [out] Pointer to the 64-bit counter value. </p></dd></dl></div></div><div class="refsect1" title="Description"><a id="id2763960"></a><h2>Description</h2><p> Returns <code class="constant">0</code> if successful, or the following error codes: </p><p> -EAGAIN : The operation would have blocked but <em class="parameter"><code>no_wait</code></em> was non-zero. -ERESTARTSYS : A signal interrupted the wait operation. </p><p> If <em class="parameter"><code>no_wait</code></em> is zero, the function might sleep until the eventfd internal counter becomes greater than zero. </p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-eventfd-ctx-remove-wait-queue.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="fs_events.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="API-eventfd-fget.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span>eventfd_ctx_remove_wait_queue</span> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> <span>eventfd_fget</span></td></tr></table></div></body></html>