1RFIO_POPEN(3) Rfio Library Functions
2RFIO_POPEN(3)
3
4
5
6[1mNAME[0m
7 rfio_popen, rfio_pclose ‐ start a process and open a pipe
8to it
9
10[1mSYNOPSIS[0m
11 [1m#include <sys/types.h>[0m
12 [1m#include "rfio_api.h"[0m
13
14 [1mFILE *rfio_popen (const char *[4m[22mcommand[24m[1m,
15const char *[4m[22mtype[24m[1m);[0m
16
17 [1mint rfio_pclose (FILE *[4m[22mfs[24m[1m);[0m
18
19[1mDESCRIPTION[0m
20 [1mrfio_popen [22mstarts a process and opens a pipe to it.
21
22 [4mcommand[24m is a pointer to a string specifying the
23shell command to be
24 executed.
25
26 [4mtype[24m is a mode indicator for the pipe. One of the
27characters "r" or
28 "w".
29
30 [1mrfio_pclose [22mwaits for the forked process to ter‐
31minate and returns the
32 exit status of the command.
33
34[1mEXAMPLE[0m
35 int c;
36 FILE *rf;
37
38 rf = rfio_popen (command, "r");
39 if (rf == NULL) {
40 rfio_perror ("rfio_popen");
41 exit (1);
42 }
43 while ((c = rfio_pread (buf, 1, sizeof(buf), rf)) >
440) {
45 ...
46 }
47 c = rfio_pclose (rf);
48
49[1mRETURN VALUE[0m
50 This routine returns NULL if the operation failed or a
51non‐NULL pointer
52 to a FILE structure if the operation was successful. If
53it fails, [1mser‐[0m
54 [1mrno [22mvariable is set appropriately.
55
56[1mERRORS[0m
57 [1mENOMEM [22mNot enough memory.
58
59 [1mEINVAL [22mThe mode provided is invalid.
60
61 [1mECONNRESET [22mConnection reset by peer
62
63 [1mETIMEDOUT [22mConnection timed out
64
65 [1mECONNREFUSED [22mConnection refused
66
67 [1mEHOSTUNREACH [22mNo route to host
68
69 [1mSENOSHOST [22mHost unknown.
70
71 [1mSENOSSERV [22mService unknown.
72
73 [1mSEUMSG2LONG [22mCommand string too long.
74
75 [1mSECOMERR [22mCommunication error.
76
77[1mSEE ALSO[0m
78 [1mrfio_pread(3)[22m, [1mrfio_pwrite(3)[0m
79
80[1mAUTHOR[0m
81 [1mLCG Grid Deployment [22mTeam
82
83
84
85LCG $Date: 2008/09/24 11:25:01 $
86RFIO_POPEN(3)
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
127
128
129
130
131
132