summaryrefslogtreecommitdiff
path: root/src/visibility.c
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2022-11-04 14:41:28 +0900
committerNIIBE Yutaka <gniibe@fsij.org>2022-11-04 14:41:28 +0900
commit5d30adb5ad376a07576b258b9395adadf5576867 (patch)
tree3639ded8cf8b7e237e3baeb9d5573fdfe0edb12a /src/visibility.c
parent6c20e8393eba4a9f330143b2158e28ea594cbadd (diff)
downloadlibgpg-error-5d30adb5ad376a07576b258b9395adadf5576867.tar.gz
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 <gniibe@fsij.org>
Diffstat (limited to 'src/visibility.c')
-rw-r--r--src/visibility.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/src/visibility.c b/src/visibility.c
index 577a2be..dd1a6a8 100644
--- a/src/visibility.c
+++ b/src/visibility.c
@@ -1103,21 +1103,20 @@ gpg_err_code_t
gpgrt_spawn_process (const char *pgmname, const char *argv[],
int *except, unsigned int flags,
estream_t *r_infp, estream_t *r_outfp, estream_t *r_errfp,
- pid_t *pid)
+ gpgrt_process_t *r_process_id)
{
return _gpgrt_spawn_process (pgmname, argv, except, flags,
- r_infp, r_outfp, r_errfp, pid);
+ r_infp, r_outfp, r_errfp, r_process_id);
}
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)
+ void *spawn_cb_arg, gpgrt_process_t *r_process_id)
{
return _gpgrt_spawn_process_fd (pgmname, argv, infd, outfd, errfd,
- spawn_cb, spawn_cb_arg, pid);
+ spawn_cb, spawn_cb_arg, r_process_id);
}
gpg_err_code_t
@@ -1128,28 +1127,30 @@ gpgrt_spawn_process_detached (const char *pgmname, const char *argv[],
}
gpg_err_code_t
-gpgrt_wait_process (const char *pgmname, pid_t pid, int hang, int *r_exitcode)
+gpgrt_wait_process (const char *pgmname, gpgrt_process_t process_id, int hang,
+ int *r_exitcode)
{
- return _gpgrt_wait_process (pgmname, pid, hang, r_exitcode);
+ return _gpgrt_wait_process (pgmname, process_id, hang, r_exitcode);
}
gpg_err_code_t
-gpgrt_wait_processes (const char **pgmnames, pid_t *pids,
+gpgrt_wait_processes (const char **pgmnames, gpgrt_process_t *process_ids,
size_t count, int hang, int *r_exitcodes)
{
- return _gpgrt_wait_processes (pgmnames, pids, count, hang, r_exitcodes);
+ return _gpgrt_wait_processes (pgmnames, process_ids, count, hang,
+ r_exitcodes);
}
void
-gpgrt_kill_process (pid_t pid)
+gpgrt_kill_process (gpgrt_process_t process_id)
{
- _gpgrt_kill_process (pid);
+ _gpgrt_kill_process (process_id);
}
void
-gpgrt_release_process (pid_t pid)
+gpgrt_release_process (gpgrt_process_t process_id)
{
- _gpgrt_release_process (pid);
+ _gpgrt_release_process (process_id);
}
void