aboutsummaryrefslogtreecommitdiffstats
path: root/src/gpg-error.h.in
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpg-error.h.in')
-rw-r--r--src/gpg-error.h.in51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/gpg-error.h.in b/src/gpg-error.h.in
index 20d196a..991636d 100644
--- a/src/gpg-error.h.in
+++ b/src/gpg-error.h.in
@@ -1025,6 +1025,57 @@ void _gpgrt_log_assert (const char *expr, const char *file, int line,
#endif /*GPGRT_ENABLE_LOG_MACROS*/
+
+/*
+ * Spawn functions
+ */
+
+#define GPGRT_SPAWN_NONBLOCK 16 /* Set the streams to non-blocking. */
+#define GPGRT_SPAWN_RUN_ASFW 64 /* Use AllowSetForegroundWindow on W32. */
+#define GPGRT_SPAWN_DETACHED 128 /* Start the process in the background. */
+
+/* Function and convenience macros to create pipes. */
+gpg_err_code_t gpgrt_make_pipe (int filedes[2], estream_t *r_fp,
+ int direction, int nonblock);
+#define gpgrt_create_pipe(a) gpgrt_make_pipe ((a),NULL, 0, 0);
+#define gpgrt_create_inbound_pipe(a,b,c) gpgrt_make_pipe ((a), (b), -1,(c));
+#define gpgrt_create_outbound_pipe(a,b,c) gpgrt_make_pipe ((a), (b), 1,(c));
+
+
+/* Fork and exec PGMNAME. */
+gpg_err_code_t gpgrt_spawn_process (const char *pgmname, const char *argv[],
+ int *execpt, void (*preexec)(void),
+ unsigned int flags,
+ estream_t *r_infp,
+ estream_t *r_outfp,
+ estream_t *r_errfp,
+ pid_t *pid);
+
+/* Fork and exec PGNNAME and connect the process to the given FDs. */
+gpg_err_code_t gpgrt_spawn_process_fd (const char *pgmname, const char *argv[],
+ int infd, int outfd, int errfd,
+ pid_t *pid);
+
+/* Fork and exec PGMNAME as a detached process. */
+gpg_err_code_t gpgrt_spawn_process_detached (const char *pgmname,
+ const char *argv[],
+ const char *envp[] );
+
+/* Wait for a single process. */
+gpg_err_code_t gpgrt_wait_process (const char *pgmname, pid_t pid, int hang,
+ int *r_exitcode);
+
+/* Wait for a multiple processes. */
+gpg_err_code_t gpgrt_wait_processes (const char **pgmnames, pid_t *pids,
+ size_t count, int hang, int *r_exitcodes);
+
+/* Kill the process identified by PID. */
+void gpgrt_kill_process (pid_t pid);
+
+/* Release process resources identified by PID. */
+void gpgrt_release_process (pid_t pid);
+
+
#ifdef __cplusplus
}