All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Nikola Forró" <nforro-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: "Michael Kerrisk (man-pages)"
	<mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCH] popen.3: RETURN VALUE: describe successful case
Date: Thu, 28 Apr 2016 16:54:29 +0200	[thread overview]
Message-ID: <1461855269.3095.1.camel@redhat.com> (raw)

Reference:
http://pubs.opengroup.org/onlinepubs/9699919799/functions/popen.html
http://pubs.opengroup.org/onlinepubs/9699919799/functions/pclose.html

Signed-off-by: Nikola Forró <nforro-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
 man3/popen.3 | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)

diff --git a/man3/popen.3 b/man3/popen.3
index f075581..bafa42c 100644
--- a/man3/popen.3
+++ b/man3/popen.3
@@ -123,17 +123,18 @@ function waits for the associated process to terminate and returns the exit
 status of the command as returned by
 .BR wait4 (2).
 .SH RETURN VALUE
-The
-.BR popen ()
-function returns NULL if the
+.BR popen ():
+on success, returns a pointer to an open stream that
+can be used to read or write to the pipe;
+if the
 .BR fork (2)
 or
 .BR pipe (2)
-calls fail, or if it cannot allocate memory.
-.PP
-The
-.BR pclose ()
-function returns \-1 if
+calls fail, or if the function cannot allocate memory,
+NULL is returned.
+
+.BR pclose ():
+on success, returns the exit status of the command; if
 .\" These conditions actually give undefined results, so I commented
 .\" them out.
 .\" .I stream
@@ -141,10 +142,12 @@ function returns \-1 if
 .\".I stream
 .\" already "pclose()d", or if
 .BR wait4 (2)
-returns an error, or some other error is detected.
-In the event of an error, these functions set
+returns an error, or some other error is detected,
+\-1 is returned.
+.PP
+Both functions set
 .I errno
-to indicate the cause of the error.
+to an appropriate value in the case of an error.
 .SH ERRORS
 The
 .BR popen ()
-- 
2.4.11


--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

             reply	other threads:[~2016-04-28 14:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-28 14:54 Nikola Forró [this message]
     [not found] ` <1461855269.3095.1.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-05-09 20:45   ` [PATCH] popen.3: RETURN VALUE: describe successful case Michael Kerrisk (man-pages)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1461855269.3095.1.camel@redhat.com \
    --to=nforro-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.