23 #ifndef __ccxx_Process_hxx 24 #define __ccxx_Process_hxx 35 #include <sys/types.h> 60 {
return(_exitCode); }
69 {
return(_exitSignal); }
73 {
return(_exitedNormally); }
80 {
return(_userTime); }
87 {
return(_kernelTime); }
134 bool _exitedNormally;
136 uint64_t _kernelTime;
172 const String& workingDir =
".");
203 void setPriority(
Priority priority);
221 {
return(_started); }
246 {
return(_startTime); }
253 static void exit(
int status);
257 {
return(_progname); }
264 static String getExecutablePath();
272 static String getExecutableDir();
276 { _progname = name; }
279 static String getWorkingDir();
287 static bool setWorkingDir(
const String& path);
295 static bool hasConsole();
310 static bool getConsoleSize(
uint_t* columns,
uint_t* rows);
317 static void setConsoleTitle(
const String& title);
343 #endif // __ccxx_Process_hxx Stream & getOutputStream()
Get the output stream for the process.
Definition: Process.h++:234
static const int SUCCESS
The platform's default "success" exit status.
Definition: Process.h++:125
static const int SigTerminationRequest
Signal indicating the process received a termination request.
Definition: Process.h++:122
uint64_t getKernelTime() const
Get the total amount of kernel-space time, in milliseconds, that the process consumed.
Definition: Process.h++:86
A String vector.
Definition: String.h++:1159
int64_t time_ms_t
A time expressed in milliseconds since the epoch (00:00:00, UTC, January 1, 1970).
Definition: Integers.h++:98
An unbuffered I/O stream.
Definition: Stream.h++:60
time_ms_t getStartTime() const
Get the time at which the process was started.
Definition: Process.h++:245
~ExitStatus()
Destructor.
Definition: Process.h++:56
static const int SigAbort
Signal indicating the process was aborted.
Definition: Process.h++:98
int getExitSignal() const
Get the exit signal.
Definition: Process.h++:68
pid_t ProcessID
Definition: Common.h++:222
unsigned int uint_t
An alias for unsigned int.
Definition: Integers.h++:74
bool isStarted() const
Determine if the process has been started.
Definition: Process.h++:220
pid_t ProcessHandle
Definition: Common.h++:221
ExitStatus()
Construct a new ExitStatus.
Definition: Process.h++:53
The exit status of a process.
Definition: Process.h++:46
static const int SigIllegalInstruction
Signal indicating the process encountered an illegal machine instruction.
Definition: Process.h++:110
static String getProgramName()
Get the name of the calling program.
Definition: Process.h++:256
static const int FAILURE
The platform's default "failure" exit status.
Definition: Process.h++:128
uint_t getMaxRSS() const
Get the process's maximum resident set size, in pages.
Definition: Process.h++:94
#define COMMONCPP_API
Definition: Common.h++:126
int getExitCode() const
Get the exit code from the process.
Definition: Process.h++:59
A flexible, reference counted, copy-on-write, thread-safe, nullable string.
Definition: String.h++:50
static const int SigSegmentationFault
Signal indicating the process attempted an illegal memory access.
Definition: Process.h++:119
bool isNormal() const
Determine if the process exited normally.
Definition: Process.h++:72
A system process.
Definition: Process.h++:158
static const StringVec emptyVec
An empty StringVec.
Definition: String.h++:1171
Priority
Thread and Process priority levels.
Definition: Common.h++:307
#define CCXX_COPY_DECLS(CLASS)
Inlines declarations of a copy constructor and assignment operator for the class CLASS.
Definition: Common.h++:295
uint64_t getUserTime() const
Get the total amount of user-space time, in milliseconds, that the process consumed.
Definition: Process.h++:79
static const int SigKeyboardInterrupt
Signal indicating the process received a keyboard interrupt (Control-C).
Definition: Process.h++:116
static const int SigFloatingPointException
Signal indicating the process encountered a floating-point exception (such as division by zero)...
Definition: Process.h++:104
Definition: AllocationMap.c++:25
Stream & getErrorStream()
Get the error stream for the process.
Definition: Process.h++:241
Stream & getInputStream()
Get the input stream for the process.
Definition: Process.h++:227
static void setProgramName(const char *name)
Set the name of the calling program.
Definition: Process.h++:275