]> git.saurik.com Git - apple/libc.git/blame - gen/FreeBSD/popen.3.patch
Libc-498.1.5.tar.gz
[apple/libc.git] / gen / FreeBSD / popen.3.patch
CommitLineData
224c7076
A
1--- _SB/Libc/gen/FreeBSD/popen.3 2004-11-25 11:38:01.000000000 -0800
2+++ _SB/Libc/gen/FreeBSD/popen.3.edit 2006-06-28 16:55:51.000000000 -0700
3@@ -36,8 +36,8 @@
4 .Dt POPEN 3
5 .Os
6 .Sh NAME
7-.Nm popen ,
8-.Nm pclose
9+.Nm pclose ,
10+.Nm popen
11 .Nd process
12 .Tn I/O
13 .Sh LIBRARY
14@@ -45,16 +45,20 @@
15 .Sh SYNOPSIS
16 .In stdio.h
17 .Ft FILE *
18-.Fn popen "const char *command" "const char *type"
19+.Fo popen
20+.Fa "const char *command"
21+.Fa "const char *mode"
22+.Fc
23 .Ft int
24-.Fn pclose "FILE *stream"
25+.Fo pclose
26+.Fa "FILE *stream"
27+.Fc
28 .Sh DESCRIPTION
29 The
30 .Fn popen
31 function
32 .Dq opens
33-a process by creating a bidirectional pipe
34-forking,
35+a process by creating a bidirectional pipe, forking,
36 and invoking the shell.
37 Any streams opened by previous
38 .Fn popen
39@@ -62,18 +66,18 @@
40 Historically,
41 .Fn popen
42 was implemented with a unidirectional pipe;
43-hence many implementations of
44+hence, many implementations of
45 .Fn popen
46 only allow the
47-.Fa type
48+.Fa mode
49 argument to specify reading or writing, not both.
50-Since
51+Because
52 .Fn popen
53 is now implemented using a bidirectional pipe, the
54-.Fa type
55+.Fa mode
56 argument may request a bidirectional data flow.
57 The
58-.Fa type
59+.Fa mode
60 argument is a pointer to a null-terminated string
61 which must be
62 .Ql r
63@@ -88,7 +92,7 @@
64 argument is a pointer to a null-terminated string
65 containing a shell command line.
66 This command is passed to
67-.Pa /bin/sh
68+.Pa /bin/sh ,
69 using the
70 .Fl c
71 flag; interpretation, if any, is performed by the shell.
72@@ -97,7 +101,7 @@
73 .Fn popen
74 is a normal standard
75 .Tn I/O
76-stream in all respects
77+stream in all respects,
78 save that it must be closed with
79 .Fn pclose
80 rather than
81@@ -115,12 +119,12 @@
82 .Pp
83 Note that output
84 .Fn popen
85-streams are fully buffered by default.
86+streams are fully buffered, by default.
87 .Pp
88 The
89 .Fn pclose
90-function waits for the associated process to terminate
91-and returns the exit status of the command
92+function waits for the associated process to terminate;
93+it returns the exit status of the command,
94 as returned by
95 .Xr wait4 2 .
96 .Sh RETURN VALUES