102# define BUFSIZE (1024 * 64)
129 : log{message_handler}
143 std::string base_name =
"\\\\.\\pipe\\cbmc\\child\\";
146 const std::string
in_name = base_name +
"\\IN";
181 "Input pipe creation failed on SetHandleInformation");
183 const std::string
out_name = base_name +
"\\OUT";
212 "Output pipe creation failed on SetHandleInformation");
282 char **args =
reinterpret_cast<char **
>(
306 <<
" failed with error: " << std::strerror(
errno) << std::endl;
371 log.
debug() <<
"Last error code is " + std::to_string(error_code)
379 log.
debug() <<
"Zero bytes send to sub process. Retrying in "
386 "Number of bytes written to sub process must match message size."
389 " bytes were written.");
407 "Can only receive() from a fully initialised process");
408 std::string
response = std::string(
"");
430 "More bytes cannot be read at a time, than the size of the buffer");
478# define WIN_POLL_WAIT 10
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
bool can_receive()
See if this process can receive data from the other process.
void wait_receivable(int wait_time)
Wait for the pipe to be ready, waiting specified time between checks.
std::string receive()
Read a string from the child process' output.
send_responset send(const std::string &message)
Send a string message (command) to the child process.
statet
Enumeration to keep track of child process state.
piped_processt(const std::vector< std::string > &commandvec, message_handlert &message_handler)
Initiate a new subprocess with pipes supporting communication between the parent (this process) and t...
statet get_status()
Get child process status.
send_responset
Enumeration for send response.
std::string wait_receive()
Wait until a string is available and read a string from the child process' output.
Thrown when some external system fails unexpectedly.
Subprocess communication with pipes.
#define PIPED_PROCESS_INFINITE_TIMEOUT
#define PRECONDITION(CONDITION)
#define INVARIANT(CONDITION, REASON)
This macro uses the wrapper function 'invariant_violated_string'.
std::wstring widen(const char *s)