diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2018-01-03 12:09:01 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2018-01-03 12:09:01 +0000 |
commit | 6b69c1f8921d0f692e9aaa65d21349e01ecc670b (patch) | |
tree | 0e1dec679b84fb933504063516c8ab98f5765298 /src/include | |
parent | ed40369c8610914085d568ec57701a035bf8dd29 (diff) | |
download | skalibs-6b69c1f8921d0f692e9aaa65d21349e01ecc670b.tar.xz |
Add child_spawn3, make textclient_startf use it
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/skalibs/djbunix.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/include/skalibs/djbunix.h b/src/include/skalibs/djbunix.h index 00d8f00..ebcba18 100644 --- a/src/include/skalibs/djbunix.h +++ b/src/include/skalibs/djbunix.h @@ -183,14 +183,24 @@ extern pid_t child_spawn2 (char const *, char const *const *, char const *const /* - Unified function to fork a child with communication channels (pipes). + Same, with an additional pipe from the child to the parent. + The int * points to 3 fds. + The additional fd# is available to the child in the defined env variable. + */ + +#define SKALIBS_CHILD_SPAWN_FDS_ENVVAR "SKALIBS_CHILD_SPAWN_FDS" + +extern pid_t child_spawn3 (char const *, char const *const *, char const *const *, int *) ; + + + /* + Generalization of the previous functions. * uses posix_spawn() if available, else uses fork+exec - * requests n (the last arg) communication fds between parent and child + * requests n (the last arg) communication fds between parent and child. Uses pipes. * if n=1, equivalent to child_spawn1_pipe; child writes, parent reads. * if n>=2, parent reads on even and writes on odd. */ -#define SKALIBS_CHILD_SPAWN_FDS_ENVVAR "SKALIBS_CHILD_SPAWN_FDS" extern pid_t child_spawn (char const *, char const *const *, char const *const *, int *, unsigned int) ; |