-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathcoprocess.3.html
126 lines (95 loc) · 3.6 KB
/
coprocess.3.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
Content-type: text/html; charset=UTF-8
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of coprocess</TITLE>
</HEAD><BODY>
<H1>coprocess</H1>
Section: Linux Programmer's Manual (3)<BR>Updated: 2014-05-27<BR><A HREF="#index">Index</A>
<A HREF="/#/man/index">Return to Main Contents</A><HR>
<A NAME="lbAB"> </A>
<H2>NAME</H2>
<P>
coprocv, coprocvp, coprocvpe, coprocs, coprocsp - execute a command in coprocessing mode
<A NAME="lbAC"> </A>
<H2>SYNOPSIS</H2>
<B>#include <<A HREF="file:///usr/include/execs.h">execs.h</A>></B>
<P>
<B>pid_t coprocv(const char *</B><I>path</I><B>, char *const </B><I>argv</I><B>[], int </B><I>pipefd</I><B>[2]);</B>
<BR>
<B>pid_t coprocve(const char *</B><I>path</I><B>, char *const </B><I>argv</I><B>[],</B>
<BR>
<B> char *const </B><I>envp</I><B>[], int </B><I>pipefd</I><B>[2]);</B>
<BR>
<B>pid_t coprocvp(const char *</B><I>file</I><B>, char *const </B><I>argv</I><B>[], int </B><I>pipefd</I><B>[2]);</B>
<BR>
<B>pid_t coprocvpe(const char *</B><I>file</I><B>, char *const </B><I>argv</I><B>[],</B>
<BR>
<B> char *const </B><I>envp</I><B>[], int </B><I>pipefd</I><B>[2]);</B>
<P>
<B>pid_t coprocs(const char *</B><I>path</I><B>, const char *</B><I>command</I><B>, int </B><I>pipefd</I><B>[2]);</B>
<BR>
<B>pid_t coprocse(const char *</B><I>path</I><B>, const char *</B><I>command</I><B>,</B>
<BR>
<B> char *const </B><I>envp</I><B>[], int </B><I>pipefd</I><B>[2]);</B>
<BR>
<B>pid_t coprocsp(const char *</B><I>command</I><B>, int </B><I>pipefd</I><B>[2]);</B>
<BR>
<B>pid_t coprocspe(const char *</B><I>command</I><B>, char *const </B><I>envp</I><B>[],</B>
<BR>
<B> int </B><I>pipefd</I><B>[2]);</B>
<P>
These functions are provided by libexecs. Link with <I>-lexecs</I>.
<A NAME="lbAD"> </A>
<H2>DESCRIPTION</H2>
These functions run commands in coprocessing mode.
They differs in the way to specify the executable file to run and its
parameters.
All of them define two pipes (by <B><A HREF="/#/man/man2/pipe.2.html">pipe</A></B>(2)), create a new process by
<B><A HREF="/#/man/man2/fork.2.html">fork</A></B>(2), redirect the standard input and output of the new process
in the two pipes, and exec a program by one of the <B><A HREF="/#/man/man3/exec.3.html">exec</A></B>(3) functions.
<P>
The calling program controls both the standard input and the standard output
of the called process: writing to <B>pipefd[1]</B> provides input to the
coprocess while the coprocess output can be retrieved from <B>pipefd[0]</B>.
<P>
<B>coprocv</B>,
<B>coprocve</B>,
<B>coprocvp</B>,
<B>coprocvpe</B>,
<B>coprocs</B>,
<B>coprocse</B>,
<B>coprocsp</B>,
and <B>coprocsp</B>
differ as they define the executable file to run and its arguments as
<B>execv</B>,
<B>execve</B>,
<B>execvp</B>,
<B>execvpe</B>,
<B>execs</B>,
<B>execse</B>,
<B>execsp</B>,
and <B>execsp</B>, repectively.
<P>
<A NAME="lbAE"> </A>
<H2>BUGS</H2>
Bug reports should be addressed to <<A HREF="mailto:info@virtualsquare.org">info@virtualsquare.org</A>>
<A NAME="lbAF"> </A>
<H2>AUTHOR</H2>
Renzo Davoli <<A HREF="mailto:renzo@cs.unibo.it">renzo@cs.unibo.it</A>>
<P>
<P>
<HR>
<A NAME="index"> </A><H2>Index</H2>
<DL>
<DT><A HREF="#lbAB">NAME</A><DD>
<DT><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT><A HREF="#lbAE">BUGS</A><DD>
<DT><A HREF="#lbAF">AUTHOR</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 15:22:07 GMT, November 27, 2023
</BODY>
</HTML>