Commits

Greg Ward  committed 63fb4bb

capture: clarify docs

  • Participants
  • Parent commits fe6108d

Comments (0)

Files changed (1)

File src/capture.h

 } capture_t;
 
 /* fork() and exec() a child process, capturing its entire stdout and
- * stderr to a capture object. capture->stdout.buf is the child's
- * stdout, and capture->stdout.len the number of bytes read (buf is
- * null terminated, so as long as the child's output is textual, you
- * can use buf as a string). Similarly, child's stderr is in
+ * stderr to a capture object. Just like with execvp(), argv[0] should
+ * be file (unless you are playing funny games) and the last element
+ * of argv must be NULL.
+ *
+ * On return, capture->stdout.buf will be the child's stdout, and
+ * capture->stdout.len the number of bytes read. capture->stdout.buf
+ * is null terminated, so as long as the child's output is textual,
+ * you can use it as a string. Similarly, child's stderr is in
  * capture->stderr.buf and capture->stderr.len.
  */
 capture_t *