aboutsummaryrefslogtreecommitdiff
path: root/libiberty/pexecute.txh
diff options
context:
space:
mode:
authorVladimir Prus <vladimir@codesourcery.com>2007-01-31 18:49:42 +0000
committerVladimir Prus <vladimir@codesourcery.com>2007-01-31 18:49:42 +0000
commit53d7966f2a986dbd964fb20d4b9a02e64e7819b1 (patch)
treec4722a4490983e21069486b80770d1f584a36f4e /libiberty/pexecute.txh
parent3c50d7b90e06fe57f391c314ff5239f22c7973cf (diff)
downloadfsf-binutils-gdb-53d7966f2a986dbd964fb20d4b9a02e64e7819b1.zip
fsf-binutils-gdb-53d7966f2a986dbd964fb20d4b9a02e64e7819b1.tar.gz
fsf-binutils-gdb-53d7966f2a986dbd964fb20d4b9a02e64e7819b1.tar.bz2
include/
* libiberty.h (PEX_STDERR_TO_PIPE): New define. (PEX_BINARY_ERROR): New define. (pex_read_err): New function. libiberty/ * pex-common.h (struct pex_obj): New fields stderr_pipe and read_err. * pex-common.c (pex_init_common): Initialize stderr_pipe. (pex_run_in_environment): Add error checking for PEX_STDERR_TO_PIPE. Create a pipe for stderr if necessary. (pex_read_err): New. (pex_free): Close read_err. * pexecute.txh: Document changes. * functions.texi: Regenerated.
Diffstat (limited to 'libiberty/pexecute.txh')
-rw-r--r--libiberty/pexecute.txh24
1 files changed, 23 insertions, 1 deletions
diff --git a/libiberty/pexecute.txh b/libiberty/pexecute.txh
index 0310d8f..b87c0e5 100644
--- a/libiberty/pexecute.txh
+++ b/libiberty/pexecute.txh
@@ -67,14 +67,23 @@ Send the program's standard error to standard output, if possible.
@vindex PEX_BINARY_INPUT
@vindex PEX_BINARY_OUTPUT
+@vindex PEX_BINARY_ERROR
@item PEX_BINARY_INPUT
@itemx PEX_BINARY_OUTPUT
-The standard input (output) of the program should be read (written) in
+@itemx PEX_BINARY_ERROR
+The standard input (output or error) of the program should be read (written) in
binary mode rather than text mode. These flags are ignored on systems
which do not distinguish binary mode and text mode, such as Unix. For
proper behavior these flags should match appropriately---a call to
@code{pex_run} using @code{PEX_BINARY_OUTPUT} should be followed by a
call using @code{PEX_BINARY_INPUT}.
+
+@vindex PEX_STDERR_TO_PIPE
+@item PEX_STDERR_TO_PIPE
+Send the program's standard error to a pipe, if possible. This flag
+cannot be specified together with @code{PEX_STDERR_TO_STDOUT}. This
+flag can be specified only on the last program in pipeline.
+
@end table
@var{executable} is the program to execute. @var{argv} is the set of
@@ -216,6 +225,19 @@ it will be closed by @code{pex_free}.
@end deftypefn
+@deftypefn Extension {FILE *} pex_read_err (struct pex_obj *@var{obj}, int @var{binary})
+
+Returns a @code{FILE} pointer which may be used to read the standard
+error of the last program in the pipeline. When this is used,
+@code{PEX_LAST} should not be used in a call to @code{pex_run}. After
+this is called, @code{pex_run} may no longer be called with the same
+@var{obj}. @var{binary} should be non-zero if the file should be
+opened in binary mode. Don't call @code{fclose} on the returned file;
+it will be closed by @code{pex_free}.
+
+@end deftypefn
+
+
@deftypefn Extension int pex_get_status (struct pex_obj *@var{obj}, int @var{count}, int *@var{vector})
Returns the exit status of all programs run using @var{obj}.