pipethrough

Section: C Library Functions (3)

BSD mandoc
 

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 Aq 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.


 

Index

NAME
LIBRARY
SYNOPSIS
DESCRIPTION
RETURN VALUES
ENVIRONMENT
FILES
EXAMPLES
ERRORS
STANDARDS
AUTHORS
BUGS
SECURITY CONSIDERATIONS
blog comments powered by Disqus