1 .\" $NetBSD: mdoc.template,v 1.5 2002/01/12 02:24:29 wiz Exp $
5 .\" The uncommented requests are required for all man pages.
6 .\" The commented requests should be uncommented and used where appropriate.
12 .Nd pipe a buffer through a child command and receive two
13 buffers containing the stdout and stderr output of the child process.
15 none -- must be included directly.
18 #include <pipethrough.h>
20 extern int pipethrough(const char *command,
21 const struct pipe_inbuffer *stdin_buf,
22 /*@out@*/ struct pipe_outbuffer *stdout_buf,
23 /*@out@*/ struct pipe_outbuffer *stderr_buf,
24 /*@out@*/ int *status);
27 The pipethrough function executes the \fIcommand\fR via the shell. The
28 command's input is the data provided in \fIstdin_buf\fR. The output buffers
29 \fIstdout_buf\fR and \fIstderr_buf\fR will be filled with the output of the
30 command. After usage they must be freed using pipe_outbuffer_finalize(3).
32 On success, pipethrough returns 0. On failure it returns -1 and sets
33 \fIerrno\fR to the first error that occurred. Later errors are discarded
38 The shell invoked by pipethrough. Defaults to /bin/sh.
50 The various errors that can occur during execution of close(2), dup2(2),
51 read(2), write(2), execl(3).
53 .\" Cross-references should be ordered by section (low to high), then in
54 .\" alphabetical order.
56 pipethrough does not appear in any standard I know of.
60 .Aq roland.illig@gmx.de .
62 None known yet. If you find bugs, please report them to the authors.
63 .Sh SECURITY CONSIDERATIONS
64 The \fIcommand\fR must be a properly quoted shell command. That is,
65 don't include file names without quoting them.