Skip to contentSkip to conversation

popen.3: RETURN VALUE: describe successful case

PATCH In review Nikola Forró 2 participants 2 messages Apr 28, 2016 – May 9, 2016 1 message not in the archive Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 popen.3: RETURN VALUE: describe successful case

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

---
 man3/popen.3 | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)
man3/popen.3 +14 -11
index f075581..bafa42c 100644
@@ -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 ()
Signature · 7 lines
2.4.11


--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 3 lines · Nikola Forró

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

Thanks, Nikola. Patch applied.

Cheers,

Michael

Quoted 53 lines
---
 man3/popen.3 | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)
man3/popen.3 +14 -11
index f075581..bafa42c 100644
@@ -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 ()
Signature · 7 lines
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html