OSDN Git Service

LDP: Update original to LDP v3.79
[linuxjm/LDP_man-pages.git] / original / man3 / popen.3
index bc5ce14..6dcef28 100644 (file)
@@ -1,6 +1,7 @@
 .\" Copyright 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" 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:
 .\" Redistribution and use in source and binary forms, with or without
 .\" modification, are permitted provided that the following conditions
 .\" are met:
@@ -28,6 +29,7 @@
 .\" 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.
 .\" 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
 .\"
 .\"
 .\"     @(#)popen.3    6.4 (Berkeley) 4/30/91
 .\"
@@ -35,7 +37,7 @@
 .\" 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)
 .\"
 .\" 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
 .SH NAME
 popen, pclose \- pipe stream to or from a process
 .SH SYNOPSIS
@@ -55,7 +57,9 @@ Feature Test Macro Requirements for glibc (see
 .sp
 .BR popen (),
 .BR pclose ():
 .sp
 .BR popen (),
 .BR pclose ():
+.RS 4
 _POSIX_C_SOURCE\ >=\ 2 || _XOPEN_SOURCE || _BSD_SOURCE || _SVID_SOURCE
 _POSIX_C_SOURCE\ >=\ 2 || _XOPEN_SOURCE || _BSD_SOURCE || _SVID_SOURCE
+.RE
 .ad b
 .SH DESCRIPTION
 The
 .ad b
 .SH DESCRIPTION
 The
@@ -102,8 +106,8 @@ Writing to such a stream writes to the standard input of the command; 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.
 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
 standard input is the same as that of the process that called
 .BR popen ().
 .PP
@@ -116,7 +120,7 @@ The
 function waits for the associated process to terminate and returns the exit
 status of the command as returned by
 .BR wait4 (2).
 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
 The
 .BR popen ()
 function returns NULL if the
@@ -136,6 +140,9 @@ function returns \-1 if
 .\" already "pclose()d", or if
 .BR wait4 (2)
 returns an error, or some other error is detected.
 .\" 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 ()
 .SH ERRORS
 The
 .BR popen ()
@@ -162,7 +169,7 @@ cannot obtain the child status,
 .I errno
 is set to
 .BR ECHILD .
 .I errno
 is set to
 .BR ECHILD .
-.SH "CONFORMING TO"
+.SH CONFORMING TO
 POSIX.1-2001.
 
 The \(aqe\(aq value for
 POSIX.1-2001.
 
 The \(aqe\(aq value for
@@ -191,7 +198,7 @@ The only hint is an exit status of 127.
 .\" and a
 .\" .BR pclose ()
 .\" function appeared in Version 7 AT&T UNIX.
 .\" 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 sh (1),
 .BR fork (2),
 .BR pipe (2),
@@ -201,3 +208,12 @@ The only hint is an exit status of 127.
 .BR fopen (3),
 .BR stdio (3),
 .BR system (3)
 .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/.