1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>GUnixFDMessage</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
7 <link rel="home" href="index.html" title="GIO Reference Manual">
8 <link rel="up" href="networking.html" title="Lowlevel platform-independent network support">
9 <link rel="prev" href="GUnixFDList.html" title="GUnixFDList">
10 <link rel="next" href="resolver.html" title="DNS resolution">
11 <meta name="generator" content="GTK-Doc V1.13 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
13 <link rel="part" href="pt01.html" title="Part I. GIO Overview">
14 <link rel="chapter" href="ch01.html" title="Introduction">
15 <link rel="chapter" href="ch02.html" title="Compiling GIO applications">
16 <link rel="chapter" href="ch03.html" title="Running GIO applications">
17 <link rel="chapter" href="extending-gio.html" title="Extending GIO">
18 <link rel="part" href="pt02.html" title="Part II. API Reference">
19 <link rel="chapter" href="file_ops.html" title="File Operations">
20 <link rel="chapter" href="file_mon.html" title="File System Monitoring">
21 <link rel="chapter" href="async.html" title="Asynchronous I/O">
22 <link rel="chapter" href="conversion.html" title="Data conversion">
23 <link rel="chapter" href="streaming.html" title="Streaming I/O">
24 <link rel="chapter" href="types.html" title="File types and applications">
25 <link rel="chapter" href="volume_mon.html" title="Volumes and Drives">
26 <link rel="chapter" href="icons.html" title="Icons">
27 <link rel="chapter" href="failable_initialization.html" title="Failable Initialization">
28 <link rel="chapter" href="networking.html" title="Lowlevel platform-independent network support">
29 <link rel="chapter" href="resolver.html" title="DNS resolution">
30 <link rel="chapter" href="highlevel-socket.html" title="Highlevel network functionallity">
31 <link rel="chapter" href="utils.html" title="Utilities">
32 <link rel="chapter" href="extending.html" title="Extending GIO">
33 <link rel="part" href="migrating.html" title="Part III. Migrating to GIO">
34 <link rel="chapter" href="ch19.html" title="Migrating from POSIX to GIO">
35 <link rel="chapter" href="ch20.html" title="Migrating from GnomeVFS to GIO">
36 <link rel="chapter" href="gio-hierarchy.html" title="Object Hierarchy">
37 <link rel="index" href="api-index-full.html" title="Index">
38 <link rel="index" href="api-index-deprecated.html" title="Index of deprecated symbols">
39 <link rel="index" href="api-index-2-18.html" title="Index of new symbols in 2.18">
40 <link rel="index" href="api-index-2-20.html" title="Index of new symbols in 2.20">
41 <link rel="index" href="api-index-2-22.html" title="Index of new symbols in 2.22">
42 <link rel="index" href="api-index-2-24.html" title="Index of new symbols in 2.24">
44 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
45 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
47 <td><a accesskey="p" href="GUnixFDList.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
48 <td><a accesskey="u" href="networking.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
49 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
50 <th width="100%" align="center">GIO Reference Manual</th>
51 <td><a accesskey="n" href="resolver.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
53 <tr><td colspan="5" class="shortcuts">
54 <a href="#GUnixFDMessage.synopsis" class="shortcut">Top</a>
56 <a href="#GUnixFDMessage.description" class="shortcut">Description</a>
58 <a href="#GUnixFDMessage.object-hierarchy" class="shortcut">Object Hierarchy</a>
60 <a href="#GUnixFDMessage.properties" class="shortcut">Properties</a>
63 <div class="refentry" title="GUnixFDMessage">
64 <a name="GUnixFDMessage"></a><div class="titlepage"></div>
65 <div class="refnamediv"><table width="100%"><tr>
67 <h2><span class="refentrytitle"><a name="GUnixFDMessage.top_of_page"></a>GUnixFDMessage</span></h2>
68 <p>GUnixFDMessage — A GSocketControlMessage containing a <a class="link" href="GUnixFDList.html" title="GUnixFDList"><span class="type">GUnixFDList</span></a></p>
70 <td valign="top" align="right"></td>
72 <div class="refsynopsisdiv" title="Synopsis">
73 <a name="GUnixFDMessage.synopsis"></a><h2>Synopsis</h2>
74 <pre class="synopsis"> <a class="link" href="GUnixFDMessage.html#GUnixFDMessage-struct" title="GUnixFDMessage">GUnixFDMessage</a>;
75 <a class="link" href="GSocketControlMessage.html" title="GSocketControlMessage"><span class="returnvalue">GSocketControlMessage</span></a> * <a class="link" href="GUnixFDMessage.html#g-unix-fd-message-new-with-fd-list" title="g_unix_fd_message_new_with_fd_list ()">g_unix_fd_message_new_with_fd_list</a>
76 (<a class="link" href="GUnixFDList.html" title="GUnixFDList"><span class="returnvalue">GUnixFDList</span></a> *fd_list);
77 <a class="link" href="GSocketControlMessage.html" title="GSocketControlMessage"><span class="returnvalue">GSocketControlMessage</span></a> * <a class="link" href="GUnixFDMessage.html#g-unix-fd-message-new" title="g_unix_fd_message_new ()">g_unix_fd_message_new</a> (void);
78 <a class="link" href="GUnixFDList.html" title="GUnixFDList"><span class="returnvalue">GUnixFDList</span></a> * <a class="link" href="GUnixFDMessage.html#g-unix-fd-message-get-fd-list" title="g_unix_fd_message_get_fd_list ()">g_unix_fd_message_get_fd_list</a> (<a class="link" href="GUnixFDMessage.html" title="GUnixFDMessage"><span class="returnvalue">GUnixFDMessage</span></a> *message);
79 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="GUnixFDMessage.html#g-unix-fd-message-append-fd" title="g_unix_fd_message_append_fd ()">g_unix_fd_message_append_fd</a> (<a class="link" href="GUnixFDMessage.html" title="GUnixFDMessage"><span class="returnvalue">GUnixFDMessage</span></a> *message,
80 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a> fd,
81 <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="returnvalue">GError</span></a> **error);
82 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a> * <a class="link" href="GUnixFDMessage.html#g-unix-fd-message-steal-fds" title="g_unix_fd_message_steal_fds ()">g_unix_fd_message_steal_fds</a> (<a class="link" href="GUnixFDMessage.html" title="GUnixFDMessage"><span class="returnvalue">GUnixFDMessage</span></a> *message,
83 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a> *length);
86 <div class="refsect1" title="Object Hierarchy">
87 <a name="GUnixFDMessage.object-hierarchy"></a><h2>Object Hierarchy</h2>
88 <pre class="synopsis">
89 <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject">GObject</a>
90 +----<a class="link" href="GSocketControlMessage.html" title="GSocketControlMessage">GSocketControlMessage</a>
94 <div class="refsect1" title="Properties">
95 <a name="GUnixFDMessage.properties"></a><h2>Properties</h2>
96 <pre class="synopsis">
97 "<a class="link" href="GUnixFDMessage.html#GUnixFDMessage--fd-list" title='The "fd-list" property'>fd-list</a>" <a class="link" href="GUnixFDList.html" title="GUnixFDList"><span class="type">GUnixFDList</span></a>* : Read / Write / Construct Only
100 <div class="refsect1" title="Description">
101 <a name="GUnixFDMessage.description"></a><h2>Description</h2>
103 This <a class="link" href="GSocketControlMessage.html" title="GSocketControlMessage"><span class="type">GSocketControlMessage</span></a> contains a <a class="link" href="GUnixFDList.html" title="GUnixFDList"><span class="type">GUnixFDList</span></a>. It may be sent
104 using <a class="link" href="GSocket.html#g-socket-send-message" title="g_socket_send_message ()"><code class="function">g_socket_send_message()</code></a> and received using
105 <a class="link" href="GSocket.html#g-socket-receive-message" title="g_socket_receive_message ()"><code class="function">g_socket_receive_message()</code></a> over UNIX sockets (ie: sockets in the
106 <code class="literal">G_SOCKET_ADDRESS_UNIX</code> family). The file descriptors are copied
107 between processes by the kernel.
110 For an easier way to send and receive file descriptors over
111 stream-oriented UNIX sockets, see <a class="link" href="GSocketConnection.html#g-unix-connection-send-fd" title="g_unix_connection_send_fd ()"><code class="function">g_unix_connection_send_fd()</code></a> and
112 <a class="link" href="GSocketConnection.html#g-unix-connection-receive-fd" title="g_unix_connection_receive_fd ()"><code class="function">g_unix_connection_receive_fd()</code></a>.</p>
114 <div class="refsect1" title="Details">
115 <a name="GUnixFDMessage.details"></a><h2>Details</h2>
116 <div class="refsect2" title="GUnixFDMessage">
117 <a name="GUnixFDMessage-struct"></a><h3>GUnixFDMessage</h3>
118 <pre class="programlisting">typedef struct _GUnixFDMessage GUnixFDMessage;</pre>
123 <div class="refsect2" title="g_unix_fd_message_new_with_fd_list ()">
124 <a name="g-unix-fd-message-new-with-fd-list"></a><h3>g_unix_fd_message_new_with_fd_list ()</h3>
125 <pre class="programlisting"><a class="link" href="GSocketControlMessage.html" title="GSocketControlMessage"><span class="returnvalue">GSocketControlMessage</span></a> * g_unix_fd_message_new_with_fd_list
126 (<a class="link" href="GUnixFDList.html" title="GUnixFDList"><span class="returnvalue">GUnixFDList</span></a> *fd_list);</pre>
128 Creates a new <a class="link" href="GUnixFDMessage.html" title="GUnixFDMessage"><span class="type">GUnixFDMessage</span></a> containing <em class="parameter"><code>list</code></em>.</p>
129 <div class="variablelist"><table border="0">
130 <col align="left" valign="top">
133 <td><p><span class="term"><em class="parameter"><code>fd_list</code></em> :</span></p></td>
134 <td> a <a class="link" href="GUnixFDList.html" title="GUnixFDList"><span class="type">GUnixFDList</span></a>
138 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
139 <td> a new <a class="link" href="GUnixFDMessage.html" title="GUnixFDMessage"><span class="type">GUnixFDMessage</span></a>
145 <p class="since">Since 2.24</p>
148 <div class="refsect2" title="g_unix_fd_message_new ()">
149 <a name="g-unix-fd-message-new"></a><h3>g_unix_fd_message_new ()</h3>
150 <pre class="programlisting"><a class="link" href="GSocketControlMessage.html" title="GSocketControlMessage"><span class="returnvalue">GSocketControlMessage</span></a> * g_unix_fd_message_new (void);</pre>
152 Creates a new <a class="link" href="GUnixFDMessage.html" title="GUnixFDMessage"><span class="type">GUnixFDMessage</span></a> containing an empty file descriptor
154 <div class="variablelist"><table border="0">
155 <col align="left" valign="top">
157 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
158 <td> a new <a class="link" href="GUnixFDMessage.html" title="GUnixFDMessage"><span class="type">GUnixFDMessage</span></a>
163 <p class="since">Since 2.22</p>
166 <div class="refsect2" title="g_unix_fd_message_get_fd_list ()">
167 <a name="g-unix-fd-message-get-fd-list"></a><h3>g_unix_fd_message_get_fd_list ()</h3>
168 <pre class="programlisting"><a class="link" href="GUnixFDList.html" title="GUnixFDList"><span class="returnvalue">GUnixFDList</span></a> * g_unix_fd_message_get_fd_list (<a class="link" href="GUnixFDMessage.html" title="GUnixFDMessage"><span class="returnvalue">GUnixFDMessage</span></a> *message);</pre>
170 Gets the <a class="link" href="GUnixFDList.html" title="GUnixFDList"><span class="type">GUnixFDList</span></a> contained in <em class="parameter"><code>message</code></em>. This function does not
171 return a reference to the caller, but the returned list is valid for
172 the lifetime of <em class="parameter"><code>message</code></em>.</p>
173 <div class="variablelist"><table border="0">
174 <col align="left" valign="top">
177 <td><p><span class="term"><em class="parameter"><code>message</code></em> :</span></p></td>
178 <td> a <a class="link" href="GUnixFDMessage.html" title="GUnixFDMessage"><span class="type">GUnixFDMessage</span></a>
182 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
183 <td> the <a class="link" href="GUnixFDList.html" title="GUnixFDList"><span class="type">GUnixFDList</span></a> from <em class="parameter"><code>message</code></em>
189 <p class="since">Since 2.24</p>
192 <div class="refsect2" title="g_unix_fd_message_append_fd ()">
193 <a name="g-unix-fd-message-append-fd"></a><h3>g_unix_fd_message_append_fd ()</h3>
194 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> g_unix_fd_message_append_fd (<a class="link" href="GUnixFDMessage.html" title="GUnixFDMessage"><span class="returnvalue">GUnixFDMessage</span></a> *message,
195 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a> fd,
196 <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="returnvalue">GError</span></a> **error);</pre>
198 Adds a file descriptor to <em class="parameter"><code>message</code></em>.
201 The file descriptor is duplicated using <code class="function">dup()</code>. You keep your copy
202 of the descriptor and the copy contained in <em class="parameter"><code>message</code></em> will be closed
203 when <em class="parameter"><code>message</code></em> is finalized.
206 A possible cause of failure is exceeding the per-process or
207 system-wide file descriptor limit.</p>
208 <div class="variablelist"><table border="0">
209 <col align="left" valign="top">
212 <td><p><span class="term"><em class="parameter"><code>message</code></em> :</span></p></td>
213 <td> a <a class="link" href="GUnixFDMessage.html" title="GUnixFDMessage"><span class="type">GUnixFDMessage</span></a>
217 <td><p><span class="term"><em class="parameter"><code>fd</code></em> :</span></p></td>
218 <td> a valid open file descriptor
222 <td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
223 <td> a <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> pointer
227 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
228 <td> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> in case of success, else <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> (and <em class="parameter"><code>error</code></em> is set)
234 <p class="since">Since 2.22</p>
237 <div class="refsect2" title="g_unix_fd_message_steal_fds ()">
238 <a name="g-unix-fd-message-steal-fds"></a><h3>g_unix_fd_message_steal_fds ()</h3>
239 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a> * g_unix_fd_message_steal_fds (<a class="link" href="GUnixFDMessage.html" title="GUnixFDMessage"><span class="returnvalue">GUnixFDMessage</span></a> *message,
240 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a> *length);</pre>
242 Returns the array of file descriptors that is contained in this
246 After this call, the descriptors are no longer contained in
247 <em class="parameter"><code>message</code></em>. Further calls will return an empty list (unless more
248 descriptors have been added).
251 The return result of this function must be freed with <a href="http://library.gnome.org/devel/glib/unstable/glib-Memory-Allocation.html#g-free"><code class="function">g_free()</code></a>.
252 The caller is also responsible for closing all of the file
256 If <em class="parameter"><code>length</code></em> is non-<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> then it is set to the number of file
257 descriptors in the returned array. The returned array is also
261 This function never returns <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. In case there are no file
262 descriptors contained in <em class="parameter"><code>message</code></em>, an empty array is returned.</p>
263 <div class="variablelist"><table border="0">
264 <col align="left" valign="top">
267 <td><p><span class="term"><em class="parameter"><code>message</code></em> :</span></p></td>
268 <td> a <a class="link" href="GUnixFDMessage.html" title="GUnixFDMessage"><span class="type">GUnixFDMessage</span></a>
272 <td><p><span class="term"><em class="parameter"><code>length</code></em> :</span></p></td>
273 <td> pointer to the length of the returned array, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
277 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
278 <td> an array of file descriptors
284 <p class="since">Since 2.22</p>
287 <div class="refsect1" title="Property Details">
288 <a name="GUnixFDMessage.property-details"></a><h2>Property Details</h2>
289 <div class="refsect2" title='The "fd-list" property'>
290 <a name="GUnixFDMessage--fd-list"></a><h3>The <code class="literal">"fd-list"</code> property</h3>
291 <pre class="programlisting"> "fd-list" <a class="link" href="GUnixFDList.html" title="GUnixFDList"><span class="type">GUnixFDList</span></a>* : Read / Write / Construct Only</pre>
292 <p>The GUnixFDList object to send with the message.</p>
295 <div class="refsect1" title="See Also">
296 <a name="GUnixFDMessage.see-also"></a><h2>See Also</h2>
297 <a class="link" href="GSocketConnection.html#GUnixConnection"><span class="type">GUnixConnection</span></a>, <a class="link" href="GUnixFDList.html" title="GUnixFDList"><span class="type">GUnixFDList</span></a>, <a class="link" href="GSocketControlMessage.html" title="GSocketControlMessage"><span class="type">GSocketControlMessage</span></a>
302 Generated by GTK-Doc V1.13</div>