⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 glib-spawning-processes.html

📁 最新gtk中文资料集
💻 HTML
📖 第 1 页 / 共 4 页
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"><title>Spawning Processes</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2"><link rel="start" href="index.html" title="GLib Reference Manual"><link rel="up" href="glib-utilities.html" title="GLib Utilities"><link rel="prev" href="glib-Timers.html" title="Timers"><link rel="next" href="glib-File-Utilities.html" title="File Utilities"><meta name="generator" content="GTK-Doc V1.9 (XML mode)"><link rel="stylesheet" href="style.css" type="text/css"><link rel="chapter" href="glib.html" title="GLib Overview"><link rel="chapter" href="glib-fundamentals.html" title="GLib Fundamentals"><link rel="chapter" href="glib-core.html" title="GLib Core Application Support"><link rel="chapter" href="glib-utilities.html" title="GLib Utilities"><link rel="chapter" href="glib-data-types.html" title="GLib Data Types"><link rel="chapter" href="tools.html" title="GLib Tools"><link rel="index" href="ix01.html" title="Index"><link rel="index" href="ix02.html" title="Index of deprecated symbols"><link rel="index" href="ix03.html" title="Index of new symbols in 2.2"><link rel="index" href="ix04.html" title="Index of new symbols in 2.4"><link rel="index" href="ix05.html" title="Index of new symbols in 2.6"><link rel="index" href="ix06.html" title="Index of new symbols in 2.8"><link rel="index" href="ix07.html" title="Index of new symbols in 2.10"><link rel="index" href="ix08.html" title="Index of new symbols in 2.12"><link rel="index" href="ix09.html" title="Index of new symbols in 2.14"><link rel="index" href="ix10.html" title="Index of new symbols in 2.16"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="glib-Timers.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td><td><a accesskey="u" href="glib-utilities.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td><td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td><th width="100%" align="center">GLib Reference Manual</th><td><a accesskey="n" href="glib-File-Utilities.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td></tr><tr><td colspan="5" class="shortcuts"><nobr><a href="#id3097335" class="shortcut">Top</a>                  &#160;|&#160;                  <a href="#id3097798" class="shortcut">Description</a></nobr></td></tr></table><div class="refentry" lang="en"><a name="glib-Spawning-Processes"></a><div class="titlepage"></div><div class="refnamediv"><table width="100%"><tr><td valign="top"><h2><a name="id3097335"></a><span class="refentrytitle">Spawning Processes</span></h2><p>Spawning Processes &#8212; process launching with <code class="function">fork()</code>/<code class="function">exec()</code></p></td><td valign="top" align="right"></td></tr></table></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">#include &lt;glib.h&gt;enum                <a class="link" href="glib-Spawning-Processes.html#GSpawnError">GSpawnError</a>;#define             <a class="link" href="glib-Spawning-Processes.html#G-SPAWN-ERROR:CAPS">G_SPAWN_ERROR</a>enum                <a class="link" href="glib-Spawning-Processes.html#GSpawnFlags">GSpawnFlags</a>;void                (<a class="link" href="glib-Spawning-Processes.html#GSpawnChildSetupFunc">*GSpawnChildSetupFunc</a>)             (<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> user_data);<a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a>            <a class="link" href="glib-Spawning-Processes.html#g-spawn-async-with-pipes">g_spawn_async_with_pipes</a>            (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *working_directory,                                                         <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> **argv,                                                         <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> **envp,                                                         <a class="link" href="glib-Spawning-Processes.html#GSpawnFlags">GSpawnFlags</a> flags,                                                         <a class="link" href="glib-Spawning-Processes.html#GSpawnChildSetupFunc">GSpawnChildSetupFunc</a> child_setup,                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> user_data,                                                         <a class="link" href="glib-The-Main-Event-Loop.html#GPid">GPid</a> *child_pid,                                                         <a class="link" href="glib-Basic-Types.html#gint">gint</a> *standard_input,                                                         <a class="link" href="glib-Basic-Types.html#gint">gint</a> *standard_output,                                                         <a class="link" href="glib-Basic-Types.html#gint">gint</a> *standard_error,                                                         <a class="link" href="glib-Error-Reporting.html#GError">GError</a> **error);<a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a>            <a class="link" href="glib-Spawning-Processes.html#g-spawn-async">g_spawn_async</a>                       (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *working_directory,                                                         <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> **argv,                                                         <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> **envp,                                                         <a class="link" href="glib-Spawning-Processes.html#GSpawnFlags">GSpawnFlags</a> flags,                                                         <a class="link" href="glib-Spawning-Processes.html#GSpawnChildSetupFunc">GSpawnChildSetupFunc</a> child_setup,                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> user_data,                                                         <a class="link" href="glib-The-Main-Event-Loop.html#GPid">GPid</a> *child_pid,                                                         <a class="link" href="glib-Error-Reporting.html#GError">GError</a> **error);<a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a>            <a class="link" href="glib-Spawning-Processes.html#g-spawn-sync">g_spawn_sync</a>                        (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *working_directory,                                                         <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> **argv,                                                         <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> **envp,                                                         <a class="link" href="glib-Spawning-Processes.html#GSpawnFlags">GSpawnFlags</a> flags,                                                         <a class="link" href="glib-Spawning-Processes.html#GSpawnChildSetupFunc">GSpawnChildSetupFunc</a> child_setup,                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> user_data,                                                         <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> **standard_output,                                                         <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> **standard_error,                                                         <a class="link" href="glib-Basic-Types.html#gint">gint</a> *exit_status,                                                         <a class="link" href="glib-Error-Reporting.html#GError">GError</a> **error);<a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a>            <a class="link" href="glib-Spawning-Processes.html#g-spawn-command-line-async">g_spawn_command_line_async</a>          (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *command_line,                                                         <a class="link" href="glib-Error-Reporting.html#GError">GError</a> **error);<a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a>            <a class="link" href="glib-Spawning-Processes.html#g-spawn-command-line-sync">g_spawn_command_line_sync</a>           (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *command_line,                                                         <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> **standard_output,                                                         <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> **standard_error,                                                         <a class="link" href="glib-Basic-Types.html#gint">gint</a> *exit_status,                                                         <a class="link" href="glib-Error-Reporting.html#GError">GError</a> **error);void                <a class="link" href="glib-Spawning-Processes.html#g-spawn-close-pid">g_spawn_close_pid</a>                   (<a class="link" href="glib-The-Main-Event-Loop.html#GPid">GPid</a> pid);</pre></div><div class="refsect1" lang="en"><a name="id3097798"></a><h2>Description</h2><p></p></div><div class="refsect1" lang="en"><a name="id3097812"></a><h2>Details</h2><div class="refsect2" lang="en"><a name="id3097823"></a><h3><a name="GSpawnError"></a>enum GSpawnError</h3><a class="indexterm" name="id3097835"></a><pre class="programlisting">typedef enum{  G_SPAWN_ERROR_FORK,   /* fork failed due to lack of memory */  G_SPAWN_ERROR_READ,   /* read or select on pipes failed */  G_SPAWN_ERROR_CHDIR,  /* changing to working dir failed */  G_SPAWN_ERROR_ACCES,  /* execv() returned EACCES */  G_SPAWN_ERROR_PERM,   /* execv() returned EPERM */  G_SPAWN_ERROR_2BIG,   /* execv() returned E2BIG */  G_SPAWN_ERROR_NOEXEC, /* execv() returned ENOEXEC */  G_SPAWN_ERROR_NAMETOOLONG, /* ""  "" ENAMETOOLONG */  G_SPAWN_ERROR_NOENT,       /* ""  "" ENOENT */  G_SPAWN_ERROR_NOMEM,       /* ""  "" ENOMEM */  G_SPAWN_ERROR_NOTDIR,      /* ""  "" ENOTDIR */  G_SPAWN_ERROR_LOOP,        /* ""  "" ELOOP   */  G_SPAWN_ERROR_TXTBUSY,     /* ""  "" ETXTBUSY */  G_SPAWN_ERROR_IO,          /* ""  "" EIO */  G_SPAWN_ERROR_NFILE,       /* ""  "" ENFILE */  G_SPAWN_ERROR_MFILE,       /* ""  "" EMFLE */  G_SPAWN_ERROR_INVAL,       /* ""  "" EINVAL */  G_SPAWN_ERROR_ISDIR,       /* ""  "" EISDIR */  G_SPAWN_ERROR_LIBBAD,      /* ""  "" ELIBBAD */  G_SPAWN_ERROR_FAILED       /* other fatal failure, error-&gt;message                              * should explain                              */} GSpawnError;</pre><p>Error codes returned by spawning processes.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><a name="G-SPAWN-ERROR-FORK:CAPS"></a><code class="literal">G_SPAWN_ERROR_FORK</code></span></p></td><td>Fork failed due to lack of memory.</td></tr><tr><td><p><span class="term"><a name="G-SPAWN-ERROR-READ:CAPS"></a><code class="literal">G_SPAWN_ERROR_READ</code></span></p></td><td>Read or select on pipes failed.</td></tr><tr><td><p><span class="term"><a name="G-SPAWN-ERROR-CHDIR:CAPS"></a><code class="literal">G_SPAWN_ERROR_CHDIR</code></span></p></td><td>Changing to working directory failed.</td></tr><tr><td><p><span class="term"><a name="G-SPAWN-ERROR-ACCES:CAPS"></a><code class="literal">G_SPAWN_ERROR_ACCES</code></span></p></td><td><code class="function">execv()</code> returned <code class="literal">EACCES</code>.</td></tr><tr><td><p><span class="term"><a name="G-SPAWN-ERROR-PERM:CAPS"></a><code class="literal">G_SPAWN_ERROR_PERM</code></span></p></td><td><code class="function">execv()</code> returned <code class="literal">EPERM</code>.</td></tr><tr><td><p><span class="term"><a name="G-SPAWN-ERROR-2BIG:CAPS"></a><code class="literal">G_SPAWN_ERROR_2BIG</code></span></p></td><td><code class="function">execv()</code> returned <code class="literal">E2BIG</code>.</td></tr><tr><td><p><span class="term"><a name="G-SPAWN-ERROR-NOEXEC:CAPS"></a><code class="literal">G_SPAWN_ERROR_NOEXEC</code></span></p></td><td><code class="function">execv()</code> returned <code class="literal">ENOEXEC</code>.</td></tr><tr><td><p><span class="term"><a name="G-SPAWN-ERROR-NAMETOOLONG:CAPS"></a><code class="literal">G_SPAWN_ERROR_NAMETOOLONG</code></span></p></td><td><code class="function">execv()</code> returned <code class="literal">ENAMETOOLONG</code>.</td></tr><tr><td><p><span class="term"><a name="G-SPAWN-ERROR-NOENT:CAPS"></a><code class="literal">G_SPAWN_ERROR_NOENT</code></span></p></td><td><code class="function">execv()</code> returned <code class="literal">ENOENT</code>.</td></tr><tr><td><p><span class="term"><a name="G-SPAWN-ERROR-NOMEM:CAPS"></a><code class="literal">G_SPAWN_ERROR_NOMEM</code></span></p></td><td><code class="function">execv()</code> returned <code class="literal">ENOMEM</code>.</td></tr><tr><td><p><span class="term"><a name="G-SPAWN-ERROR-NOTDIR:CAPS"></a><code class="literal">G_SPAWN_ERROR_NOTDIR</code></span></p></td><td><code class="function">execv()</code> returned <code class="literal">ENOTDIR</code>.</td></tr><tr><td><p><span class="term"><a name="G-SPAWN-ERROR-LOOP:CAPS"></a><code class="literal">G_SPAWN_ERROR_LOOP</code></span></p></td><td><code class="function">execv()</code> returned <code class="literal">ELOOP</code>.</td></tr><tr><td><p><span class="term"><a name="G-SPAWN-ERROR-TXTBUSY:CAPS"></a><code class="literal">G_SPAWN_ERROR_TXTBUSY</code></span></p></td><td><code class="function">execv()</code> returned <code class="literal">ETXTBUSY</code>.</td></tr><tr><td><p><span class="term"><a name="G-SPAWN-ERROR-IO:CAPS"></a><code class="literal">G_SPAWN_ERROR_IO</code></span></p></td><td><code class="function">execv()</code> returned <code class="literal">EIO</code>.</td></tr><tr><td><p><span class="term"><a name="G-SPAWN-ERROR-NFILE:CAPS"></a><code class="literal">G_SPAWN_ERROR_NFILE</code></span></p></td><td><code class="function">execv()</code> returned <code class="literal">ENFILE</code>.</td></tr><tr><td><p><span class="term"><a name="G-SPAWN-ERROR-MFILE:CAPS"></a><code class="literal">G_SPAWN_ERROR_MFILE</code></span></p></td><td><code class="function">execv()</code> returned <code class="literal">EMFILE</code>.</td></tr><tr><td><p><span class="term"><a name="G-SPAWN-ERROR-INVAL:CAPS"></a><code class="literal">G_SPAWN_ERROR_INVAL</code></span></p></td>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -