aboutsummaryrefslogtreecommitdiff
path: root/libiberty/functions.texi
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/functions.texi
parent3c50d7b90e06fe57f391c314ff5239f22c7973cf (diff)
downloadgdb-53d7966f2a986dbd964fb20d4b9a02e64e7819b1.zip
gdb-53d7966f2a986dbd964fb20d4b9a02e64e7819b1.tar.gz
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/functions.texi')
-rw-r--r--libiberty/functions.texi48
1 files changed, 35 insertions, 13 deletions
diff --git a/libiberty/functions.texi b/libiberty/functions.texi
index 45dcd4c..b791f23 100644
--- a/libiberty/functions.texi
+++ b/libiberty/functions.texi
@@ -650,7 +650,7 @@ Sets the first @var{count} bytes of @var{s} to the constant byte
@end deftypefn
-@c mkstemps.c:54
+@c mkstemps.c:58
@deftypefn Replacement int mkstemps (char *@var{pattern}, int @var{suffix_len})
Generate a unique temporary file name from @var{pattern}.
@@ -668,14 +668,14 @@ reading and writing.
@end deftypefn
-@c pexecute.txh:244
+@c pexecute.txh:266
@deftypefn Extension void pex_free (struct pex_obj @var{obj})
Clean up and free all data associated with @var{obj}.
@end deftypefn
-@c pexecute.txh:219
+@c pexecute.txh:241
@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}.
@@ -685,7 +685,7 @@ to @code{pex_run}. Returns 0 on error, 1 on success.
@end deftypefn
-@c pexecute.txh:228
+@c pexecute.txh:250
@deftypefn Extension int pex_get_times (struct pex_obj *@var{obj}, int @var{count}, struct pex_time *@var{vector})
Returns the process execution times of all programs run using
@@ -734,7 +734,7 @@ temporary files; it may be @code{NULL} to use a randomly chosen name.
@end deftypefn
-@c pexecute.txh:146
+@c pexecute.txh:155
@deftypefn Extension {FILE *} pex_input_file (struct pex_obj *@var{obj}, int @var{flags}, const char *@var{in_name})
Return a stream for a temporary file to pass to the first program in
@@ -752,7 +752,7 @@ binary mode; otherwise, open it in the default mode. Including
@code{PEX_BINARY_OUTPUT} in @var{flags} has no effect on Unix.
@end deftypefn
-@c pexecute.txh:163
+@c pexecute.txh:172
@deftypefn Extension {FILE *} pex_input_pipe (struct pex_obj *@var{obj}, int @var{binary})
Return a stream @var{fp} for a pipe connected to the standard input of
@@ -797,7 +797,7 @@ the output pipe is you, but you are blocked on the input pipe.
@end deftypefn
-@c pexecute.txh:250
+@c pexecute.txh:272
@deftypefn Extension {const char *} pex_one (int @var{flags}, const char *@var{executable}, char * const *@var{argv}, const char *@var{pname}, const char *@var{outname}, const char *@var{errname}, int *@var{status}, int *@var{err})
An interface to permit the easy execution of a
@@ -810,7 +810,20 @@ be set to the exit status of the program.
@end deftypefn
-@c pexecute.txh:207
+@c pexecute.txh:228
+@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
+
+@c pexecute.txh:216
@deftypefn Extension {FILE *} pex_read_output (struct pex_obj *@var{obj}, int @var{binary})
Returns a @code{FILE} pointer which may be used to read the standard
@@ -861,14 +874,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
@@ -924,7 +946,7 @@ value, or to 0 if there is no relevant @code{errno}.
@end deftypefn
-@c pexecute.txh:133
+@c pexecute.txh:142
@deftypefn Extension {const char *} pex_run_in_environment (struct pex_obj *@var{obj}, int @var{flags}, const char *@var{executable}, char * const *@var{argv}, char * const *@var{env}, int @var{env_size}, const char *@var{outname}, const char *@var{errname}, int *@var{err})
Execute one program in a pipeline, permitting the environment for the
@@ -938,8 +960,8 @@ form @code{VAR=VALUE}, with the exception of the last element that must be
@end deftypefn
-@c pexecute.txh:262
-@deftypefn Extension int pexecute (const char *@var{program}, char * const *@var{argv}, const char *@var{this_pname}, const char *@var{temp_base}, char **@var{errmsg_fmt}, char **@var{errmsg_arg}, int flags)
+@c pexecute.txh:284
+@deftypefn Extension int pexecute (const char *@var{program}, char * const *@var{argv}, const char *@var{this_pname}, const char *@var{temp_base}, char **@var{errmsg_fmt}, char **@var{errmsg_arg}, int @var{flags})
This is the old interface to execute one or more programs. It is
still supported for compatibility purposes, but is no longer
@@ -966,7 +988,7 @@ name is unset/removed.
@end deftypefn
-@c pexecute.txh:270
+@c pexecute.txh:292
@deftypefn Extension int pwait (int @var{pid}, int *@var{status}, int @var{flags})
Another part of the old execution interface.