173 lines
4.6 KiB
HTML
173 lines
4.6 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of SD_EVENT_SOURCE_GET_PENDING</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>SD_EVENT_SOURCE_GET_PENDING</H1>
|
|
Section: sd_event_source_get_pending (3)<BR>Updated: <BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
sd_event_source_get_pending - Determine pending state of event sources
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<P>
|
|
<B>
|
|
</B><PRE>
|
|
#include <<A HREF="file:///usr/include/systemd/sd-event.h">systemd/sd-event.h</A>>
|
|
</PRE>
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="1">
|
|
<B>int sd_event_source_get_pending(sd_event_source *</B><I>source</I><B>);</B>
|
|
|
|
</DL>
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
<P>
|
|
|
|
<B>sd_event_source_get_pending()</B>
|
|
<DD>may be used to determine whether the event source object specified as
|
|
<I>source</I>
|
|
has seen events but has not been dispatched yet (and thus is marked "pending").
|
|
<P>
|
|
|
|
Event source objects initially are not marked pending, when they are created with calls such as
|
|
<B><A HREF="/cgi-bin/man/man2html?3+sd_event_add_io">sd_event_add_io</A></B>(3),
|
|
<B><A HREF="/cgi-bin/man/man2html?3+sd_event_add_time">sd_event_add_time</A></B>(3), with the exception of those created with
|
|
<B><A HREF="/cgi-bin/man/man2html?3+sd_event_add_defer">sd_event_add_defer</A></B>(3)
|
|
which are immediately marked pending, and
|
|
<B><A HREF="/cgi-bin/man/man2html?3+sd_event_add_exit">sd_event_add_exit</A></B>(3)
|
|
for which the "pending" concept is not defined. For details see the respective manual pages.
|
|
<P>
|
|
|
|
In each event loop iteration one event source of those marked pending is dispatched, in the order defined by the event source priority, as set with
|
|
<B><A HREF="/cgi-bin/man/man2html?3+sd_event_source_set_priority">sd_event_source_set_priority</A></B>(3).
|
|
<P>
|
|
|
|
For I/O event sources, as created with
|
|
<B><A HREF="/cgi-bin/man/man2html?3+sd_event_add_io">sd_event_add_io</A></B>(3), the call
|
|
<B><A HREF="/cgi-bin/man/man2html?3+sd_event_source_get_io_revents">sd_event_source_get_io_revents</A></B>(3)
|
|
may be used to query the type of event pending in more detail.
|
|
<A NAME="lbAE"> </A>
|
|
<H2>RETURN VALUE</H2>
|
|
|
|
<P>
|
|
|
|
On success,
|
|
<B>sd_event_source_get_pending()</B>
|
|
returns an integer greater than zero when the event source is marked pending, and zero when the event source is not marked pending. On failure, it returns a negative errno-style error code.
|
|
<A NAME="lbAF"> </A>
|
|
<H3>Errors</H3>
|
|
|
|
<P>
|
|
|
|
Returned errors may indicate the following problems:
|
|
<P>
|
|
|
|
<B>-EINVAL</B>
|
|
<DL COMPACT><DT id="2"><DD>
|
|
<I>source</I>
|
|
is not a valid pointer to an
|
|
sd_event_source
|
|
object.
|
|
</DL>
|
|
|
|
<P>
|
|
|
|
<B>-EDOM</B>
|
|
<DL COMPACT><DT id="3"><DD>
|
|
<I>source</I>
|
|
refers to an event source object created with
|
|
<B><A HREF="/cgi-bin/man/man2html?3+sd_event_add_exit">sd_event_add_exit</A></B>(3).
|
|
</DL>
|
|
|
|
<P>
|
|
|
|
<B>-ENOMEM</B>
|
|
<DL COMPACT><DT id="4"><DD>
|
|
Not enough memory.
|
|
</DL>
|
|
|
|
<P>
|
|
|
|
<B>-ESTALE</B>
|
|
<DL COMPACT><DT id="5"><DD>
|
|
The event loop is already terminated.
|
|
</DL>
|
|
|
|
<P>
|
|
|
|
<B>-ECHILD</B>
|
|
<DL COMPACT><DT id="6"><DD>
|
|
The event loop has been created in a different process.
|
|
</DL>
|
|
|
|
<A NAME="lbAG"> </A>
|
|
<H2>NOTES</H2>
|
|
|
|
<P>
|
|
|
|
These APIs are implemented as a shared library, which can be compiled and linked to with the
|
|
<B>libsystemd</B> <B><A HREF="/cgi-bin/man/man2html?1+pkg-config">pkg-config</A></B>(1)
|
|
file.
|
|
<A NAME="lbAH"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<P>
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?3+sd-event">sd-event</A></B>(3),
|
|
<B><A HREF="/cgi-bin/man/man2html?3+sd_event_add_io">sd_event_add_io</A></B>(3),
|
|
<B><A HREF="/cgi-bin/man/man2html?3+sd_event_add_time">sd_event_add_time</A></B>(3),
|
|
<B><A HREF="/cgi-bin/man/man2html?3+sd_event_add_signal">sd_event_add_signal</A></B>(3),
|
|
<B><A HREF="/cgi-bin/man/man2html?3+sd_event_add_child">sd_event_add_child</A></B>(3),
|
|
<B><A HREF="/cgi-bin/man/man2html?3+sd_event_add_inotify">sd_event_add_inotify</A></B>(3),
|
|
<B><A HREF="/cgi-bin/man/man2html?3+sd_event_add_defer">sd_event_add_defer</A></B>(3),
|
|
<B><A HREF="/cgi-bin/man/man2html?3+sd_event_source_unref">sd_event_source_unref</A></B>(3)
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="7"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="8"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="9"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="10"><A HREF="#lbAE">RETURN VALUE</A><DD>
|
|
<DL>
|
|
<DT id="11"><A HREF="#lbAF">Errors</A><DD>
|
|
</DL>
|
|
<DT id="12"><A HREF="#lbAG">NOTES</A><DD>
|
|
<DT id="13"><A HREF="#lbAH">SEE ALSO</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:55 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|