diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2017-12-01 08:46:15 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2017-12-01 08:47:56 +0200 |
commit | 048800a78f64808116bb9b943837062a67f586ae (patch) | |
tree | ec97848673a9ebfe6cb5fe8c7ef4e96d943db004 /runcap.3 | |
parent | 0145de1db25c3840346b9cd9ea44e571812e5516 (diff) | |
download | runcap-048800a78f64808116bb9b943837062a67f586ae.tar.gz runcap-048800a78f64808116bb9b943837062a67f586ae.tar.bz2 |
Bugfixes
* runcap.3: Update docs.
* runcap.c (stream_capture_get,stream_capture_put)
(runcap_loop): Handle EINTR.
* README: New file.
Diffstat (limited to 'runcap.3')
-rw-r--r-- | runcap.3 | 23 |
1 files changed, 12 insertions, 11 deletions
@@ -13,7 +13,7 @@ .\" .\" You should have received a copy of the GNU General Public License .\" along with runcap. If not, see <http://www.gnu.org/licenses/>. -.TH RUNCAP 2 "August 19, 2017" "RUNCAP" "User Commands" +.TH RUNCAP 2 "August 22, 2017" "RUNCAP" "User Commands" .SH NAME runcap \- run external process and capture its stdout and stderr .SH SYNOPSIS @@ -78,12 +78,12 @@ struct runcap .fi .in .PP -The members that may be initialized on input are marked with +Members that may be initialized on input are marked with [\fIIN\fR], those that are set upon return from \fBruncap()\fR are marked with [\fIOUT\fR]. .PP The caller is responsible for initializing the \fBrc_argv\fR member -with a pointer to the command line arguments array. The other +with a pointer to the command line arguments array. Other input fields are: .TP .B rc_program @@ -140,11 +140,12 @@ The caller may initialize the following members in .B sc_size Size of the buffer (\fBsize_t\fR). If set, the \fBRCF_STDOUT_SIZE\fR (for \fBRUNCAP_STDOUT\fR) or \fBRCF_STDERR_SIZE\fR (for -\fBRUNCAP_STDERR\fR) bit must be set in \fIflags\fR. The default -buffer size is 4096 bytes. If the amount of input data exceeds the -buffer size, the data are saved in the disk file, therefore setting a -larger buffer can improve performance. Setting \fBsc_size\fR to 0 -disables capturing. +\fBRUNCAP_STDERR\fR) bit must be set in \fIflags\fR. If the amount of +input data exceeds the buffer size, the data are saved in the disk +file, therefore setting a larger buffer can improve performance. +Setting \fBsc_size\fR to 0 disables capturing. + +Default buffer size is 4096 bytes. .TP .B sc_linemon A pointer to the line monitor function. If set, the @@ -153,7 +154,7 @@ A pointer to the line monitor function. If set, the \fIflags\fR. .sp The line monitor function allows the caller to monitor the arrival of -the new data in the corresponding stream. Its signature is: +the new data in the corresponding stream. It is declared as follows: .sp .BI "void linemon(const char *" line ", size_t " size ", void *" data ) .sp @@ -208,7 +209,7 @@ Termination status, as returned by .B rc_errno Value of errno, if terminated on error. .PP -Upon successful return, the following fields are initialized: +The following fields are defined upon successful return: .TP .B rc_cap[RUNCAP_STDOUT].sc_leng Total length of captured stdout. @@ -227,7 +228,7 @@ The actual data can be retrieved using the \fBruncap_getc\fR, and .SH Examining output Upon return from \fBruncap\fR the following functions can be used to retrieve the captured data from the \fBstruct runcap\fR object pointed -to by its \fIrc\fR argument. The stream to retrieve the data from is +to by its \fIrc\fR argument. The stream to retrieve data from is identified by the \fIstream\fR argument, whose valid values are \fBRUNCAP_STDOUT\fR (or \fB1\fR) or \fBRUNCAP_STDERR\fR (or \fB2\fR). .PP |