diff options
author | Martin Willi <martin@revosec.ch> | 2014-10-06 10:52:18 +0200 |
---|---|---|
committer | Martin Willi <martin@revosec.ch> | 2014-10-06 18:24:39 +0200 |
commit | 7dd06d274da5c0775e772f0d74e2f823f85b675b (patch) | |
tree | 89dc696de0d42061cce09b4814911c6cfe9336e8 /src/libstrongswan/utils/process.h | |
parent | 02e4dedce513c07da88b873acc6bd5e59dd867ae (diff) | |
download | strongswan-7dd06d274da5c0775e772f0d74e2f823f85b675b.tar.bz2 strongswan-7dd06d274da5c0775e772f0d74e2f823f85b675b.tar.xz |
process: Add a wrapper to invoke a command under the system default shell
Diffstat (limited to 'src/libstrongswan/utils/process.h')
-rw-r--r-- | src/libstrongswan/utils/process.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/libstrongswan/utils/process.h b/src/libstrongswan/utils/process.h index 62d2ce757..81719201c 100644 --- a/src/libstrongswan/utils/process.h +++ b/src/libstrongswan/utils/process.h @@ -77,4 +77,21 @@ struct process_t { process_t* process_start(char *const argv[], char *const envp[], int *in, int *out, int *err, bool close_all); +/** + * Spawn a command in a shell child process. + * + * Same as process_start(), but passes a single command to a shell, such as + * "sh -c". See process_start() for I/O redirection notes. + * + * @param envp NULL terminated list of environment variables + * @param in pipe fd returned for redirecting data to child stdin + * @param out pipe fd returned to redirect child stdout data to + * @param err pipe fd returned to redirect child stderr data to + * @param fmt printf format string for command + * @param ... arguments for fmt + * @return process, NULL on failure + */ +process_t* process_start_shell(char *const envp[], int *in, int *out, int *err, + char *fmt, ...); + #endif /** PROCESS_H_ @}*/ |