pipethrough(3) - Linux man page
Name
pipethrough - pipe a buffer through a child command and receive two buffers containing the stdout and stderr output of the child process.
Library
none -- must be included directly.
Synopsis
#include <pipethrough.h>
extern int pipethrough(const char *command,
const struct pipe_inbuffer *stdin_buf,
/*@out@*/ struct pipe_outbuffer *stdout_buf,
/*@out@*/ struct pipe_outbuffer *stderr_buf,
/*@out@*/ int *status);
Description
The pipethrough function executes the command via the shell. The command's input is the data provided in stdin_buf. The output buffers stdout_buf and stderr_buf will be filled with the output of the command. After usage they must be freed using pipe_outbuffer_finalize(3).
Return Values
On success, pipethrough returns 0. On failure it returns -1 and sets errno to the first error that occurred. Later errors are discarded silently.
Environment
SHELL' The shell invoked by pipethrough. Defaults to /bin/sh.
-
Files
/bin/sh' The default shell.
-
Examples
TODO
Errors
The various errors that can occur during execution of close(2), dup2(2), read(2), write(2), execl(3).
Standards
pipethrough does not appear in any standard I know of.
Authors
Roland Illig <roland.illig@gmx.de>.
Bugs
None known yet. If you find bugs, please report them to the authors.
Security Considerations
The command must be a properly quoted shell command. That is, don't include file names without quoting them.
BSD September 24, 2004 BSD