>From c48f7d3e9dae0d7649ebf589d5202e997a89ac42 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Mon, 30 Nov 2020 03:01:22 +0100 Subject: [PATCH 1/2] execute, spawn-pipe: Improve documentation. * lib/execute.h: Describe progname, prog_path, prog_argv. * lib/spawn-pipe.h: Likewise. --- ChangeLog | 6 ++++++ lib/execute.h | 8 ++++++++ lib/spawn-pipe.h | 9 +++++++++ 3 files changed, 23 insertions(+) diff --git a/ChangeLog b/ChangeLog index 91b2d2d..ccb436f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2020-11-30 Bruno Haible + execute, spawn-pipe: Improve documentation. + * lib/execute.h: Describe progname, prog_path, prog_argv. + * lib/spawn-pipe.h: Likewise. + +2020-11-30 Bruno Haible + execute tests: Add more tests. * tests/test-execute-main.c: Add tests for reading, writing, isatty on inherited file descriptors >= 3. diff --git a/lib/execute.h b/lib/execute.h index 7e0ea0f..b31c4d1 100644 --- a/lib/execute.h +++ b/lib/execute.h @@ -24,6 +24,14 @@ descriptors to /dev/null. Return its exit code. If it didn't terminate correctly, exit if exit_on_error is true, otherwise return 127. + progname is the name of the program to be executed by the subprocess, used + for error messages. + prog_path is the file name of the program to be executed by the subprocess. + If it contains no slashes, a search is conducted in $PATH. An operating + system dependent suffix is added, if necessary. + prog_argv is the array of strings that the subprocess shall receive in + argv[]. It is a NULL-terminated array. prog_argv[0] should normally be + identical to prog_path. If ignore_sigpipe is true, consider a subprocess termination due to SIGPIPE as equivalent to a success. This is suitable for processes whose only purpose is to write to standard output. diff --git a/lib/spawn-pipe.h b/lib/spawn-pipe.h index 6a95650..be0f1c8 100644 --- a/lib/spawn-pipe.h +++ b/lib/spawn-pipe.h @@ -42,6 +42,15 @@ extern "C" { After finishing communication, the caller should call wait_subprocess() to get rid of the subprocess in the process table. + progname is the name of the program to be executed by the subprocess, used + for error messages. + prog_path is the file name of the program to be executed by the subprocess. + If it contains no slashes, a search is conducted in $PATH. An operating + system dependent suffix is added, if necessary. + prog_argv is the array of strings that the subprocess shall receive in + argv[]. It is a NULL-terminated array. prog_argv[0] should normally be + identical to prog_path. + If slave_process is true, the child process will be terminated when its creator receives a catchable fatal signal or exits normally. If slave_process is false, the child process will continue running in this -- 2.7.4