diff options
author | NIIBE Yutaka <[email protected]> | 2022-11-04 05:41:28 +0000 |
---|---|---|
committer | NIIBE Yutaka <[email protected]> | 2022-11-04 05:41:28 +0000 |
commit | 5d30adb5ad376a07576b258b9395adadf5576867 (patch) | |
tree | 3639ded8cf8b7e237e3baeb9d5573fdfe0edb12a /src/gpg-error.h.in | |
parent | spawn: Fix spawn_cb of gpgrt_spawn_process_fd. (diff) | |
download | libgpg-error-5d30adb5ad376a07576b258b9395adadf5576867.tar.gz libgpg-error-5d30adb5ad376a07576b258b9395adadf5576867.zip |
spawn: Introduce gpgrt_process_t and use it for spawn API.
* configure.ac (AC_FUNC_FORK): No use.
* src/gpg-error.h.in (@define:gpgrt_process_t@): New.
(@define:pid_t@): Remove.
(gpgrt_spawn_process, gpgrt_spawn_process_fd): Use gpgrt_process_t.
(gpgrt_wait_process, gpgrt_wait_processes): Likewise.
(gpgrt_kill_process, gpgrt_release_process): Likewise.
* src/gpgrt-int.h (_gpgrt_spawn_process): Likewise.
(_gpgrt_spawn_process_fd): Likewise.
(_gpgrt_wait_process, _gpgrt_wait_processes): Likewise.
(_gpgrt_kill_process, _gpgrt_release_process): Likewise.
* src/mkheader.c (write_special): Handle @define:gpgrt_process_t@.
Remove handling of @define:pid_t@.
* src/spawn-posix.c (_gpgrt_spawn_process): Use gpgrt_process_t.
(_gpgrt_spawn_process_fd): Likewise.
(_gpgrt_wait_process, _gpgrt_wait_processes): Likewise.
(_gpgrt_kill_process, _gpgrt_release_process): Likewise.
* src/spawn-w32.c (_gpgrt_spawn_process): Use gpgrt_process_t.
(_gpgrt_spawn_process_fd): Likewise.
(_gpgrt_wait_process, _gpgrt_wait_processes): Likewise.
(_gpgrt_kill_process, _gpgrt_release_process): Likewise.
--
GnuPG-bug-id: 6249
Signed-off-by: NIIBE Yutaka <[email protected]>
Diffstat (limited to 'src/gpg-error.h.in')
-rw-r--r-- | src/gpg-error.h.in | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/gpg-error.h.in b/src/gpg-error.h.in index ce5c76a..d9b2365 100644 --- a/src/gpg-error.h.in +++ b/src/gpg-error.h.in @@ -432,7 +432,7 @@ const char *gpgrt_check_version (const char *req_version); const char *gpg_error_check_version (const char *req_version); /* System specific type definitions. */ -@define:pid_t@ +@define:gpgrt_process_t@ @define:gpgrt_ssize_t@ @define:gpgrt_off_t@ @@ -1108,14 +1108,14 @@ gpg_err_code_t gpgrt_spawn_process (const char *pgmname, const char *argv[], gpgrt_stream_t *r_infp, gpgrt_stream_t *r_outfp, gpgrt_stream_t *r_errfp, - pid_t *pid); + gpgrt_process_t *r_process_id); /* 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, int (*spawn_cb) (void *), void *spawn_cb_arg, - pid_t *pid); + gpgrt_process_t *r_process_id); /* Fork and exec PGMNAME as a detached process. */ gpg_err_code_t gpgrt_spawn_process_detached (const char *pgmname, @@ -1123,18 +1123,20 @@ gpg_err_code_t gpgrt_spawn_process_detached (const char *pgmname, 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); +gpg_err_code_t gpgrt_wait_process (const char *pgmname, + gpgrt_process_t process_id, + int hang, int *r_exitcode); /* Wait for a multiple processes. */ -gpg_err_code_t gpgrt_wait_processes (const char **pgmnames, pid_t *pids, +gpg_err_code_t gpgrt_wait_processes (const char **pgmnames, + gpgrt_process_t *process_ids, size_t count, int hang, int *r_exitcodes); -/* Kill the process identified by PID. */ -void gpgrt_kill_process (pid_t pid); +/* Kill the process identified by PROCESS_ID. */ +void gpgrt_kill_process (gpgrt_process_t process_id); -/* Release process resources identified by PID. */ -void gpgrt_release_process (pid_t pid); +/* Release process resources identified by PROCESS_ID. */ +void gpgrt_release_process (gpgrt_process_t process_id); /* Close all file resources (descriptors), except KEEP_FDS. */ void gpgrt_close_all_fds (int from, int *keep_fds); |