Home GnuPG

core: Implement the spawn functions.

Description

core: Implement the spawn functions.

* src/gpg-error.h.in  (GPGRT_SPAWN_NONBLOCK): New const.
(GPGRT_SPAWN_RUN_ASFW): New const.
(GPGRT_SPAWN_DETACHED): New const.
(gpgrt_make_pipe): New function.
(gpgrt_create_pipe): New macro.
(gpgrt_create_inbound_pipe): New macro.
(gpgrt_create_outbound_pipe): New macro.
(gpgrt_spawn_process): New function.
(gpgrt_spawn_process_fd): New function.
(gpgrt_spawn_process_detached): New function.
(gpgrt_wait_process): New function.
(gpgrt_wait_processes): New function.
(gpgrt_kill_process): New function.
(gpgrt_release_process): New function.
* src/gpg-error.def.in, src/gpg-error.vers: Add new functions.
* src/visibility.c, src/visibility.h: Add wrappers for new functions.
* src/spawn-posix.c: Rework to better fit the use in gpgrt.  Rename
all public function with a _gpgrt prefix.
* src/spawn-w32.c: Ditto.
* src/gpgrt-int.h: Likewise.
* src/Makefile.am (arch_sources): Add spawn-posix.c and spawn-w32.c.
* src/w32-add.h: Add pid_t typedef as a temporary hack.
* configure.ac: Check for signal.h and getrlimit.
(AC_FUNC_FORK): New.

This does build but porting the tests and further changes are
required. Don't assume that the API for the new fucntions is stable.

  • Signed-off-by: Werner Koch <wk@gnupg.org>

Details

Provenance
wernerAuthored on Nov 29 2017, 7:29 PM
Parents
rE8f41cc23b124: Import and relicense exechelp* functions from GnuPG.
Branches
Unknown
Tags
Unknown