summaryrefslogtreecommitdiff
path: root/process.h
diff options
context:
space:
mode:
Diffstat (limited to 'process.h')
-rw-r--r--process.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/process.h b/process.h
index 900a0b6..24ff4b0 100644
--- a/process.h
+++ b/process.h
@@ -14,8 +14,12 @@ class Process {
pid_t pid = -1;
int infd = -1, outfd = -1;
+ int exitStatus = -1;
+
string readBuf;
+ void cleanup();
+
public:
Process(const string_view execname);
Process(const Process&) = delete;
@@ -24,10 +28,13 @@ public:
void redirectStderr(const string_view fname);
void run();
- void wait();
void stop();
void unStop();
- void terminate();
+ // These return -1 if an error occurred, and the process return value otherwise.
+ // If the process was killed by a signal, (1000 + signal) is returned.
+ int wait();
+ int waitPoll(); // Also returns -1 if process hasn't finished yet
+ int terminate();
pid_t getPid() const;