cryptenroll/repart/creds: no longer default to binding against literal PCR 7 (#36200)
[systemd.io.git] / man / sd_event_source_get_pending.xml
blobbc1354b8cf29c7b54fa8421d2701ef37e7e165b1
1 <?xml version='1.0'?>
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3   "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
4 <!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
6 <refentry id="sd_event_source_get_pending" xmlns:xi="http://www.w3.org/2001/XInclude">
8   <refentryinfo>
9     <title>sd_event_source_get_pending</title>
10     <productname>systemd</productname>
11   </refentryinfo>
13   <refmeta>
14     <refentrytitle>sd_event_source_get_pending</refentrytitle>
15     <manvolnum>3</manvolnum>
16   </refmeta>
18   <refnamediv>
19     <refname>sd_event_source_get_pending</refname>
21     <refpurpose>Determine pending state of event sources</refpurpose>
22   </refnamediv>
24   <refsynopsisdiv>
25     <funcsynopsis>
26       <funcsynopsisinfo>#include &lt;systemd/sd-event.h&gt;</funcsynopsisinfo>
28       <funcprototype>
29         <funcdef>int <function>sd_event_source_get_pending</function></funcdef>
30         <paramdef>sd_event_source *<parameter>source</parameter></paramdef>
31       </funcprototype>
33     </funcsynopsis>
34   </refsynopsisdiv>
36   <refsect1>
37     <title>Description</title>
39     <para><function>sd_event_source_get_pending()</function> may be
40     used to determine whether the event source object specified as
41     <parameter>source</parameter> has seen events but has not been
42     dispatched yet (and thus is marked "pending").</para>
44     <para>Event source objects initially are not marked pending, when
45     they are created with calls such as
46     <citerefentry><refentrytitle>sd_event_add_io</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
47     <citerefentry><refentrytitle>sd_event_add_time</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
48     with the exception of those created with
49     <citerefentry><refentrytitle>sd_event_add_defer</refentrytitle><manvolnum>3</manvolnum></citerefentry>
50     which are immediately marked pending, and
51     <citerefentry><refentrytitle>sd_event_add_exit</refentrytitle><manvolnum>3</manvolnum></citerefentry>
52     for which the "pending" concept is not defined. For details see
53     the respective manual pages.</para>
55     <para>In each event loop iteration one event source of those
56     marked pending is dispatched, in the order defined by the event
57     source priority, as set with
58     <citerefentry><refentrytitle>sd_event_source_set_priority</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para>
60     <para>For I/O event sources, as created with
61     <citerefentry><refentrytitle>sd_event_add_io</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
62     the call
63     <citerefentry><refentrytitle>sd_event_source_get_io_revents</refentrytitle><manvolnum>3</manvolnum></citerefentry>
64     may be used to query the type of event pending in more
65     detail.</para>
67   </refsect1>
69   <refsect1>
70     <title>Return Value</title>
72     <para>On success, <function>sd_event_source_get_pending()</function> returns an integer greater than zero
73     when the event source is marked pending, and zero when the event source is not marked pending. On
74     failure, it returns a negative errno-style error code.</para>
76     <refsect2>
77       <title>Errors</title>
79       <para>Returned errors may indicate the following problems:</para>
81       <variablelist>
82         <varlistentry>
83           <term><constant>-EINVAL</constant></term>
85           <listitem><para><parameter>source</parameter> is not a valid pointer to an
86           <structname>sd_event_source</structname> object.</para></listitem>
87         </varlistentry>
89         <varlistentry>
90           <term><constant>-EDOM</constant></term>
92           <listitem><para><parameter>source</parameter> refers to an event source object created with
93           <citerefentry><refentrytitle>sd_event_add_exit</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para></listitem>
94         </varlistentry>
96         <varlistentry>
97           <term><constant>-ENOMEM</constant></term>
99           <listitem><para>Not enough memory.</para></listitem>
100         </varlistentry>
102         <varlistentry>
103           <term><constant>-ESTALE</constant></term>
105           <listitem><para>The event loop is already terminated.</para></listitem>
107         </varlistentry>
109         <varlistentry>
110           <term><constant>-ECHILD</constant></term>
112           <listitem><para>The event loop has been created in a different process, library or module instance.</para></listitem>
114         </varlistentry>
116       </variablelist>
117     </refsect2>
118   </refsect1>
120   <xi:include href="libsystemd-pkgconfig.xml" />
122   <refsect1>
123     <title>History</title>
124     <para><function>sd_event_source_get_pending()</function> was added in version 229.</para>
125   </refsect1>
127   <refsect1>
128     <title>See Also</title>
130     <para><simplelist type="inline">
131       <member><citerefentry><refentrytitle>sd-event</refentrytitle><manvolnum>3</manvolnum></citerefentry></member>
132       <member><citerefentry><refentrytitle>sd_event_add_io</refentrytitle><manvolnum>3</manvolnum></citerefentry></member>
133       <member><citerefentry><refentrytitle>sd_event_add_time</refentrytitle><manvolnum>3</manvolnum></citerefentry></member>
134       <member><citerefentry><refentrytitle>sd_event_add_signal</refentrytitle><manvolnum>3</manvolnum></citerefentry></member>
135       <member><citerefentry><refentrytitle>sd_event_add_child</refentrytitle><manvolnum>3</manvolnum></citerefentry></member>
136       <member><citerefentry><refentrytitle>sd_event_add_inotify</refentrytitle><manvolnum>3</manvolnum></citerefentry></member>
137       <member><citerefentry><refentrytitle>sd_event_add_defer</refentrytitle><manvolnum>3</manvolnum></citerefentry></member>
138       <member><citerefentry><refentrytitle>sd_event_source_unref</refentrytitle><manvolnum>3</manvolnum></citerefentry></member>
139     </simplelist></para>
140   </refsect1>
142 </refentry>