~ubuntu-branches/ubuntu/trusty/glib2.0/trusty-proposed

« back to all changes in this revision

Viewing changes to docs/reference/glib/html/glib-Spawning-Processes.html

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2010-03-09 11:28:22 UTC
  • mfrom: (3.4.8 experimental)
  • Revision ID: james.westby@ubuntu.com-20100309112822-j4n0v3xbtsup8s97
Tags: 2.23.5-1ubuntu1
* Resync on Debian
* debian/patches/01_gettext-desktopfiles.patch:
  - updated to use gettext for X-GNOME-Fullname too
* debian/patches/71_gio_launch_handler.patch:
  - new gio default launch handle feature required for wncksync
* debian/control.in, 
  debian/patches/80-gtester-subunit.patch:
  - gtester-report subunit support
* debian/libglib2.0-0.symbols:
  - updated the symbols list for the gio launcher handler
* debian/rules:
  - don't break build on test suite errors, debian recently activated this but
    the build breaks even when there is no error in the testsuite

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
<head>
4
4
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
5
<title>Spawning Processes</title>
6
 
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
 
6
<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
7
7
<link rel="home" href="index.html" title="GLib Reference Manual">
8
8
<link rel="up" href="glib-utilities.html" title="GLib Utilities">
9
9
<link rel="prev" href="glib-Timers.html" title="Timers">
10
10
<link rel="next" href="glib-File-Utilities.html" title="File Utilities">
11
 
<meta name="generator" content="GTK-Doc V1.13 (XML mode)">
 
11
<meta name="generator" content="GTK-Doc V1.11 (XML mode)">
12
12
<link rel="stylesheet" href="style.css" type="text/css">
13
13
<link rel="chapter" href="glib.html" title="GLib Overview">
14
14
<link rel="chapter" href="glib-fundamentals.html" title="GLib Fundamentals">
42
42
</tr>
43
43
<tr><td colspan="5" class="shortcuts">
44
44
<a href="#glib-Spawning-Processes.synopsis" class="shortcut">Top</a>
45
 
                   | 
46
 
                  <a href="#glib-Spawning-Processes.description" class="shortcut">Description</a>
 
45
                 | 
 
46
                <a href="#glib-Spawning-Processes.description" class="shortcut">Description</a>
47
47
</td></tr>
48
48
</table>
49
49
<div class="refentry" title="Spawning Processes">
58
58
<div class="refsynopsisdiv" title="Synopsis">
59
59
<a name="glib-Spawning-Processes.synopsis"></a><h2>Synopsis</h2>
60
60
<pre class="synopsis">
 
61
 
61
62
#include &lt;glib.h&gt;
62
63
 
63
64
enum                <a class="link" href="glib-Spawning-Processes.html#GSpawnError" title="enum GSpawnError">GSpawnError</a>;
64
 
#define             <a class="link" href="glib-Spawning-Processes.html#G-SPAWN-ERROR:CAPS" title="G_SPAWN_ERROR">G_SPAWN_ERROR</a>
 
65
#define             <a class="link" href="glib-Spawning-Processes.html#G-SPAWN-ERROR--CAPS" title="G_SPAWN_ERROR">G_SPAWN_ERROR</a>
65
66
enum                <a class="link" href="glib-Spawning-Processes.html#GSpawnFlags" title="enum GSpawnFlags">GSpawnFlags</a>;
66
 
<span class="returnvalue">void</span>                (<a class="link" href="glib-Spawning-Processes.html#GSpawnChildSetupFunc" title="GSpawnChildSetupFunc ()">*GSpawnChildSetupFunc</a>)             (<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="returnvalue">gpointer</span></a> user_data);
67
 
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="glib-Spawning-Processes.html#g-spawn-async-with-pipes" title="g_spawn_async_with_pipes ()">g_spawn_async_with_pipes</a>            (const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *working_directory,
68
 
                                                         <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> **argv,
69
 
                                                         <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> **envp,
70
 
                                                         <a class="link" href="glib-Spawning-Processes.html#GSpawnFlags" title="enum GSpawnFlags"><span class="returnvalue">GSpawnFlags</span></a> flags,
71
 
                                                         <a class="link" href="glib-Spawning-Processes.html#GSpawnChildSetupFunc" title="GSpawnChildSetupFunc ()"><span class="returnvalue">GSpawnChildSetupFunc</span></a> child_setup,
72
 
                                                         <a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="returnvalue">gpointer</span></a> user_data,
73
 
                                                         <a class="link" href="glib-The-Main-Event-Loop.html#GPid" title="GPid"><span class="returnvalue">GPid</span></a> *child_pid,
74
 
                                                         <a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="returnvalue">gint</span></a> *standard_input,
75
 
                                                         <a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="returnvalue">gint</span></a> *standard_output,
76
 
                                                         <a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="returnvalue">gint</span></a> *standard_error,
77
 
                                                         <a class="link" href="glib-Error-Reporting.html#GError" title="GError"><span class="returnvalue">GError</span></a> **error);
78
 
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="glib-Spawning-Processes.html#g-spawn-async" title="g_spawn_async ()">g_spawn_async</a>                       (const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *working_directory,
79
 
                                                         <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> **argv,
80
 
                                                         <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> **envp,
81
 
                                                         <a class="link" href="glib-Spawning-Processes.html#GSpawnFlags" title="enum GSpawnFlags"><span class="returnvalue">GSpawnFlags</span></a> flags,
82
 
                                                         <a class="link" href="glib-Spawning-Processes.html#GSpawnChildSetupFunc" title="GSpawnChildSetupFunc ()"><span class="returnvalue">GSpawnChildSetupFunc</span></a> child_setup,
83
 
                                                         <a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="returnvalue">gpointer</span></a> user_data,
84
 
                                                         <a class="link" href="glib-The-Main-Event-Loop.html#GPid" title="GPid"><span class="returnvalue">GPid</span></a> *child_pid,
85
 
                                                         <a class="link" href="glib-Error-Reporting.html#GError" title="GError"><span class="returnvalue">GError</span></a> **error);
86
 
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="glib-Spawning-Processes.html#g-spawn-sync" title="g_spawn_sync ()">g_spawn_sync</a>                        (const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *working_directory,
87
 
                                                         <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> **argv,
88
 
                                                         <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> **envp,
89
 
                                                         <a class="link" href="glib-Spawning-Processes.html#GSpawnFlags" title="enum GSpawnFlags"><span class="returnvalue">GSpawnFlags</span></a> flags,
90
 
                                                         <a class="link" href="glib-Spawning-Processes.html#GSpawnChildSetupFunc" title="GSpawnChildSetupFunc ()"><span class="returnvalue">GSpawnChildSetupFunc</span></a> child_setup,
91
 
                                                         <a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="returnvalue">gpointer</span></a> user_data,
92
 
                                                         <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> **standard_output,
93
 
                                                         <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> **standard_error,
94
 
                                                         <a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="returnvalue">gint</span></a> *exit_status,
95
 
                                                         <a class="link" href="glib-Error-Reporting.html#GError" title="GError"><span class="returnvalue">GError</span></a> **error);
96
 
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="glib-Spawning-Processes.html#g-spawn-command-line-async" title="g_spawn_command_line_async ()">g_spawn_command_line_async</a>          (const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *command_line,
97
 
                                                         <a class="link" href="glib-Error-Reporting.html#GError" title="GError"><span class="returnvalue">GError</span></a> **error);
98
 
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="glib-Spawning-Processes.html#g-spawn-command-line-sync" title="g_spawn_command_line_sync ()">g_spawn_command_line_sync</a>           (const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *command_line,
99
 
                                                         <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> **standard_output,
100
 
                                                         <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> **standard_error,
101
 
                                                         <a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="returnvalue">gint</span></a> *exit_status,
102
 
                                                         <a class="link" href="glib-Error-Reporting.html#GError" title="GError"><span class="returnvalue">GError</span></a> **error);
103
 
<span class="returnvalue">void</span>                <a class="link" href="glib-Spawning-Processes.html#g-spawn-close-pid" title="g_spawn_close_pid ()">g_spawn_close_pid</a>                   (<a class="link" href="glib-The-Main-Event-Loop.html#GPid" title="GPid"><span class="returnvalue">GPid</span></a> pid);
 
67
void                (<a class="link" href="glib-Spawning-Processes.html#GSpawnChildSetupFunc" title="GSpawnChildSetupFunc ()">*GSpawnChildSetupFunc</a>)             (<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> user_data);
 
68
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a>            <a class="link" href="glib-Spawning-Processes.html#g-spawn-async-with-pipes" title="g_spawn_async_with_pipes ()">g_spawn_async_with_pipes</a>            (const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *working_directory,
 
69
                                                         <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> **argv,
 
70
                                                         <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> **envp,
 
71
                                                         <a class="link" href="glib-Spawning-Processes.html#GSpawnFlags" title="enum GSpawnFlags">GSpawnFlags</a> flags,
 
72
                                                         <a class="link" href="glib-Spawning-Processes.html#GSpawnChildSetupFunc" title="GSpawnChildSetupFunc ()">GSpawnChildSetupFunc</a> child_setup,
 
73
                                                         <a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> user_data,
 
74
                                                         <a class="link" href="glib-The-Main-Event-Loop.html#GPid" title="GPid">GPid</a> *child_pid,
 
75
                                                         <a class="link" href="glib-Basic-Types.html#gint" title="gint">gint</a> *standard_input,
 
76
                                                         <a class="link" href="glib-Basic-Types.html#gint" title="gint">gint</a> *standard_output,
 
77
                                                         <a class="link" href="glib-Basic-Types.html#gint" title="gint">gint</a> *standard_error,
 
78
                                                         <a class="link" href="glib-Error-Reporting.html#GError" title="GError">GError</a> **error);
 
79
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a>            <a class="link" href="glib-Spawning-Processes.html#g-spawn-async" title="g_spawn_async ()">g_spawn_async</a>                       (const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *working_directory,
 
80
                                                         <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> **argv,
 
81
                                                         <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> **envp,
 
82
                                                         <a class="link" href="glib-Spawning-Processes.html#GSpawnFlags" title="enum GSpawnFlags">GSpawnFlags</a> flags,
 
83
                                                         <a class="link" href="glib-Spawning-Processes.html#GSpawnChildSetupFunc" title="GSpawnChildSetupFunc ()">GSpawnChildSetupFunc</a> child_setup,
 
84
                                                         <a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> user_data,
 
85
                                                         <a class="link" href="glib-The-Main-Event-Loop.html#GPid" title="GPid">GPid</a> *child_pid,
 
86
                                                         <a class="link" href="glib-Error-Reporting.html#GError" title="GError">GError</a> **error);
 
87
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a>            <a class="link" href="glib-Spawning-Processes.html#g-spawn-sync" title="g_spawn_sync ()">g_spawn_sync</a>                        (const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *working_directory,
 
88
                                                         <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> **argv,
 
89
                                                         <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> **envp,
 
90
                                                         <a class="link" href="glib-Spawning-Processes.html#GSpawnFlags" title="enum GSpawnFlags">GSpawnFlags</a> flags,
 
91
                                                         <a class="link" href="glib-Spawning-Processes.html#GSpawnChildSetupFunc" title="GSpawnChildSetupFunc ()">GSpawnChildSetupFunc</a> child_setup,
 
92
                                                         <a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> user_data,
 
93
                                                         <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> **standard_output,
 
94
                                                         <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> **standard_error,
 
95
                                                         <a class="link" href="glib-Basic-Types.html#gint" title="gint">gint</a> *exit_status,
 
96
                                                         <a class="link" href="glib-Error-Reporting.html#GError" title="GError">GError</a> **error);
 
97
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a>            <a class="link" href="glib-Spawning-Processes.html#g-spawn-command-line-async" title="g_spawn_command_line_async ()">g_spawn_command_line_async</a>          (const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *command_line,
 
98
                                                         <a class="link" href="glib-Error-Reporting.html#GError" title="GError">GError</a> **error);
 
99
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a>            <a class="link" href="glib-Spawning-Processes.html#g-spawn-command-line-sync" title="g_spawn_command_line_sync ()">g_spawn_command_line_sync</a>           (const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *command_line,
 
100
                                                         <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> **standard_output,
 
101
                                                         <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> **standard_error,
 
102
                                                         <a class="link" href="glib-Basic-Types.html#gint" title="gint">gint</a> *exit_status,
 
103
                                                         <a class="link" href="glib-Error-Reporting.html#GError" title="GError">GError</a> **error);
 
104
void                <a class="link" href="glib-Spawning-Processes.html#g-spawn-close-pid" title="g_spawn_close_pid ()">g_spawn_close_pid</a>                   (<a class="link" href="glib-The-Main-Event-Loop.html#GPid" title="GPid">GPid</a> pid);
104
105
</pre>
105
106
</div>
106
107
<div class="refsect1" title="Description">
145
146
<col align="left" valign="top">
146
147
<tbody>
147
148
<tr>
148
 
<td><p><a name="G-SPAWN-ERROR-FORK:CAPS"></a><span class="term"><code class="literal">G_SPAWN_ERROR_FORK</code></span></p></td>
 
149
<td><p><a name="G-SPAWN-ERROR-FORK--CAPS"></a><span class="term"><code class="literal">G_SPAWN_ERROR_FORK</code></span></p></td>
149
150
<td>Fork failed due to lack of memory.
150
151
</td>
151
152
</tr>
152
153
<tr>
153
 
<td><p><a name="G-SPAWN-ERROR-READ:CAPS"></a><span class="term"><code class="literal">G_SPAWN_ERROR_READ</code></span></p></td>
 
154
<td><p><a name="G-SPAWN-ERROR-READ--CAPS"></a><span class="term"><code class="literal">G_SPAWN_ERROR_READ</code></span></p></td>
154
155
<td>Read or select on pipes failed.
155
156
</td>
156
157
</tr>
157
158
<tr>
158
 
<td><p><a name="G-SPAWN-ERROR-CHDIR:CAPS"></a><span class="term"><code class="literal">G_SPAWN_ERROR_CHDIR</code></span></p></td>
 
159
<td><p><a name="G-SPAWN-ERROR-CHDIR--CAPS"></a><span class="term"><code class="literal">G_SPAWN_ERROR_CHDIR</code></span></p></td>
159
160
<td>Changing to working directory failed.
160
161
</td>
161
162
</tr>
162
163
<tr>
163
 
<td><p><a name="G-SPAWN-ERROR-ACCES:CAPS"></a><span class="term"><code class="literal">G_SPAWN_ERROR_ACCES</code></span></p></td>
164
 
<td>execv() returned <code class="literal">EACCES</code>.
165
 
</td>
166
 
</tr>
167
 
<tr>
168
 
<td><p><a name="G-SPAWN-ERROR-PERM:CAPS"></a><span class="term"><code class="literal">G_SPAWN_ERROR_PERM</code></span></p></td>
169
 
<td>execv() returned <code class="literal">EPERM</code>.
170
 
</td>
171
 
</tr>
172
 
<tr>
173
 
<td><p><a name="G-SPAWN-ERROR-2BIG:CAPS"></a><span class="term"><code class="literal">G_SPAWN_ERROR_2BIG</code></span></p></td>
174
 
<td>execv() returned <code class="literal">E2BIG</code>.
175
 
</td>
176
 
</tr>
177
 
<tr>
178
 
<td><p><a name="G-SPAWN-ERROR-NOEXEC:CAPS"></a><span class="term"><code class="literal">G_SPAWN_ERROR_NOEXEC</code></span></p></td>
179
 
<td>execv() returned <code class="literal">ENOEXEC</code>.
180
 
</td>
181
 
</tr>
182
 
<tr>
183
 
<td><p><a name="G-SPAWN-ERROR-NAMETOOLONG:CAPS"></a><span class="term"><code class="literal">G_SPAWN_ERROR_NAMETOOLONG</code></span></p></td>
184
 
<td>execv() returned <code class="literal">ENAMETOOLONG</code>.
185
 
</td>
186
 
</tr>
187
 
<tr>
188
 
<td><p><a name="G-SPAWN-ERROR-NOENT:CAPS"></a><span class="term"><code class="literal">G_SPAWN_ERROR_NOENT</code></span></p></td>
189
 
<td>execv() returned <code class="literal">ENOENT</code>.
190
 
</td>
191
 
</tr>
192
 
<tr>
193
 
<td><p><a name="G-SPAWN-ERROR-NOMEM:CAPS"></a><span class="term"><code class="literal">G_SPAWN_ERROR_NOMEM</code></span></p></td>
194
 
<td>execv() returned <code class="literal">ENOMEM</code>.
195
 
</td>
196
 
</tr>
197
 
<tr>
198
 
<td><p><a name="G-SPAWN-ERROR-NOTDIR:CAPS"></a><span class="term"><code class="literal">G_SPAWN_ERROR_NOTDIR</code></span></p></td>
199
 
<td>execv() returned <code class="literal">ENOTDIR</code>.
200
 
</td>
201
 
</tr>
202
 
<tr>
203
 
<td><p><a name="G-SPAWN-ERROR-LOOP:CAPS"></a><span class="term"><code class="literal">G_SPAWN_ERROR_LOOP</code></span></p></td>
204
 
<td>execv() returned <code class="literal">ELOOP</code>.
205
 
</td>
206
 
</tr>
207
 
<tr>
208
 
<td><p><a name="G-SPAWN-ERROR-TXTBUSY:CAPS"></a><span class="term"><code class="literal">G_SPAWN_ERROR_TXTBUSY</code></span></p></td>
209
 
<td>execv() returned <code class="literal">ETXTBUSY</code>.
210
 
</td>
211
 
</tr>
212
 
<tr>
213
 
<td><p><a name="G-SPAWN-ERROR-IO:CAPS"></a><span class="term"><code class="literal">G_SPAWN_ERROR_IO</code></span></p></td>
214
 
<td>execv() returned <code class="literal">EIO</code>.
215
 
</td>
216
 
</tr>
217
 
<tr>
218
 
<td><p><a name="G-SPAWN-ERROR-NFILE:CAPS"></a><span class="term"><code class="literal">G_SPAWN_ERROR_NFILE</code></span></p></td>
219
 
<td>execv() returned <code class="literal">ENFILE</code>.
220
 
</td>
221
 
</tr>
222
 
<tr>
223
 
<td><p><a name="G-SPAWN-ERROR-MFILE:CAPS"></a><span class="term"><code class="literal">G_SPAWN_ERROR_MFILE</code></span></p></td>
224
 
<td>execv() returned <code class="literal">EMFILE</code>.
225
 
</td>
226
 
</tr>
227
 
<tr>
228
 
<td><p><a name="G-SPAWN-ERROR-INVAL:CAPS"></a><span class="term"><code class="literal">G_SPAWN_ERROR_INVAL</code></span></p></td>
229
 
<td>execv() returned <code class="literal">EINVAL</code>.
230
 
</td>
231
 
</tr>
232
 
<tr>
233
 
<td><p><a name="G-SPAWN-ERROR-ISDIR:CAPS"></a><span class="term"><code class="literal">G_SPAWN_ERROR_ISDIR</code></span></p></td>
234
 
<td>execv() returned <code class="literal">EISDIR</code>.
235
 
</td>
236
 
</tr>
237
 
<tr>
238
 
<td><p><a name="G-SPAWN-ERROR-LIBBAD:CAPS"></a><span class="term"><code class="literal">G_SPAWN_ERROR_LIBBAD</code></span></p></td>
239
 
<td>execv() returned <code class="literal">ELIBBAD</code>.
240
 
</td>
241
 
</tr>
242
 
<tr>
243
 
<td><p><a name="G-SPAWN-ERROR-FAILED:CAPS"></a><span class="term"><code class="literal">G_SPAWN_ERROR_FAILED</code></span></p></td>
 
164
<td><p><a name="G-SPAWN-ERROR-ACCES--CAPS"></a><span class="term"><code class="literal">G_SPAWN_ERROR_ACCES</code></span></p></td>
 
165
<td>
 
166
<code class="function">execv()</code> returned <code class="literal">EACCES</code>.
 
167
</td>
 
168
</tr>
 
169
<tr>
 
170
<td><p><a name="G-SPAWN-ERROR-PERM--CAPS"></a><span class="term"><code class="literal">G_SPAWN_ERROR_PERM</code></span></p></td>
 
171
<td>
 
172
<code class="function">execv()</code> returned <code class="literal">EPERM</code>.
 
173
</td>
 
174
</tr>
 
175
<tr>
 
176
<td><p><a name="G-SPAWN-ERROR-2BIG--CAPS"></a><span class="term"><code class="literal">G_SPAWN_ERROR_2BIG</code></span></p></td>
 
177
<td>
 
178
<code class="function">execv()</code> returned <code class="literal">E2BIG</code>.
 
179
</td>
 
180
</tr>
 
181
<tr>
 
182
<td><p><a name="G-SPAWN-ERROR-NOEXEC--CAPS"></a><span class="term"><code class="literal">G_SPAWN_ERROR_NOEXEC</code></span></p></td>
 
183
<td>
 
184
<code class="function">execv()</code> returned <code class="literal">ENOEXEC</code>.
 
185
</td>
 
186
</tr>
 
187
<tr>
 
188
<td><p><a name="G-SPAWN-ERROR-NAMETOOLONG--CAPS"></a><span class="term"><code class="literal">G_SPAWN_ERROR_NAMETOOLONG</code></span></p></td>
 
189
<td>
 
190
<code class="function">execv()</code> returned <code class="literal">ENAMETOOLONG</code>.
 
191
</td>
 
192
</tr>
 
193
<tr>
 
194
<td><p><a name="G-SPAWN-ERROR-NOENT--CAPS"></a><span class="term"><code class="literal">G_SPAWN_ERROR_NOENT</code></span></p></td>
 
195
<td>
 
196
<code class="function">execv()</code> returned <code class="literal">ENOENT</code>.
 
197
</td>
 
198
</tr>
 
199
<tr>
 
200
<td><p><a name="G-SPAWN-ERROR-NOMEM--CAPS"></a><span class="term"><code class="literal">G_SPAWN_ERROR_NOMEM</code></span></p></td>
 
201
<td>
 
202
<code class="function">execv()</code> returned <code class="literal">ENOMEM</code>.
 
203
</td>
 
204
</tr>
 
205
<tr>
 
206
<td><p><a name="G-SPAWN-ERROR-NOTDIR--CAPS"></a><span class="term"><code class="literal">G_SPAWN_ERROR_NOTDIR</code></span></p></td>
 
207
<td>
 
208
<code class="function">execv()</code> returned <code class="literal">ENOTDIR</code>.
 
209
</td>
 
210
</tr>
 
211
<tr>
 
212
<td><p><a name="G-SPAWN-ERROR-LOOP--CAPS"></a><span class="term"><code class="literal">G_SPAWN_ERROR_LOOP</code></span></p></td>
 
213
<td>
 
214
<code class="function">execv()</code> returned <code class="literal">ELOOP</code>.
 
215
</td>
 
216
</tr>
 
217
<tr>
 
218
<td><p><a name="G-SPAWN-ERROR-TXTBUSY--CAPS"></a><span class="term"><code class="literal">G_SPAWN_ERROR_TXTBUSY</code></span></p></td>
 
219
<td>
 
220
<code class="function">execv()</code> returned <code class="literal">ETXTBUSY</code>.
 
221
</td>
 
222
</tr>
 
223
<tr>
 
224
<td><p><a name="G-SPAWN-ERROR-IO--CAPS"></a><span class="term"><code class="literal">G_SPAWN_ERROR_IO</code></span></p></td>
 
225
<td>
 
226
<code class="function">execv()</code> returned <code class="literal">EIO</code>.
 
227
</td>
 
228
</tr>
 
229
<tr>
 
230
<td><p><a name="G-SPAWN-ERROR-NFILE--CAPS"></a><span class="term"><code class="literal">G_SPAWN_ERROR_NFILE</code></span></p></td>
 
231
<td>
 
232
<code class="function">execv()</code> returned <code class="literal">ENFILE</code>.
 
233
</td>
 
234
</tr>
 
235
<tr>
 
236
<td><p><a name="G-SPAWN-ERROR-MFILE--CAPS"></a><span class="term"><code class="literal">G_SPAWN_ERROR_MFILE</code></span></p></td>
 
237
<td>
 
238
<code class="function">execv()</code> returned <code class="literal">EMFILE</code>.
 
239
</td>
 
240
</tr>
 
241
<tr>
 
242
<td><p><a name="G-SPAWN-ERROR-INVAL--CAPS"></a><span class="term"><code class="literal">G_SPAWN_ERROR_INVAL</code></span></p></td>
 
243
<td>
 
244
<code class="function">execv()</code> returned <code class="literal">EINVAL</code>.
 
245
</td>
 
246
</tr>
 
247
<tr>
 
248
<td><p><a name="G-SPAWN-ERROR-ISDIR--CAPS"></a><span class="term"><code class="literal">G_SPAWN_ERROR_ISDIR</code></span></p></td>
 
249
<td>
 
250
<code class="function">execv()</code> returned <code class="literal">EISDIR</code>.
 
251
</td>
 
252
</tr>
 
253
<tr>
 
254
<td><p><a name="G-SPAWN-ERROR-LIBBAD--CAPS"></a><span class="term"><code class="literal">G_SPAWN_ERROR_LIBBAD</code></span></p></td>
 
255
<td>
 
256
<code class="function">execv()</code> returned <code class="literal">ELIBBAD</code>.
 
257
</td>
 
258
</tr>
 
259
<tr>
 
260
<td><p><a name="G-SPAWN-ERROR-FAILED--CAPS"></a><span class="term"><code class="literal">G_SPAWN_ERROR_FAILED</code></span></p></td>
244
261
<td>Some other fatal failure, <code class="literal">error-&gt;message</code> should explain.
245
262
</td>
246
263
</tr>
249
266
</div>
250
267
<hr>
251
268
<div class="refsect2" title="G_SPAWN_ERROR">
252
 
<a name="G-SPAWN-ERROR:CAPS"></a><h3>G_SPAWN_ERROR</h3>
253
 
<pre class="programlisting">#define             G_SPAWN_ERROR</pre>
 
269
<a name="G-SPAWN-ERROR--CAPS"></a><h3>G_SPAWN_ERROR</h3>
 
270
<pre class="programlisting">#define G_SPAWN_ERROR g_spawn_error_quark ()
 
271
</pre>
254
272
<p>
255
273
Error domain for spawning processes. Errors in this domain will
256
274
be from the <a class="link" href="glib-Spawning-Processes.html#GSpawnError" title="enum GSpawnError"><span class="type">GSpawnError</span></a> enumeration. See <a class="link" href="glib-Error-Reporting.html#GError" title="GError"><span class="type">GError</span></a> for information on
280
298
<col align="left" valign="top">
281
299
<tbody>
282
300
<tr>
283
 
<td><p><a name="G-SPAWN-LEAVE-DESCRIPTORS-OPEN:CAPS"></a><span class="term"><code class="literal">G_SPAWN_LEAVE_DESCRIPTORS_OPEN</code></span></p></td>
 
301
<td><p><a name="G-SPAWN-LEAVE-DESCRIPTORS-OPEN--CAPS"></a><span class="term"><code class="literal">G_SPAWN_LEAVE_DESCRIPTORS_OPEN</code></span></p></td>
284
302
<td>the parent's open file descriptors will be 
285
303
 inherited by the child; otherwise all descriptors except stdin/stdout/stderr
286
304
 will be closed before calling <code class="function">exec()</code> in the child.
287
305
</td>
288
306
</tr>
289
307
<tr>
290
 
<td><p><a name="G-SPAWN-DO-NOT-REAP-CHILD:CAPS"></a><span class="term"><code class="literal">G_SPAWN_DO_NOT_REAP_CHILD</code></span></p></td>
 
308
<td><p><a name="G-SPAWN-DO-NOT-REAP-CHILD--CAPS"></a><span class="term"><code class="literal">G_SPAWN_DO_NOT_REAP_CHILD</code></span></p></td>
291
309
<td>the child will not be automatically reaped; you 
292
310
  must use <a class="link" href="glib-The-Main-Event-Loop.html#g-child-watch-add" title="g_child_watch_add ()"><code class="function">g_child_watch_add()</code></a> yourself (or call <code class="function">waitpid()</code>
293
311
  or handle <code class="literal">SIGCHLD</code> yourself), or the child will become a zombie.
294
312
</td>
295
313
</tr>
296
314
<tr>
297
 
<td><p><a name="G-SPAWN-SEARCH-PATH:CAPS"></a><span class="term"><code class="literal">G_SPAWN_SEARCH_PATH</code></span></p></td>
 
315
<td><p><a name="G-SPAWN-SEARCH-PATH--CAPS"></a><span class="term"><code class="literal">G_SPAWN_SEARCH_PATH</code></span></p></td>
298
316
<td>
299
317
<code class="literal">argv[0]</code> need not be an absolute path, 
300
318
  it will be looked for in the user's <code class="envar">PATH</code>.
301
319
</td>
302
320
</tr>
303
321
<tr>
304
 
<td><p><a name="G-SPAWN-STDOUT-TO-DEV-NULL:CAPS"></a><span class="term"><code class="literal">G_SPAWN_STDOUT_TO_DEV_NULL</code></span></p></td>
 
322
<td><p><a name="G-SPAWN-STDOUT-TO-DEV-NULL--CAPS"></a><span class="term"><code class="literal">G_SPAWN_STDOUT_TO_DEV_NULL</code></span></p></td>
305
323
<td>the child's standard output will be discarded, 
306
324
  instead of going to the same location as the parent's standard output.
307
325
</td>
308
326
</tr>
309
327
<tr>
310
 
<td><p><a name="G-SPAWN-STDERR-TO-DEV-NULL:CAPS"></a><span class="term"><code class="literal">G_SPAWN_STDERR_TO_DEV_NULL</code></span></p></td>
 
328
<td><p><a name="G-SPAWN-STDERR-TO-DEV-NULL--CAPS"></a><span class="term"><code class="literal">G_SPAWN_STDERR_TO_DEV_NULL</code></span></p></td>
311
329
<td>the child's standard error will be discarded.
312
330
</td>
313
331
</tr>
314
332
<tr>
315
 
<td><p><a name="G-SPAWN-CHILD-INHERITS-STDIN:CAPS"></a><span class="term"><code class="literal">G_SPAWN_CHILD_INHERITS_STDIN</code></span></p></td>
 
333
<td><p><a name="G-SPAWN-CHILD-INHERITS-STDIN--CAPS"></a><span class="term"><code class="literal">G_SPAWN_CHILD_INHERITS_STDIN</code></span></p></td>
316
334
<td>the child will inherit the parent's standard 
317
335
  input (by default, the child's standard input is attached to
318
336
  <code class="filename">/dev/null</code>).
319
337
</td>
320
338
</tr>
321
339
<tr>
322
 
<td><p><a name="G-SPAWN-FILE-AND-ARGV-ZERO:CAPS"></a><span class="term"><code class="literal">G_SPAWN_FILE_AND_ARGV_ZERO</code></span></p></td>
 
340
<td><p><a name="G-SPAWN-FILE-AND-ARGV-ZERO--CAPS"></a><span class="term"><code class="literal">G_SPAWN_FILE_AND_ARGV_ZERO</code></span></p></td>
323
341
<td>the first element of <code class="literal">argv</code> is 
324
342
  the file to execute, while the remaining elements are the actual argument
325
343
  vector to pass to the file. Normally <a class="link" href="glib-Spawning-Processes.html#g-spawn-async-with-pipes" title="g_spawn_async_with_pipes ()"><code class="function">g_spawn_async_with_pipes()</code></a> uses
333
351
<hr>
334
352
<div class="refsect2" title="GSpawnChildSetupFunc ()">
335
353
<a name="GSpawnChildSetupFunc"></a><h3>GSpawnChildSetupFunc ()</h3>
336
 
<pre class="programlisting"><span class="returnvalue">void</span>                (*GSpawnChildSetupFunc)             (<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="returnvalue">gpointer</span></a> user_data);</pre>
 
354
<pre class="programlisting">void                (*GSpawnChildSetupFunc)             (<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> user_data);</pre>
337
355
<p>
338
356
Specifies the type of the setup function passed to <a class="link" href="glib-Spawning-Processes.html#g-spawn-async" title="g_spawn_async ()"><code class="function">g_spawn_async()</code></a>,
339
357
<a class="link" href="glib-Spawning-Processes.html#g-spawn-sync" title="g_spawn_sync ()"><code class="function">g_spawn_sync()</code></a> and <a class="link" href="glib-Spawning-Processes.html#g-spawn-async-with-pipes" title="g_spawn_async_with_pipes ()"><code class="function">g_spawn_async_with_pipes()</code></a>. On POSIX platforms it
349
367
<p>
350
368
Also note that modifying the environment from the child setup function
351
369
may not have the intended effect, since it will get overridden by
352
 
a non-<a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> <em class="parameter"><code>env</code></em> argument to the <code class="literal">g_spawn...</code> functions.
 
370
a non-<a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a> <em class="parameter"><code>env</code></em> argument to the <code class="literal">g_spawn...</code> functions.
353
371
</p>
354
372
<p>
355
373
On Windows the function is called in the parent. Its usefulness on
370
388
<hr>
371
389
<div class="refsect2" title="g_spawn_async_with_pipes ()">
372
390
<a name="g-spawn-async-with-pipes"></a><h3>g_spawn_async_with_pipes ()</h3>
373
 
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a>            g_spawn_async_with_pipes            (const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *working_directory,
374
 
                                                         <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> **argv,
375
 
                                                         <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> **envp,
376
 
                                                         <a class="link" href="glib-Spawning-Processes.html#GSpawnFlags" title="enum GSpawnFlags"><span class="returnvalue">GSpawnFlags</span></a> flags,
377
 
                                                         <a class="link" href="glib-Spawning-Processes.html#GSpawnChildSetupFunc" title="GSpawnChildSetupFunc ()"><span class="returnvalue">GSpawnChildSetupFunc</span></a> child_setup,
378
 
                                                         <a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="returnvalue">gpointer</span></a> user_data,
379
 
                                                         <a class="link" href="glib-The-Main-Event-Loop.html#GPid" title="GPid"><span class="returnvalue">GPid</span></a> *child_pid,
380
 
                                                         <a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="returnvalue">gint</span></a> *standard_input,
381
 
                                                         <a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="returnvalue">gint</span></a> *standard_output,
382
 
                                                         <a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="returnvalue">gint</span></a> *standard_error,
383
 
                                                         <a class="link" href="glib-Error-Reporting.html#GError" title="GError"><span class="returnvalue">GError</span></a> **error);</pre>
 
391
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a>            g_spawn_async_with_pipes            (const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *working_directory,
 
392
                                                         <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> **argv,
 
393
                                                         <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> **envp,
 
394
                                                         <a class="link" href="glib-Spawning-Processes.html#GSpawnFlags" title="enum GSpawnFlags">GSpawnFlags</a> flags,
 
395
                                                         <a class="link" href="glib-Spawning-Processes.html#GSpawnChildSetupFunc" title="GSpawnChildSetupFunc ()">GSpawnChildSetupFunc</a> child_setup,
 
396
                                                         <a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> user_data,
 
397
                                                         <a class="link" href="glib-The-Main-Event-Loop.html#GPid" title="GPid">GPid</a> *child_pid,
 
398
                                                         <a class="link" href="glib-Basic-Types.html#gint" title="gint">gint</a> *standard_input,
 
399
                                                         <a class="link" href="glib-Basic-Types.html#gint" title="gint">gint</a> *standard_output,
 
400
                                                         <a class="link" href="glib-Basic-Types.html#gint" title="gint">gint</a> *standard_error,
 
401
                                                         <a class="link" href="glib-Error-Reporting.html#GError" title="GError">GError</a> **error);</pre>
384
402
<p>
385
403
Executes a child program asynchronously (your program will not
386
404
block waiting for the child to exit). The child program is
387
405
specified by the only argument that must be provided, <em class="parameter"><code>argv</code></em>. <em class="parameter"><code>argv</code></em>
388
 
should be a <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>-terminated array of strings, to be passed as the
 
406
should be a <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a>-terminated array of strings, to be passed as the
389
407
argument vector for the child. The first string in <em class="parameter"><code>argv</code></em> is of
390
408
course the name of the program to execute. By default, the name of
391
409
the program must be a full path; the <code class="envar">PATH</code> shell variable 
392
 
will only be searched if you pass the <a class="link" href="glib-Spawning-Processes.html#G-SPAWN-SEARCH-PATH:CAPS"><code class="literal">G_SPAWN_SEARCH_PATH</code></a> flag.
 
410
will only be searched if you pass the <a class="link" href="glib-Spawning-Processes.html#G-SPAWN-SEARCH-PATH--CAPS"><code class="literal">G_SPAWN_SEARCH_PATH</code></a> flag.
393
411
</p>
394
412
<p>
395
413
On Windows, note that all the string or string vector arguments to
435
453
identifiers are different concepts on Windows.
436
454
</p>
437
455
<p>
438
 
<em class="parameter"><code>envp</code></em> is a <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>-terminated array of strings, where each string
 
456
<em class="parameter"><code>envp</code></em> is a <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a>-terminated array of strings, where each string
439
457
has the form <code class="literal">KEY=VALUE</code>. This will become
440
 
the child's environment. If <em class="parameter"><code>envp</code></em> is <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>, the child inherits its
 
458
the child's environment. If <em class="parameter"><code>envp</code></em> is <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a>, the child inherits its
441
459
parent's environment.
442
460
</p>
443
461
<p>
444
462
<em class="parameter"><code>flags</code></em> should be the bitwise OR of any flags you want to affect the
445
 
function's behaviour. The <a class="link" href="glib-Spawning-Processes.html#G-SPAWN-DO-NOT-REAP-CHILD:CAPS"><code class="literal">G_SPAWN_DO_NOT_REAP_CHILD</code></a> means that 
 
463
function's behaviour. The <a class="link" href="glib-Spawning-Processes.html#G-SPAWN-DO-NOT-REAP-CHILD--CAPS"><code class="literal">G_SPAWN_DO_NOT_REAP_CHILD</code></a> means that 
446
464
the child will not automatically be reaped; you must use a
447
465
<span class="type">GChildWatch</span> source to be notified about the death of the child 
448
466
process. Eventually you must call <a class="link" href="glib-Spawning-Processes.html#g-spawn-close-pid" title="g_spawn_close_pid ()"><code class="function">g_spawn_close_pid()</code></a> on the
454
472
<em class="parameter"><code>child_pid</code></em>).
455
473
</p>
456
474
<p>
457
 
<a class="link" href="glib-Spawning-Processes.html#G-SPAWN-LEAVE-DESCRIPTORS-OPEN:CAPS"><code class="literal">G_SPAWN_LEAVE_DESCRIPTORS_OPEN</code></a> means that the parent's open file
 
475
<a class="link" href="glib-Spawning-Processes.html#G-SPAWN-LEAVE-DESCRIPTORS-OPEN--CAPS"><code class="literal">G_SPAWN_LEAVE_DESCRIPTORS_OPEN</code></a> means that the parent's open file
458
476
descriptors will be inherited by the child; otherwise all
459
477
descriptors except stdin/stdout/stderr will be closed before
460
 
calling <code class="function">exec()</code> in the child. <a class="link" href="glib-Spawning-Processes.html#G-SPAWN-SEARCH-PATH:CAPS"><code class="literal">G_SPAWN_SEARCH_PATH</code></a> 
 
478
calling <code class="function">exec()</code> in the child. <a class="link" href="glib-Spawning-Processes.html#G-SPAWN-SEARCH-PATH--CAPS"><code class="literal">G_SPAWN_SEARCH_PATH</code></a> 
461
479
means that <code class="literal">argv[0]</code> need not be an absolute path, it
462
480
will be looked for in the user's <code class="envar">PATH</code>. 
463
 
<a class="link" href="glib-Spawning-Processes.html#G-SPAWN-STDOUT-TO-DEV-NULL:CAPS"><code class="literal">G_SPAWN_STDOUT_TO_DEV_NULL</code></a> means that the child's standard output will 
 
481
<a class="link" href="glib-Spawning-Processes.html#G-SPAWN-STDOUT-TO-DEV-NULL--CAPS"><code class="literal">G_SPAWN_STDOUT_TO_DEV_NULL</code></a> means that the child's standard output will 
464
482
be discarded, instead of going to the same location as the parent's 
465
 
standard output. If you use this flag, <em class="parameter"><code>standard_output</code></em> must be <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>.
466
 
<a class="link" href="glib-Spawning-Processes.html#G-SPAWN-STDERR-TO-DEV-NULL:CAPS"><code class="literal">G_SPAWN_STDERR_TO_DEV_NULL</code></a> means that the child's standard error
 
483
standard output. If you use this flag, <em class="parameter"><code>standard_output</code></em> must be <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a>.
 
484
<a class="link" href="glib-Spawning-Processes.html#G-SPAWN-STDERR-TO-DEV-NULL--CAPS"><code class="literal">G_SPAWN_STDERR_TO_DEV_NULL</code></a> means that the child's standard error
467
485
will be discarded, instead of going to the same location as the parent's
468
 
standard error. If you use this flag, <em class="parameter"><code>standard_error</code></em> must be <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>.
469
 
<a class="link" href="glib-Spawning-Processes.html#G-SPAWN-CHILD-INHERITS-STDIN:CAPS"><code class="literal">G_SPAWN_CHILD_INHERITS_STDIN</code></a> means that the child will inherit the parent's
 
486
standard error. If you use this flag, <em class="parameter"><code>standard_error</code></em> must be <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a>.
 
487
<a class="link" href="glib-Spawning-Processes.html#G-SPAWN-CHILD-INHERITS-STDIN--CAPS"><code class="literal">G_SPAWN_CHILD_INHERITS_STDIN</code></a> means that the child will inherit the parent's
470
488
standard input (by default, the child's standard input is attached to
471
 
/dev/null). If you use this flag, <em class="parameter"><code>standard_input</code></em> must be <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>.
472
 
<a class="link" href="glib-Spawning-Processes.html#G-SPAWN-FILE-AND-ARGV-ZERO:CAPS"><code class="literal">G_SPAWN_FILE_AND_ARGV_ZERO</code></a> means that the first element of <em class="parameter"><code>argv</code></em> is
 
489
/dev/null). If you use this flag, <em class="parameter"><code>standard_input</code></em> must be <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a>.
 
490
<a class="link" href="glib-Spawning-Processes.html#G-SPAWN-FILE-AND-ARGV-ZERO--CAPS"><code class="literal">G_SPAWN_FILE_AND_ARGV_ZERO</code></a> means that the first element of <em class="parameter"><code>argv</code></em> is
473
491
the file to execute, while the remaining elements are the
474
492
actual argument vector to pass to the file. Normally
475
493
<a class="link" href="glib-Spawning-Processes.html#g-spawn-async-with-pipes" title="g_spawn_async_with_pipes ()"><code class="function">g_spawn_async_with_pipes()</code></a> uses <em class="parameter"><code>argv</code></em>[0] as the file to execute, and
492
510
could be used for on Windows so it is ignored and not called.
493
511
</p>
494
512
<p>
495
 
If non-<a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>, <em class="parameter"><code>child_pid</code></em> will on Unix be filled with the child's
 
513
If non-<a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a>, <em class="parameter"><code>child_pid</code></em> will on Unix be filled with the child's
496
514
process ID. You can use the process ID to send signals to the
497
515
child, or to use <a class="link" href="glib-The-Main-Event-Loop.html#g-child-watch-add" title="g_child_watch_add ()"><code class="function">g_child_watch_add()</code></a> (or <code class="function">waitpid()</code>) if you specified the
498
 
<a class="link" href="glib-Spawning-Processes.html#G-SPAWN-DO-NOT-REAP-CHILD:CAPS"><code class="literal">G_SPAWN_DO_NOT_REAP_CHILD</code></a> flag. On Windows, <em class="parameter"><code>child_pid</code></em> will be
 
516
<a class="link" href="glib-Spawning-Processes.html#G-SPAWN-DO-NOT-REAP-CHILD--CAPS"><code class="literal">G_SPAWN_DO_NOT_REAP_CHILD</code></a> flag. On Windows, <em class="parameter"><code>child_pid</code></em> will be
499
517
filled with a handle to the child process only if you specified the
500
 
<a class="link" href="glib-Spawning-Processes.html#G-SPAWN-DO-NOT-REAP-CHILD:CAPS"><code class="literal">G_SPAWN_DO_NOT_REAP_CHILD</code></a> flag. You can then access the child
 
518
<a class="link" href="glib-Spawning-Processes.html#G-SPAWN-DO-NOT-REAP-CHILD--CAPS"><code class="literal">G_SPAWN_DO_NOT_REAP_CHILD</code></a> flag. You can then access the child
501
519
process using the Win32 API, for example wait for its termination
502
520
with the <code class="function">WaitFor*()</code> functions, or examine its
503
521
exit code with <code class="function">GetExitCodeProcess()</code>. You should close the handle 
504
522
with <code class="function">CloseHandle()</code> or <a class="link" href="glib-Spawning-Processes.html#g-spawn-close-pid" title="g_spawn_close_pid ()"><code class="function">g_spawn_close_pid()</code></a> when you no longer need it.
505
523
</p>
506
524
<p>
507
 
If non-<a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>, the <em class="parameter"><code>standard_input</code></em>, <em class="parameter"><code>standard_output</code></em>, <em class="parameter"><code>standard_error</code></em>
 
525
If non-<a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a>, the <em class="parameter"><code>standard_input</code></em>, <em class="parameter"><code>standard_output</code></em>, <em class="parameter"><code>standard_error</code></em>
508
526
locations will be filled with file descriptors for writing to the child's
509
527
standard input or reading from its standard output or standard error.
510
528
The caller of <a class="link" href="glib-Spawning-Processes.html#g-spawn-async-with-pipes" title="g_spawn_async_with_pipes ()"><code class="function">g_spawn_async_with_pipes()</code></a> must close these file descriptors
511
 
when they are no longer in use. If these parameters are <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>, the corresponding
 
529
when they are no longer in use. If these parameters are <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a>, the corresponding
512
530
pipe won't be created.
513
531
</p>
514
532
<p>
515
533
If <em class="parameter"><code>standard_input</code></em> is NULL, the child's standard input is attached to 
516
 
/dev/null unless <a class="link" href="glib-Spawning-Processes.html#G-SPAWN-CHILD-INHERITS-STDIN:CAPS"><code class="literal">G_SPAWN_CHILD_INHERITS_STDIN</code></a> is set.
 
534
/dev/null unless <a class="link" href="glib-Spawning-Processes.html#G-SPAWN-CHILD-INHERITS-STDIN--CAPS"><code class="literal">G_SPAWN_CHILD_INHERITS_STDIN</code></a> is set.
517
535
</p>
518
536
<p>
519
537
If <em class="parameter"><code>standard_error</code></em> is NULL, the child's standard error goes to the same 
520
 
location as the parent's standard error unless <a class="link" href="glib-Spawning-Processes.html#G-SPAWN-STDERR-TO-DEV-NULL:CAPS"><code class="literal">G_SPAWN_STDERR_TO_DEV_NULL</code></a> 
 
538
location as the parent's standard error unless <a class="link" href="glib-Spawning-Processes.html#G-SPAWN-STDERR-TO-DEV-NULL--CAPS"><code class="literal">G_SPAWN_STDERR_TO_DEV_NULL</code></a> 
521
539
is set.
522
540
</p>
523
541
<p>
524
542
If <em class="parameter"><code>standard_output</code></em> is NULL, the child's standard output goes to the same 
525
 
location as the parent's standard output unless <a class="link" href="glib-Spawning-Processes.html#G-SPAWN-STDOUT-TO-DEV-NULL:CAPS"><code class="literal">G_SPAWN_STDOUT_TO_DEV_NULL</code></a> 
 
543
location as the parent's standard output unless <a class="link" href="glib-Spawning-Processes.html#G-SPAWN-STDOUT-TO-DEV-NULL--CAPS"><code class="literal">G_SPAWN_STDOUT_TO_DEV_NULL</code></a> 
526
544
is set.
527
545
</p>
528
546
<p>
529
 
<em class="parameter"><code>error</code></em> can be <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> to ignore errors, or non-<a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> to report errors.
530
 
If an error is set, the function returns <a class="link" href="glib-Standard-Macros.html#FALSE:CAPS" title="FALSE"><code class="literal">FALSE</code></a>. Errors
 
547
<em class="parameter"><code>error</code></em> can be <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a> to ignore errors, or non-<a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a> to report errors.
 
548
If an error is set, the function returns <a class="link" href="glib-Standard-Macros.html#FALSE--CAPS" title="FALSE"><code class="literal">FALSE</code></a>. Errors
531
549
are reported even if they occur in the child (for example if the
532
550
executable in <code class="literal">argv[0]</code> is not found). Typically
533
551
the <code class="literal">message</code> field of returned errors should be displayed
534
 
to users. Possible errors are those from the <a class="link" href="glib-Spawning-Processes.html#G-SPAWN-ERROR:CAPS" title="G_SPAWN_ERROR"><span class="type">G_SPAWN_ERROR</span></a> domain.
 
552
to users. Possible errors are those from the <a class="link" href="glib-Spawning-Processes.html#G-SPAWN-ERROR--CAPS" title="G_SPAWN_ERROR"><span class="type">G_SPAWN_ERROR</span></a> domain.
535
553
</p>
536
554
<p>
537
555
If an error occurs, <em class="parameter"><code>child_pid</code></em>, <em class="parameter"><code>standard_input</code></em>, <em class="parameter"><code>standard_output</code></em>,
538
556
and <em class="parameter"><code>standard_error</code></em> will not be filled with valid values.
539
557
</p>
540
558
<p>
541
 
If <em class="parameter"><code>child_pid</code></em> is not <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> and an error does not occur then the returned
 
559
If <em class="parameter"><code>child_pid</code></em> is not <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a> and an error does not occur then the returned
542
560
process reference must be closed using <a class="link" href="glib-Spawning-Processes.html#g-spawn-close-pid" title="g_spawn_close_pid ()"><code class="function">g_spawn_close_pid()</code></a>.
543
561
</p>
544
562
<p>
548
566
<p>
549
567
If you are writing a GTK+ application, and the program you 
550
568
are spawning is a graphical application, too, then you may
551
 
want to use <a href="http://library.gnome.org/devel/gdk/unstable/GdkScreen.html#gdk-spawn-on-screen-with-pipes"><code class="function">gdk_spawn_on_screen_with_pipes()</code></a> instead to ensure that 
 
569
want to use <code class="function">gdk_spawn_on_screen_with_pipes()</code> instead to ensure that 
552
570
the spawned program opens its windows on the right screen.
553
571
</p>
554
572
</div>
 
573
<p>
 
574
</p>
555
575
<div class="variablelist"><table border="0">
556
576
<col align="left" valign="top">
557
577
<tbody>
558
578
<tr>
559
579
<td><p><span class="term"><em class="parameter"><code>working_directory</code></em> :</span></p></td>
560
 
<td> child's current working directory, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> to inherit parent's, in the GLib file name encoding
 
580
<td> child's current working directory, or <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a> to inherit parent's, in the GLib file name encoding
561
581
</td>
562
582
</tr>
563
583
<tr>
567
587
</tr>
568
588
<tr>
569
589
<td><p><span class="term"><em class="parameter"><code>envp</code></em> :</span></p></td>
570
 
<td> child's environment, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> to inherit parent's, in the GLib file name encoding
 
590
<td> child's environment, or <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a> to inherit parent's, in the GLib file name encoding
571
591
</td>
572
592
</tr>
573
593
<tr>
587
607
</tr>
588
608
<tr>
589
609
<td><p><span class="term"><em class="parameter"><code>child_pid</code></em> :</span></p></td>
590
 
<td> return location for child process ID, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>
 
610
<td> return location for child process ID, or <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a>
591
611
</td>
592
612
</tr>
593
613
<tr>
594
614
<td><p><span class="term"><em class="parameter"><code>standard_input</code></em> :</span></p></td>
595
 
<td> return location for file descriptor to write to child's stdin, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>
 
615
<td> return location for file descriptor to write to child's stdin, or <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a>
596
616
</td>
597
617
</tr>
598
618
<tr>
599
619
<td><p><span class="term"><em class="parameter"><code>standard_output</code></em> :</span></p></td>
600
 
<td> return location for file descriptor to read child's stdout, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>
 
620
<td> return location for file descriptor to read child's stdout, or <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a>
601
621
</td>
602
622
</tr>
603
623
<tr>
604
624
<td><p><span class="term"><em class="parameter"><code>standard_error</code></em> :</span></p></td>
605
 
<td> return location for file descriptor to read child's stderr, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>
 
625
<td> return location for file descriptor to read child's stderr, or <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a>
606
626
</td>
607
627
</tr>
608
628
<tr>
612
632
</tr>
613
633
<tr>
614
634
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
615
 
<td> <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> on success, <a class="link" href="glib-Standard-Macros.html#FALSE:CAPS" title="FALSE"><code class="literal">FALSE</code></a> if an error was set
 
635
<td> <a class="link" href="glib-Standard-Macros.html#TRUE--CAPS" title="TRUE"><code class="literal">TRUE</code></a> on success, <a class="link" href="glib-Standard-Macros.html#FALSE--CAPS" title="FALSE"><code class="literal">FALSE</code></a> if an error was set
616
636
</td>
617
637
</tr>
618
638
</tbody>
621
641
<hr>
622
642
<div class="refsect2" title="g_spawn_async ()">
623
643
<a name="g-spawn-async"></a><h3>g_spawn_async ()</h3>
624
 
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a>            g_spawn_async                       (const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *working_directory,
625
 
                                                         <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> **argv,
626
 
                                                         <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> **envp,
627
 
                                                         <a class="link" href="glib-Spawning-Processes.html#GSpawnFlags" title="enum GSpawnFlags"><span class="returnvalue">GSpawnFlags</span></a> flags,
628
 
                                                         <a class="link" href="glib-Spawning-Processes.html#GSpawnChildSetupFunc" title="GSpawnChildSetupFunc ()"><span class="returnvalue">GSpawnChildSetupFunc</span></a> child_setup,
629
 
                                                         <a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="returnvalue">gpointer</span></a> user_data,
630
 
                                                         <a class="link" href="glib-The-Main-Event-Loop.html#GPid" title="GPid"><span class="returnvalue">GPid</span></a> *child_pid,
631
 
                                                         <a class="link" href="glib-Error-Reporting.html#GError" title="GError"><span class="returnvalue">GError</span></a> **error);</pre>
 
644
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a>            g_spawn_async                       (const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *working_directory,
 
645
                                                         <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> **argv,
 
646
                                                         <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> **envp,
 
647
                                                         <a class="link" href="glib-Spawning-Processes.html#GSpawnFlags" title="enum GSpawnFlags">GSpawnFlags</a> flags,
 
648
                                                         <a class="link" href="glib-Spawning-Processes.html#GSpawnChildSetupFunc" title="GSpawnChildSetupFunc ()">GSpawnChildSetupFunc</a> child_setup,
 
649
                                                         <a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> user_data,
 
650
                                                         <a class="link" href="glib-The-Main-Event-Loop.html#GPid" title="GPid">GPid</a> *child_pid,
 
651
                                                         <a class="link" href="glib-Error-Reporting.html#GError" title="GError">GError</a> **error);</pre>
632
652
<p>
633
653
See <a class="link" href="glib-Spawning-Processes.html#g-spawn-async-with-pipes" title="g_spawn_async_with_pipes ()"><code class="function">g_spawn_async_with_pipes()</code></a> for a full description; this function
634
654
simply calls the <a class="link" href="glib-Spawning-Processes.html#g-spawn-async-with-pipes" title="g_spawn_async_with_pipes ()"><code class="function">g_spawn_async_with_pipes()</code></a> without any pipes.
644
664
<p>
645
665
If you are writing a GTK+ application, and the program you 
646
666
are spawning is a graphical application, too, then you may
647
 
want to use <a href="http://library.gnome.org/devel/gdk/unstable/GdkScreen.html#gdk-spawn-on-screen"><code class="function">gdk_spawn_on_screen()</code></a> instead to ensure that 
 
667
want to use <code class="function">gdk_spawn_on_screen()</code> instead to ensure that 
648
668
the spawned program opens its windows on the right screen.
649
669
</p>
650
670
</div>
659
679
and process identifiers are different concepts on Windows.
660
680
</p>
661
681
</div>
 
682
<p>
 
683
</p>
662
684
<div class="variablelist"><table border="0">
663
685
<col align="left" valign="top">
664
686
<tbody>
665
687
<tr>
666
688
<td><p><span class="term"><em class="parameter"><code>working_directory</code></em> :</span></p></td>
667
 
<td> child's current working directory, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> to inherit parent's
 
689
<td> child's current working directory, or <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a> to inherit parent's
668
690
</td>
669
691
</tr>
670
692
<tr>
674
696
</tr>
675
697
<tr>
676
698
<td><p><span class="term"><em class="parameter"><code>envp</code></em> :</span></p></td>
677
 
<td> child's environment, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> to inherit parent's
 
699
<td> child's environment, or <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a> to inherit parent's
678
700
</td>
679
701
</tr>
680
702
<tr>
694
716
</tr>
695
717
<tr>
696
718
<td><p><span class="term"><em class="parameter"><code>child_pid</code></em> :</span></p></td>
697
 
<td> return location for child process reference, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>
 
719
<td> return location for child process reference, or <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a>
698
720
</td>
699
721
</tr>
700
722
<tr>
704
726
</tr>
705
727
<tr>
706
728
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
707
 
<td> <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> on success, <a class="link" href="glib-Standard-Macros.html#FALSE:CAPS" title="FALSE"><code class="literal">FALSE</code></a> if error is set
 
729
<td> <a class="link" href="glib-Standard-Macros.html#TRUE--CAPS" title="TRUE"><code class="literal">TRUE</code></a> on success, <a class="link" href="glib-Standard-Macros.html#FALSE--CAPS" title="FALSE"><code class="literal">FALSE</code></a> if error is set
708
730
</td>
709
731
</tr>
710
732
</tbody>
713
735
<hr>
714
736
<div class="refsect2" title="g_spawn_sync ()">
715
737
<a name="g-spawn-sync"></a><h3>g_spawn_sync ()</h3>
716
 
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a>            g_spawn_sync                        (const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *working_directory,
717
 
                                                         <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> **argv,
718
 
                                                         <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> **envp,
719
 
                                                         <a class="link" href="glib-Spawning-Processes.html#GSpawnFlags" title="enum GSpawnFlags"><span class="returnvalue">GSpawnFlags</span></a> flags,
720
 
                                                         <a class="link" href="glib-Spawning-Processes.html#GSpawnChildSetupFunc" title="GSpawnChildSetupFunc ()"><span class="returnvalue">GSpawnChildSetupFunc</span></a> child_setup,
721
 
                                                         <a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="returnvalue">gpointer</span></a> user_data,
722
 
                                                         <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> **standard_output,
723
 
                                                         <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> **standard_error,
724
 
                                                         <a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="returnvalue">gint</span></a> *exit_status,
725
 
                                                         <a class="link" href="glib-Error-Reporting.html#GError" title="GError"><span class="returnvalue">GError</span></a> **error);</pre>
 
738
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a>            g_spawn_sync                        (const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *working_directory,
 
739
                                                         <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> **argv,
 
740
                                                         <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> **envp,
 
741
                                                         <a class="link" href="glib-Spawning-Processes.html#GSpawnFlags" title="enum GSpawnFlags">GSpawnFlags</a> flags,
 
742
                                                         <a class="link" href="glib-Spawning-Processes.html#GSpawnChildSetupFunc" title="GSpawnChildSetupFunc ()">GSpawnChildSetupFunc</a> child_setup,
 
743
                                                         <a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> user_data,
 
744
                                                         <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> **standard_output,
 
745
                                                         <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> **standard_error,
 
746
                                                         <a class="link" href="glib-Basic-Types.html#gint" title="gint">gint</a> *exit_status,
 
747
                                                         <a class="link" href="glib-Error-Reporting.html#GError" title="GError">GError</a> **error);</pre>
726
748
<p>
727
749
Executes a child synchronously (waits for the child to exit before returning).
728
750
All output from the child is stored in <em class="parameter"><code>standard_output</code></em> and <em class="parameter"><code>standard_error</code></em>,
729
 
if those parameters are non-<a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>. Note that you must set the  
730
 
<a class="link" href="glib-Spawning-Processes.html#G-SPAWN-STDOUT-TO-DEV-NULL:CAPS"><code class="literal">G_SPAWN_STDOUT_TO_DEV_NULL</code></a> and <a class="link" href="glib-Spawning-Processes.html#G-SPAWN-STDERR-TO-DEV-NULL:CAPS"><code class="literal">G_SPAWN_STDERR_TO_DEV_NULL</code></a> flags when
731
 
passing <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> for <em class="parameter"><code>standard_output</code></em> and <em class="parameter"><code>standard_error</code></em>.
732
 
If <em class="parameter"><code>exit_status</code></em> is non-<a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>, the exit status of the child is stored
 
751
if those parameters are non-<a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a>. Note that you must set the  
 
752
<a class="link" href="glib-Spawning-Processes.html#G-SPAWN-STDOUT-TO-DEV-NULL--CAPS"><code class="literal">G_SPAWN_STDOUT_TO_DEV_NULL</code></a> and <a class="link" href="glib-Spawning-Processes.html#G-SPAWN-STDERR-TO-DEV-NULL--CAPS"><code class="literal">G_SPAWN_STDERR_TO_DEV_NULL</code></a> flags when
 
753
passing <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a> for <em class="parameter"><code>standard_output</code></em> and <em class="parameter"><code>standard_error</code></em>.
 
754
If <em class="parameter"><code>exit_status</code></em> is non-<a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a>, the exit status of the child is stored
733
755
there as it would be returned by <code class="function">waitpid()</code>; standard UNIX macros such 
734
756
as <code class="function">WIFEXITED()</code> and <code class="function">WEXITSTATUS()</code> must be used to evaluate the exit status.
735
 
Note that this function call <code class="function">waitpid()</code> even if <em class="parameter"><code>exit_status</code></em> is <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>, and
736
 
does not accept the <a class="link" href="glib-Spawning-Processes.html#G-SPAWN-DO-NOT-REAP-CHILD:CAPS"><code class="literal">G_SPAWN_DO_NOT_REAP_CHILD</code></a> flag.
 
757
Note that this function call <code class="function">waitpid()</code> even if <em class="parameter"><code>exit_status</code></em> is <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a>, and
 
758
does not accept the <a class="link" href="glib-Spawning-Processes.html#G-SPAWN-DO-NOT-REAP-CHILD--CAPS"><code class="literal">G_SPAWN_DO_NOT_REAP_CHILD</code></a> flag.
737
759
If an error occurs, no data is returned in <em class="parameter"><code>standard_output</code></em>, 
738
760
<em class="parameter"><code>standard_error</code></em>, or <em class="parameter"><code>exit_status</code></em>. 
739
761
</p>
741
763
This function calls <a class="link" href="glib-Spawning-Processes.html#g-spawn-async-with-pipes" title="g_spawn_async_with_pipes ()"><code class="function">g_spawn_async_with_pipes()</code></a> internally; see that
742
764
function for full details on the other parameters and details on
743
765
how these functions work on Windows.</p>
 
766
<p>
 
767
</p>
744
768
<div class="variablelist"><table border="0">
745
769
<col align="left" valign="top">
746
770
<tbody>
747
771
<tr>
748
772
<td><p><span class="term"><em class="parameter"><code>working_directory</code></em> :</span></p></td>
749
 
<td> child's current working directory, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> to inherit parent's
 
773
<td> child's current working directory, or <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a> to inherit parent's
750
774
</td>
751
775
</tr>
752
776
<tr>
756
780
</tr>
757
781
<tr>
758
782
<td><p><span class="term"><em class="parameter"><code>envp</code></em> :</span></p></td>
759
 
<td> child's environment, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> to inherit parent's
 
783
<td> child's environment, or <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a> to inherit parent's
760
784
</td>
761
785
</tr>
762
786
<tr>
776
800
</tr>
777
801
<tr>
778
802
<td><p><span class="term"><em class="parameter"><code>standard_output</code></em> :</span></p></td>
779
 
<td> return location for child output, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>
 
803
<td> return location for child output, or <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a>
780
804
</td>
781
805
</tr>
782
806
<tr>
783
807
<td><p><span class="term"><em class="parameter"><code>standard_error</code></em> :</span></p></td>
784
 
<td> return location for child error messages, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>
 
808
<td> return location for child error messages, or <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a>
785
809
</td>
786
810
</tr>
787
811
<tr>
788
812
<td><p><span class="term"><em class="parameter"><code>exit_status</code></em> :</span></p></td>
789
 
<td> return location for child exit status, as returned by <code class="function">waitpid()</code>, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>
 
813
<td> return location for child exit status, as returned by <code class="function">waitpid()</code>, or <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a>
790
814
</td>
791
815
</tr>
792
816
<tr>
793
817
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
794
 
<td> return location for error, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>
 
818
<td> return location for error, or <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a>
795
819
</td>
796
820
</tr>
797
821
<tr>
798
822
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
799
 
<td> <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> on success, <a class="link" href="glib-Standard-Macros.html#FALSE:CAPS" title="FALSE"><code class="literal">FALSE</code></a> if an error was set.
 
823
<td> <a class="link" href="glib-Standard-Macros.html#TRUE--CAPS" title="TRUE"><code class="literal">TRUE</code></a> on success, <a class="link" href="glib-Standard-Macros.html#FALSE--CAPS" title="FALSE"><code class="literal">FALSE</code></a> if an error was set.
800
824
</td>
801
825
</tr>
802
826
</tbody>
805
829
<hr>
806
830
<div class="refsect2" title="g_spawn_command_line_async ()">
807
831
<a name="g-spawn-command-line-async"></a><h3>g_spawn_command_line_async ()</h3>
808
 
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a>            g_spawn_command_line_async          (const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *command_line,
809
 
                                                         <a class="link" href="glib-Error-Reporting.html#GError" title="GError"><span class="returnvalue">GError</span></a> **error);</pre>
 
832
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a>            g_spawn_command_line_async          (const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *command_line,
 
833
                                                         <a class="link" href="glib-Error-Reporting.html#GError" title="GError">GError</a> **error);</pre>
810
834
<p>
811
835
A simple version of <a class="link" href="glib-Spawning-Processes.html#g-spawn-async" title="g_spawn_async ()"><code class="function">g_spawn_async()</code></a> that parses a command line with
812
836
<a class="link" href="glib-Shell-related-Utilities.html#g-shell-parse-argv" title="g_shell_parse_argv ()"><code class="function">g_shell_parse_argv()</code></a> and passes it to <a class="link" href="glib-Spawning-Processes.html#g-spawn-async" title="g_spawn_async ()"><code class="function">g_spawn_async()</code></a>. Runs a
813
837
command line in the background. Unlike <a class="link" href="glib-Spawning-Processes.html#g-spawn-async" title="g_spawn_async ()"><code class="function">g_spawn_async()</code></a>, the
814
 
<a class="link" href="glib-Spawning-Processes.html#G-SPAWN-SEARCH-PATH:CAPS"><code class="literal">G_SPAWN_SEARCH_PATH</code></a> flag is enabled, other flags are not. Note
815
 
that <a class="link" href="glib-Spawning-Processes.html#G-SPAWN-SEARCH-PATH:CAPS"><code class="literal">G_SPAWN_SEARCH_PATH</code></a> can have security implications, so
 
838
<a class="link" href="glib-Spawning-Processes.html#G-SPAWN-SEARCH-PATH--CAPS"><code class="literal">G_SPAWN_SEARCH_PATH</code></a> flag is enabled, other flags are not. Note
 
839
that <a class="link" href="glib-Spawning-Processes.html#G-SPAWN-SEARCH-PATH--CAPS"><code class="literal">G_SPAWN_SEARCH_PATH</code></a> can have security implications, so
816
840
consider using <a class="link" href="glib-Spawning-Processes.html#g-spawn-async" title="g_spawn_async ()"><code class="function">g_spawn_async()</code></a> directly if appropriate. Possible
817
841
errors are those from <a class="link" href="glib-Shell-related-Utilities.html#g-shell-parse-argv" title="g_shell_parse_argv ()"><code class="function">g_shell_parse_argv()</code></a> and <a class="link" href="glib-Spawning-Processes.html#g-spawn-async" title="g_spawn_async ()"><code class="function">g_spawn_async()</code></a>.
818
842
</p>
819
843
<p>
820
844
The same concerns on Windows apply as for <a class="link" href="glib-Spawning-Processes.html#g-spawn-command-line-sync" title="g_spawn_command_line_sync ()"><code class="function">g_spawn_command_line_sync()</code></a>.</p>
 
845
<p>
 
846
</p>
821
847
<div class="variablelist"><table border="0">
822
848
<col align="left" valign="top">
823
849
<tbody>
833
859
</tr>
834
860
<tr>
835
861
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
836
 
<td> <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> on success, <a class="link" href="glib-Standard-Macros.html#FALSE:CAPS" title="FALSE"><code class="literal">FALSE</code></a> if error is set.
 
862
<td> <a class="link" href="glib-Standard-Macros.html#TRUE--CAPS" title="TRUE"><code class="literal">TRUE</code></a> on success, <a class="link" href="glib-Standard-Macros.html#FALSE--CAPS" title="FALSE"><code class="literal">FALSE</code></a> if error is set.
837
863
</td>
838
864
</tr>
839
865
</tbody>
842
868
<hr>
843
869
<div class="refsect2" title="g_spawn_command_line_sync ()">
844
870
<a name="g-spawn-command-line-sync"></a><h3>g_spawn_command_line_sync ()</h3>
845
 
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a>            g_spawn_command_line_sync           (const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *command_line,
846
 
                                                         <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> **standard_output,
847
 
                                                         <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> **standard_error,
848
 
                                                         <a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="returnvalue">gint</span></a> *exit_status,
849
 
                                                         <a class="link" href="glib-Error-Reporting.html#GError" title="GError"><span class="returnvalue">GError</span></a> **error);</pre>
 
871
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a>            g_spawn_command_line_sync           (const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *command_line,
 
872
                                                         <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> **standard_output,
 
873
                                                         <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> **standard_error,
 
874
                                                         <a class="link" href="glib-Basic-Types.html#gint" title="gint">gint</a> *exit_status,
 
875
                                                         <a class="link" href="glib-Error-Reporting.html#GError" title="GError">GError</a> **error);</pre>
850
876
<p>
851
877
A simple version of <a class="link" href="glib-Spawning-Processes.html#g-spawn-sync" title="g_spawn_sync ()"><code class="function">g_spawn_sync()</code></a> with little-used parameters
852
878
removed, taking a command line instead of an argument vector.  See
853
879
<a class="link" href="glib-Spawning-Processes.html#g-spawn-sync" title="g_spawn_sync ()"><code class="function">g_spawn_sync()</code></a> for full details. <em class="parameter"><code>command_line</code></em> will be parsed by
854
 
<a class="link" href="glib-Shell-related-Utilities.html#g-shell-parse-argv" title="g_shell_parse_argv ()"><code class="function">g_shell_parse_argv()</code></a>. Unlike <a class="link" href="glib-Spawning-Processes.html#g-spawn-sync" title="g_spawn_sync ()"><code class="function">g_spawn_sync()</code></a>, the <a class="link" href="glib-Spawning-Processes.html#G-SPAWN-SEARCH-PATH:CAPS"><code class="literal">G_SPAWN_SEARCH_PATH</code></a> flag
855
 
is enabled. Note that <a class="link" href="glib-Spawning-Processes.html#G-SPAWN-SEARCH-PATH:CAPS"><code class="literal">G_SPAWN_SEARCH_PATH</code></a> can have security
 
880
<a class="link" href="glib-Shell-related-Utilities.html#g-shell-parse-argv" title="g_shell_parse_argv ()"><code class="function">g_shell_parse_argv()</code></a>. Unlike <a class="link" href="glib-Spawning-Processes.html#g-spawn-sync" title="g_spawn_sync ()"><code class="function">g_spawn_sync()</code></a>, the <a class="link" href="glib-Spawning-Processes.html#G-SPAWN-SEARCH-PATH--CAPS"><code class="literal">G_SPAWN_SEARCH_PATH</code></a> flag
 
881
is enabled. Note that <a class="link" href="glib-Spawning-Processes.html#G-SPAWN-SEARCH-PATH--CAPS"><code class="literal">G_SPAWN_SEARCH_PATH</code></a> can have security
856
882
implications, so consider using <a class="link" href="glib-Spawning-Processes.html#g-spawn-sync" title="g_spawn_sync ()"><code class="function">g_spawn_sync()</code></a> directly if
857
883
appropriate. Possible errors are those from <a class="link" href="glib-Spawning-Processes.html#g-spawn-sync" title="g_spawn_sync ()"><code class="function">g_spawn_sync()</code></a> and those
858
884
from <a class="link" href="glib-Shell-related-Utilities.html#g-shell-parse-argv" title="g_shell_parse_argv ()"><code class="function">g_shell_parse_argv()</code></a>.
859
885
</p>
860
886
<p>
861
 
If <em class="parameter"><code>exit_status</code></em> is non-<a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>, the exit status of the child is stored there as
 
887
If <em class="parameter"><code>exit_status</code></em> is non-<a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a>, the exit status of the child is stored there as
862
888
it would be returned by <code class="function">waitpid()</code>; standard UNIX macros such as <code class="function">WIFEXITED()</code>
863
889
and <code class="function">WEXITSTATUS()</code> must be used to evaluate the exit status.
864
890
</p>
872
898
the backslashes will be eaten, and the space will act as a
873
899
separator. You need to enclose such paths with single quotes, like
874
900
"'c:\\program files\\app\\app.exe' 'e:\\folder\\argument.txt'".</p>
 
901
<p>
 
902
</p>
875
903
<div class="variablelist"><table border="0">
876
904
<col align="left" valign="top">
877
905
<tbody>
902
930
</tr>
903
931
<tr>
904
932
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
905
 
<td> <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> on success, <a class="link" href="glib-Standard-Macros.html#FALSE:CAPS" title="FALSE"><code class="literal">FALSE</code></a> if an error was set
 
933
<td> <a class="link" href="glib-Standard-Macros.html#TRUE--CAPS" title="TRUE"><code class="literal">TRUE</code></a> on success, <a class="link" href="glib-Standard-Macros.html#FALSE--CAPS" title="FALSE"><code class="literal">FALSE</code></a> if an error was set
906
934
</td>
907
935
</tr>
908
936
</tbody>
911
939
<hr>
912
940
<div class="refsect2" title="g_spawn_close_pid ()">
913
941
<a name="g-spawn-close-pid"></a><h3>g_spawn_close_pid ()</h3>
914
 
<pre class="programlisting"><span class="returnvalue">void</span>                g_spawn_close_pid                   (<a class="link" href="glib-The-Main-Event-Loop.html#GPid" title="GPid"><span class="returnvalue">GPid</span></a> pid);</pre>
 
942
<pre class="programlisting">void                g_spawn_close_pid                   (<a class="link" href="glib-The-Main-Event-Loop.html#GPid" title="GPid">GPid</a> pid);</pre>
915
943
<p>
916
944
On some platforms, notably Windows, the <a class="link" href="glib-The-Main-Event-Loop.html#GPid" title="GPid"><span class="type">GPid</span></a> type represents a resource
917
945
which must be closed to prevent resource leaking. <a class="link" href="glib-Spawning-Processes.html#g-spawn-close-pid" title="g_spawn_close_pid ()"><code class="function">g_spawn_close_pid()</code></a>
918
946
is provided for this purpose. It should be used on all platforms, even
919
947
though it doesn't do anything under UNIX.</p>
 
948
<p>
 
949
</p>
920
950
<div class="variablelist"><table border="0">
921
951
<col align="left" valign="top">
922
952
<tbody><tr>
930
960
</div>
931
961
<div class="footer">
932
962
<hr>
933
 
          Generated by GTK-Doc V1.13</div>
 
963
          Generated by GTK-Doc V1.11</div>
934
964
</body>
935
 
</html>
 
 
b'\\ No newline at end of file'
 
965
</html>