]>
Commit | Line | Data |
---|---|---|
3802a3d3 | 1 | <?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*--> |
ba4b3566 | 2 | <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" |
681eb9cf FB |
3 | "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [ |
4 | <!ENTITY % entities SYSTEM "custom-entities.ent" > | |
5 | %entities; | |
6 | ]> | |
ba4b3566 ZJS |
7 | |
8 | <!-- | |
5de0ccff | 9 | This file is part of systemd. |
ba4b3566 | 10 | |
5de0ccff | 11 | Copyright 2014 Zbigniew Jędrzejewski-Szmek |
ba4b3566 | 12 | |
5de0ccff ZJS |
13 | systemd is free software; you can redistribute it and/or modify it |
14 | under the terms of the GNU Lesser General Public License as published by | |
15 | the Free Software Foundation; either version 2.1 of the License, or | |
16 | (at your option) any later version. | |
ba4b3566 | 17 | |
5de0ccff ZJS |
18 | systemd is distributed in the hope that it will be useful, but |
19 | WITHOUT ANY WARRANTY; without even the implied warranty of | |
20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
21 | Lesser General Public License for more details. | |
ba4b3566 | 22 | |
5de0ccff ZJS |
23 | You should have received a copy of the GNU Lesser General Public License |
24 | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |
ba4b3566 ZJS |
25 | --> |
26 | ||
48f69d8f | 27 | <refentry id="sd_event_get_fd" |
ba4b3566 ZJS |
28 | xmlns:xi="http://www.w3.org/2001/XInclude"> |
29 | ||
30 | <refentryinfo> | |
31 | <title>sd_event_get_fd</title> | |
32 | <productname>systemd</productname> | |
33 | ||
34 | <authorgroup> | |
35 | <author> | |
36 | <contrib>More text</contrib> | |
37 | <firstname>Zbigniew</firstname> | |
38 | <surname>Jędrzejewski-Szmek</surname> | |
39 | <email>zbyszek@in.waw.pl</email> | |
40 | </author> | |
41 | </authorgroup> | |
42 | </refentryinfo> | |
43 | ||
44 | <refmeta> | |
45 | <refentrytitle>sd_event_get_fd</refentrytitle> | |
46 | <manvolnum>3</manvolnum> | |
47 | </refmeta> | |
48 | ||
49 | <refnamediv> | |
50 | <refname>sd_event_get_fd</refname> | |
51 | ||
52 | <refpurpose>Obtain a file descriptor to poll for event loop events</refpurpose> | |
53 | </refnamediv> | |
54 | ||
55 | <refsynopsisdiv> | |
56 | <funcsynopsis> | |
57 | <funcsynopsisinfo>#include <systemd/sd-bus.h></funcsynopsisinfo> | |
58 | ||
59 | <funcprototype> | |
60 | <funcdef>int <function>sd_event_get_fd</function></funcdef> | |
61 | <paramdef>sd_bus *<parameter>event</parameter></paramdef> | |
62 | </funcprototype> | |
63 | ||
64 | </funcsynopsis> | |
65 | </refsynopsisdiv> | |
66 | ||
67 | <refsect1> | |
68 | <title>Description</title> | |
69 | ||
70 | <para><function>sd_event_get_fd()</function> returns the file | |
71 | descriptor that the event loop object returned by the | |
72 | <citerefentry><refentrytitle>sd_event_new</refentrytitle><manvolnum>3</manvolnum></citerefentry> | |
73 | function uses to wait for events. This file descriptor can be | |
74 | polled for events. This makes it possible to embed the | |
75 | <citerefentry><refentrytitle>sd-event</refentrytitle><manvolnum>3</manvolnum></citerefentry> | |
76 | event loop inside of another event loop.</para> | |
77 | </refsect1> | |
78 | ||
79 | <refsect1> | |
80 | <title>Return Value</title> | |
81 | ||
82 | <para>On success, <function>sd_event_get_fd()</function> returns a | |
83 | non-negative integer. On failure, it returns a negative | |
84 | errno-style error code.</para> | |
85 | </refsect1> | |
86 | ||
87 | <refsect1> | |
88 | <title>Errors</title> | |
89 | ||
90 | <para>Returned errors may indicate the following problems:</para> | |
91 | ||
92 | <variablelist> | |
93 | <varlistentry> | |
94 | <term><constant>-EINVAL</constant></term> | |
95 | ||
96 | <listitem><para><parameter>event</parameter> is not a valid | |
97 | pointer to an <structname>sd_event</structname> structure. | |
98 | </para></listitem> | |
99 | </varlistentry> | |
100 | ||
101 | <varlistentry> | |
102 | <term><constant>-ECHILD</constant></term> | |
103 | ||
104 | <listitem><para>The event loop has been created in a different process.</para></listitem> | |
105 | ||
106 | </varlistentry> | |
107 | </variablelist> | |
108 | </refsect1> | |
109 | ||
110 | <refsect1> | |
111 | <title>Examples</title> | |
112 | ||
113 | <example> | |
114 | <title>Integration in glib event loop</title> | |
115 | ||
116 | <programlisting><xi:include href="glib-event-glue.c" parse="text" /></programlisting> | |
117 | </example> | |
118 | </refsect1> | |
119 | ||
120 | <refsect1> | |
121 | <title>Notes</title> | |
122 | ||
123 | <para><function>sd_event_get_fd()</function> is available as a | |
124 | shared library, which can be compiled and linked to with the | |
125 | <constant>libsystemd</constant> <citerefentry | |
126 | project='die-net'><refentrytitle>pkg-config</refentrytitle><manvolnum>1</manvolnum></citerefentry> | |
127 | file.</para> | |
128 | </refsect1> | |
129 | ||
130 | <refsect1> | |
131 | <title>See Also</title> | |
132 | ||
133 | <para> | |
134 | <citerefentry><refentrytitle>sd-event</refentrytitle><manvolnum>3</manvolnum></citerefentry>, | |
135 | <citerefentry><refentrytitle>sd_event_new</refentrytitle><manvolnum>3</manvolnum></citerefentry>, | |
136 | <citerefentry><refentrytitle>sd_event_ref</refentrytitle><manvolnum>3</manvolnum></citerefentry> | |
137 | </para> | |
138 | </refsect1> | |
139 | ||
140 | </refentry> |