Add a Kill() function to the Program class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81246 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/System/Unix/Program.inc b/lib/System/Unix/Program.inc
index fca9292..fdd0c25 100644
--- a/lib/System/Unix/Program.inc
+++ b/lib/System/Unix/Program.inc
@@ -283,6 +283,16 @@
}
+bool
+Program::Kill(std::string* ErrMsg) {
+ if (Pid_ == 0) {
+ MakeErrMsg(ErrMsg, "Process not started!");
+ return true;
+ }
+
+ return (kill(Pid_, SIGKILL) == 0);
+}
+
bool Program::ChangeStdinToBinary(){
// Do nothing, as Unix doesn't differentiate between text and binary.
return false;