blocxx
Exec.cpp File Reference
#include "blocxx/BLOCXX_config.h"
#include "blocxx/Exec.hpp"
#include "blocxx/Select.hpp"
#include "blocxx/ExceptionIds.hpp"
#include "blocxx/TimeoutTimer.hpp"
#include "blocxx/ExecMockObject.hpp"
#include "blocxx/GlobalPtr.hpp"
#include "blocxx/WaitpidThreadFix.hpp"
#include "blocxx/PosixUnnamedPipe.hpp"
#include "blocxx/PosixExec.hpp"
#include <sys/wait.h>
#include <fcntl.h>

Go to the source code of this file.

Namespaces

namespace  BLOCXX_NAMESPACE
 Taken from RFC 1321.
 
namespace  BLOCXX_NAMESPACE::Exec
 
namespace  BLOCXX_NAMESPACE::Exec::Impl
 

Macros

#define BLOCXX_MIN(x, y)
 

Functions

Process::Status BLOCXX_NAMESPACE::Exec::system (const Array< String > &command, const char *const envp[]=0, const Timeout &=Timeout::infinite)
 Execute a command.
 
int BLOCXX_NAMESPACE::Exec::safeSystem (const Array< String > &command, const char *const envp[]=0) BLOCXX_DEPRECATED
 This is deprecated.
 
ProcessRef BLOCXX_NAMESPACE::Exec::spawnImpl (char const *exec_path, char const *const argv[], char const *const envp[], PreExec &pre_exec)
 
ProcessRef BLOCXX_NAMESPACE::Exec::spawn (char const *exec_path, char const *const argv[], char const *const envp[], PreExec &pre_exec)
 Run the executable exec_path in a child process, with argv for the program arguments and envp for the environment.
 
ProcessRef BLOCXX_NAMESPACE::Exec::spawn (char const *const argv[], char const *const envp[])
 Variant of spawn that uses StandardPreExec.
 
void BLOCXX_NAMESPACE::Exec::Impl::close_child_ends (UnnamedPipeRef ppipe[BLOCXX_NPIPE])
 
Process::Status BLOCXX_NAMESPACE::Exec::executeProcessAndGatherOutput (char const *const command[], String &output, char const *const envVars[], const Timeout &timeout=Timeout::infinite, int outputlimit=-1, char const *input=0)
 Execute a command and run feedProcessAndGatherOutput() on the process.
 
Process::Status BLOCXX_NAMESPACE::Exec::executeProcessAndGatherOutput (char const *const command[], String &output, String &erroutput, char const *const envVars[], const Timeout &timeout=Timeout::infinite, int outputLimit=-1, char const *input=0)
 Execute a command and run feedProcessAndGatherOutput() on the process.
 
BLOCXX_COMMON_API void BLOCXX_NAMESPACE::Exec::executeProcessAndGatherOutput (const Array< String > &command, String &output, int &processstatus, int timeoutsecs, int outputlimit, const String &input)
 
Process::Status BLOCXX_NAMESPACE::Exec::feedProcessAndGatherOutput (ProcessRef const &proc, String &output, Timeout const &timeout=Timeout::infinite, int outputlimit=-1, String const &input=String())
 Send input to a process, collect the output, and wait for it to exit.
 
Process::Status BLOCXX_NAMESPACE::Exec::feedProcessAndGatherOutput (ProcessRef const &proc, String &output, String &erroutput, Timeout const &timeout=Timeout::infinite, int outputLimit=-1, String const &input=String())
 Send input to a process, collect STDOUT and STDERR, and wait for it to exit.
 
void BLOCXX_NAMESPACE::Exec::gatherOutput (String &output, const ProcessRef &proc, int timeoutSecs, int outputLimit)
 
void BLOCXX_NAMESPACE::Exec::gatherOutput (String &output, const ProcessRef &proc, const Timeout &timeout=Timeout::infinite, int outputlimit=-1)
 Wait for output from a child process.
 
void BLOCXX_NAMESPACE::Exec::processInputOutput (OutputCallback &output, Array< ProcessRef > &procs, InputCallback &input, const Timeout &timeout=Timeout::infinite)
 Send input and wait for output from child processes.
 
void BLOCXX_NAMESPACE::Exec::processInputOutput (const String &input, String &output, const ProcessRef &process, const Timeout &timeout, int outputLimit)
 

Variables

::BLOCXX_NAMESPACE::GlobalPtr< ExecMockObject, Impl::NullFactoryBLOCXX_NAMESPACE::Exec::g_execMockObject = { 0, {0, PTHREAD_MUTEX_INITIALIZER} }
 

Macro Definition Documentation

◆ BLOCXX_MIN

#define BLOCXX_MIN ( x,
y )
Value:
(x) < (y) ? (x) : (y)

Definition at line 186 of file Exec.cpp.