.\" Copyright 1991 The Regents of the University of California.
.\" All rights reserved.
.\"
+.\" %%%LICENSE_START(BSD_4_CLAUSE_UCB)
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
+.\" %%%LICENSE_END
.\"
.\" @(#)popen.3 6.4 (Berkeley) 4/30/91
.\"
.\" Modified Sat May 18 20:37:44 1996 by Martin Schulze (joey@linux.de)
.\" Modified 7 May 1998 by Joseph S. Myers (jsm28@cam.ac.uk)
.\"
-.TH POPEN 3 2010-02-03 "GNU" "Linux Programmer's Manual"
+.TH POPEN 3 2013-04-19 "GNU" "Linux Programmer's Manual"
.SH NAME
popen, pclose \- pipe stream to or from a process
.SH SYNOPSIS
.sp
.BR popen (),
.BR pclose ():
+.RS 4
_POSIX_C_SOURCE\ >=\ 2 || _XOPEN_SOURCE || _BSD_SOURCE || _SVID_SOURCE
+.RE
.ad b
.SH DESCRIPTION
The
command's standard output is the same as that of the process that called
.BR popen (),
unless this is altered by the command itself.
-Conversely, reading from a
-"popened" stream reads the command's standard output, and the command's
+Conversely, reading from
+the stream reads the command's standard output, and the command's
standard input is the same as that of the process that called
.BR popen ().
.PP
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"
+.SH RETURN VALUE
The
.BR popen ()
function returns NULL if the
.\" 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
+.I errno
+to indicate the cause of the error.
.SH ERRORS
The
.BR popen ()
.I errno
is set to
.BR ECHILD .
-.SH "CONFORMING TO"
+.SH CONFORMING TO
POSIX.1-2001.
The \(aqe\(aq value for
.\" and a
.\" .BR pclose ()
.\" function appeared in Version 7 AT&T UNIX.
-.SH "SEE ALSO"
+.SH SEE ALSO
.BR sh (1),
.BR fork (2),
.BR pipe (2),
.BR fopen (3),
.BR stdio (3),
.BR system (3)
+.SH COLOPHON
+This page is part of release 3.79 of the Linux
+.I man-pages
+project.
+A description of the project,
+information about reporting bugs,
+and the latest version of this page,
+can be found at
+\%http://www.kernel.org/doc/man\-pages/.