|
a/src/utils/execmd.h |
|
b/src/utils/execmd.h |
|
... |
|
... |
118 |
* @param cmd the program to execute. This must be an absolute file name
|
118 |
* @param cmd the program to execute. This must be an absolute file name
|
119 |
* or exist in the PATH.
|
119 |
* or exist in the PATH.
|
120 |
* @param args the argument list (NOT including argv[0]).
|
120 |
* @param args the argument list (NOT including argv[0]).
|
121 |
* @param input Input to send TO the command.
|
121 |
* @param input Input to send TO the command.
|
122 |
* @param output Output FROM the command.
|
122 |
* @param output Output FROM the command.
|
123 |
* @return the exec ouput status (0 if ok).
|
123 |
* @return the exec ouput status (0 if ok), or -1
|
124 |
*/
|
124 |
*/
|
125 |
int doexec(const string &cmd, const list<string>& args,
|
125 |
int doexec(const string &cmd, const list<string>& args,
|
126 |
const string *input = 0,
|
126 |
const string *input = 0,
|
127 |
string *output = 0);
|
127 |
string *output = 0);
|
128 |
|
128 |
|
|
... |
|
... |
133 |
int startExec(const string &cmd, const list<string>& args,
|
133 |
int startExec(const string &cmd, const list<string>& args,
|
134 |
bool has_input, bool has_output);
|
134 |
bool has_input, bool has_output);
|
135 |
int send(const string& data);
|
135 |
int send(const string& data);
|
136 |
int receive(string& data, int cnt = -1);
|
136 |
int receive(string& data, int cnt = -1);
|
137 |
int getline(string& data);
|
137 |
int getline(string& data);
|
138 |
int wait(bool haderror = false);
|
138 |
int wait();
|
|
|
139 |
/** Wait with WNOHANG set.
|
|
|
140 |
@return true if process exited, false else.
|
|
|
141 |
@param O: status, the wait(2) call's status value */
|
|
|
142 |
bool maybereap(int *status);
|
139 |
|
143 |
|
140 |
pid_t getChildPid() {return m_pid;}
|
144 |
pid_t getChildPid() {return m_pid;}
|
141 |
|
145 |
|
142 |
/**
|
146 |
/**
|
143 |
* Cancel/kill command. This can be called from another thread or
|
147 |
* Cancel/kill command. This can be called from another thread or
|