diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2017-07-24 10:46:44 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2017-07-24 10:46:44 +0300 |
commit | ead370a83f981ccf3d288dbe222fd362ec801f79 (patch) | |
tree | 74dfef1fe64df5e659ffbd3f74023453913bbc14 | |
parent | 3f686a2e5768174553b39697576171f5862433e3 (diff) | |
download | runcap-ead370a83f981ccf3d288dbe222fd362ec801f79.tar.gz runcap-ead370a83f981ccf3d288dbe222fd362ec801f79.tar.bz2 |
Improve manpage
-rw-r--r-- | runcap.3 | 17 |
1 files changed, 11 insertions, 6 deletions
@@ -10,13 +10,13 @@ .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" .\" 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 "July 19, 2017" "RUNCAP" "User Commands" +.TH RUNCAP 2 "July 24, 2017" "RUNCAP" "User Commands" .SH NAME runcap \- run external process and capture its stdout and stderr .SH SYNOPSIS .nf .B #include <runcap.h> .sp @@ -25,13 +25,13 @@ runcap \- run external process and capture its stdout and stderr .sp .BI "int runcap_getc(struct runcap *" rc ", int " stream ", char *" cp ); .BI "ssize_t runcap_getline(struct runcap *" rc ", int " stream , .BI " char **" pstr ", size_t *" psize ); .sp .BI "off_t runcap_tell(struct runcap *" rc ", int " stream ); -.BI "int runcap_seek(struct runcap *" rc ", int " stream ", off_t " off ", int " whence); +.BI "off_t runcap_seek(struct runcap *" rc ", int " stream ", off_t " off ", int " whence); .BI "int runcap_rewind(struct runcap *" rc ", int " stream ); .SH DESCRIPTION The function .B runcap runs an external command, and waits for its termination, capturing its standard output and standard error streams, and optionally @@ -314,23 +314,28 @@ and -1 on error. The function .B runcap_getline() returns the number of retrieved characters (including the newline) on success, 0 on end of stream, and -1 on error. .PP .B runcap_tell() -returns the current offset (a non-negative value) on success, and -1 +and +.B runcap_seek() +return the current offset (a non-negative value) on success, and -1 on error. .PP -.B runcap_seek() -and .B runcap_rewind() -return 0 on success and -1 on error. +returns 0 on success and -1 on error. .PP When returning an error (-1), all functions set the global \fBerrno\fR variable to the code describing the error. .SH EXAMPLE +The function below runs the +.BR tar (1) +command in verbose mode and returns its output as an array of +strings. +.PP .in +4n .nf char ** archive(void) { struct runcap rc; |