static extern bool g_spawn_async_with_pipes(string working_directory, IntPtr argv, IntPtr envp, int flags, GSpawnChildSetupFunc child_setup_func, IntPtr user_data, out int child_pid, out int stdin, out int stdout, out int stderr, out IntPtr error);
public void SpawnAsyncWithPipes(string working_directory, string[] argv, string[] envp, GSpawnFlags flags, ChildSetupFunc child_setup_func, out int child_pid, out int stdin, out int stdout, out int stderr) { bool result; IntPtr argv_native; IntPtr envp_native; IntPtr error; argv_native = make_native_string_array (argv); envp_native = make_native_string_array (envp); if (child_setup_func != null) { child_setup_fn = new ChildSetupFunc (child_setup_func); child_setup_fn_proxy = new GSpawnChildSetupFunc (child_setup_cb); } else child_setup_fn_proxy = null; result = g_spawn_async_with_pipes (working_directory, argv_native, envp_native, (int) flags, child_setup_fn_proxy, IntPtr.Zero, out child_pid, out stdin, out stdout, out stderr, out error); free_native_string_array (argv_native, argv); free_native_string_array (envp_native, envp); if (!result) throw new GException (error); }